Reference manual

Public API

This manual describes the public TypeScript surface package by package. New to SearSuite? Start with the library guide.

Showing 85 of 85 packages3044 of 3044 exportsderived from source

Package

@searsuite/sear-assembly-commands

79 exports

Typed command definitions and transaction factories shared by editor composition roots.

classDocCommandBussource ↗
class DocCommandBus

The supported execution entry point for document user and program actions.

constructorconstructor
DocCommandBus(platform?: Platform): DocCommandBus

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

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

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

methodbind
bind(context: DocCommandContext): void

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

context: DocCommandContext
methoddestroy
destroy(): void

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

methodenforceRegistrationBoundary
enforceRegistrationBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodgetRegisteredCommandIds
getRegisteredCommandIds(): readonly string[]

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

methodgetRegisteredCommands
getRegisteredCommands(): readonly DocCommandDefinition<unknown, DocCommandResult>[]

Returns the typed definitions registered on this editor instance.

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

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

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

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

methodregister
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.

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

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

definition: Definition
input: DocCommandInput<Definition>
methodrunWithoutMutationAuthority
runWithoutMutationAuthority<Value>(callback: (): Value): Value

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

callback: (): Value
methodsubscribe
subscribe(listener: DocCommandListener): (): void

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

listener: DocCommandListener
classDocCommandDispatchersource ↗
class DocCommandDispatcher

Executes document command objects against one command context.

constructorconstructor
DocCommandDispatcher(): DocCommandDispatcher
methodexecute
execute<Result>(context: DocCommandContext, command: DocEditorCommand<Result>): Result

Runs a command, validates its result and applies its operation/effects.

context: DocCommandContext
command: DocEditorCommand<Result>
classEffectCommandsource ↗
class EffectCommand extends SheetCommand<SheetCommandResult>

Command that emits local effects without mutating OT state.

constructorconstructor
EffectCommand(effects: readonly SheetCommandEffect[]): EffectCommand

Creates an effect-only command.

effects: readonly SheetCommandEffect[]
propertyid
readonly id: "effect.apply"

Stable id for effect-only command execution.

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Returns an empty pipeline plus the local effects to apply.

_context: SheetCommandContext
classLocalActionCommandsource ↗
class LocalActionCommand extends SheetCommand<SheetCommandResult>

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

constructorconstructor
LocalActionCommand(id: string, run: (): void): LocalActionCommand

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

id: string
run: (): void
propertyid
readonly id: string

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

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Returns a pipeline containing only the local action step.

_context: SheetCommandContext
classPipelineExecutionCommandsource ↗
class PipelineExecutionCommand extends SheetCommand<SheetCommandResult>

Executes a complete, named pipeline through the command bus.

constructorconstructor
PipelineExecutionCommand(id: string, pipeline: Pipeline): PipelineExecutionCommand

Creates a command around an existing named pipeline.

id: string
pipeline: Pipeline
propertyid
readonly id: string

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

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Returns the provided pipeline unchanged.

_context: SheetCommandContext
classSheetAxisMoveBoundsErrorsource ↗
class SheetAxisMoveBoundsError extends SearError

A requested block or insertion boundary falls outside its axis.

constructorconstructor
SheetAxisMoveBoundsError(input: SheetMoveAxisInput, size: number): SheetAxisMoveBoundsError
input: SheetMoveAxisInput
size: number
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_AXIS_MOVE_BOUNDS"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetCommandBussource ↗
class SheetCommandBus

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.

constructorconstructor
SheetCommandBus(platform?: Platform): SheetCommandBus

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

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

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

methodbind
bind(context: SheetCommandContext): void

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

context: SheetCommandContext
methoddestroy
destroy(): void

Clears editor binding, listeners and command registrations during teardown.

methodenforceRegistrationBoundary
enforceRegistrationBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodgetRegisteredCommandIds
getRegisteredCommandIds(): readonly string[]

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

methodgetRegisteredCommands
getRegisteredCommands(): readonly SheetCommandDefinition<unknown, SheetCommandResult>[]

Returns the typed definitions registered on this editor instance.

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

Returns whether this editor instance currently exposes a command id.

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

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

methodregister
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.

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

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

definition: Definition
input: SheetCommandInput<Definition>
methodrunWithoutMutationAuthority
runWithoutMutationAuthority<Value>(callback: (): Value): Value

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

callback: (): Value
methodsubscribe
subscribe(listener: SheetCommandListener): (): void

Subscribes to command lifecycle events and returns an unsubscribe function.

listener: SheetCommandListener
classSheetCommandDispatchersource ↗
class SheetCommandDispatcher

Executes command objects against one command context.

constructorconstructor
SheetCommandDispatcher(): SheetCommandDispatcher
methodexecute
execute<Result>(context: SheetCommandContext, command: SheetCommand<Result>): Result

Runs a command, validates its result and applies its pipeline/effects.

context: SheetCommandContext
command: SheetCommand<Result>
classSheetQueryRegistrysource ↗
class SheetQueryRegistry

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

constructorconstructor
SheetQueryRegistry(): SheetQueryRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for registration changes after assembly.

assertWrite: (): void
methodgetRegisteredQueryIds
getRegisteredQueryIds(): readonly string[]
methodhas
has(definition: string | SheetQueryDefinition<unknown, unknown>): boolean
definition: string | SheetQueryDefinition<unknown, unknown>
methodregister
register<Definition>(definition: Definition, handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>): (): void
definition: Definition
handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>
methodrun
run<Definition>(definition: Definition, input: SheetQueryInput<Definition>): SheetQueryResult<Definition>
definition: Definition
input: SheetQueryInput<Definition>
classTransactionPipelineCommandsource ↗
class TransactionPipelineCommand extends SheetCommand<SheetCommandResult>

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

constructorconstructor
TransactionPipelineCommand(id: string, transaction: Transaction): TransactionPipelineCommand

Creates a command around an existing transaction.

id: string
transaction: Transaction
propertyid
readonly id: string

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

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Converts the provided transaction into a pipeline result.

_context: SheetCommandContext
interfaceDocCommandContextsource ↗
interface DocCommandContext

Runtime services exposed to document commands while they execute.

methodapplyEffect
applyEffect(effect: DocCommandEffect): void

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

effect: DocCommandEffect
methodexecutePipeline
executePipeline(pipeline: Pipeline): void

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

pipeline: Pipeline
interfaceDocCommandDefinitionsource ↗
interface DocCommandDefinition<Input, Result>

A stable document command identifier carrying its input and result contract.

property[docCommandInputType]
readonly [docCommandInputType]: Input

Phantom field that preserves the command input type for callers.

property[docCommandResultType]
readonly [docCommandResultType]: Result

Phantom field that preserves the command result type for callers.

propertyid
readonly id: string

Globally stable command id owned by the document feature package that defines it.

interfaceDocCommandEventsource ↗
interface DocCommandEvent

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

propertyerror
readonly error?: unknown

Original thrown value when the command failed.

propertyid
readonly id: string

Stable command id being executed.

propertyphase
readonly phase: CommandExecutionPhase

Execution phase represented by this event.

propertyresult
readonly result?: DocCommandResult

Result returned by a completed command.

interfaceDocCommandResultsource ↗
interface DocCommandResult

Standard command result that document Core can execute and observe.

propertyeffects
readonly effects?: readonly DocCommandEffect[]

Optional local effects requested after operation execution.

propertypipeline
readonly pipeline: Pipeline

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

interfaceDocEditorCommandsource ↗
interface DocEditorCommand<Result>

Executable unit behind a typed document command definition.

propertyid
readonly id: string

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

methodexecute
execute(context: DocCommandContext): Result

Runs command logic and returns a pipeline-backed result.

context: DocCommandContext
interfaceExtendSelectionCommandInputsource ↗
interface ExtendSelectionCommandInput

Input required to extend a sheet selection by keyboard navigation.

propertycursor
readonly cursor: SelectionPoint

Current moving edge before this navigation step.

propertydirection
readonly direction: SelectionMoveDirection

Direction requested by the user.

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

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

propertyjumpToEdge
readonly jumpToEdge?: boolean

Whether navigation should jump to the sheet edge.

propertylastCol
readonly lastCol: number

Last valid column index.

propertylastRow
readonly lastRow: number

Last valid row index.

propertyorigin
readonly origin: SelectionPoint

Fixed selection anchor where extension began.

interfaceMoveSelectionCommandInputsource ↗
interface MoveSelectionCommandInput

Public contract for MoveSelectionCommandInput.

propertydirection
readonly direction: SelectionMoveDirection
propertyfindMerge
readonly findMerge: (point: SheetPoint): SheetMergedCellRange | undefined
propertyfocus
readonly focus: SheetPoint
propertyjumpToEdge
readonly jumpToEdge?: boolean
propertylastCol
readonly lastCol: number
propertylastRow
readonly lastRow: number
interfaceMoveSelectionCommandResultsource ↗
interface MoveSelectionCommandResult

Public contract for MoveSelectionCommandResult.

propertyanchor
readonly anchor: [number, number]
propertyfocus
readonly focus: [number, number]
interfaceSelectRangeCommandInputsource ↗
interface SelectRangeCommandInput

Public contract for SelectRangeCommandInput.

propertyend
readonly end: SelectionPoint
propertyfindMerge
readonly findMerge: (point: SelectionPoint): { end: SelectionPoint; start: SelectionPoint } | undefined
propertylastCol
readonly lastCol?: number
propertylastRow
readonly lastRow?: number
propertystart
readonly start: SelectionPoint
interfaceSelectRangeCommandResultsource ↗
interface SelectRangeCommandResult

Public contract for SelectRangeCommandResult.

propertyanchor
readonly anchor: [number, number]
propertyfocus
readonly focus: [number, number]
interfaceSheetClearRangeContentsCommandDataSourcesource ↗
interface SheetClearRangeContentsCommandDataSource<Cell>

Sheet cell data required to create clear-contents operations.

propertytarget
readonly target: PluginKey

Plugin key that owns the persisted sheet data matrix.

methodgetColumnCount
getColumnCount(): number

Current column count.

methodgetRowCount
getRowCount(): number

Current row count.

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

Reads the current cell value at row, column.

row: number
column: number
interfaceSheetClearRangeContentsInputsource ↗
interface SheetClearRangeContentsInput extends SheetRangeInput

Public input for clearing persisted contents in a range.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

interfaceSheetCommandsource ↗
interface SheetCommand<Result>

Executable unit behind a typed command definition.

propertyid
readonly id: string

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

methodexecute
execute(context: SheetCommandContext): Result

Runs command logic and returns a pipeline-backed result.

context: SheetCommandContext
interfaceSheetCommandContextsource ↗
interface SheetCommandContext

Runtime services exposed to commands while they execute.

methodapplyEffect
applyEffect(effect: SheetCommandEffect): void

Applies a local UI/runtime effect after pipeline execution.

effect: SheetCommandEffect
methodexecutePipeline
executePipeline(pipeline: Pipeline): void

Applies the command-produced pipeline through the core transaction boundary.

pipeline: Pipeline
interfaceSheetCommandDefinitionsource ↗
interface SheetCommandDefinition<Input, Result>

A stable command identifier carrying its input and result contract.

property[sheetCommandInputType]
readonly [sheetCommandInputType]: Input

Phantom field that preserves the command input type for callers.

property[sheetCommandResultType]
readonly [sheetCommandResultType]: Result

Phantom field that preserves the command result type for callers.

propertyid
readonly id: string

Globally stable command id owned by the feature package that defines it.

interfaceSheetCommandEventsource ↗
interface SheetCommandEvent

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

propertyerror
readonly error?: unknown

Original thrown value when the command failed.

propertyid
readonly id: string

Stable command id being executed.

propertyphase
readonly phase: CommandExecutionPhase

Execution phase represented by this event.

propertyresult
readonly result?: SheetCommandResult

Successfully executed command result, present only for the completed phase.

interfaceSheetCommandResultsource ↗
interface SheetCommandResult

Standard command result that Core can execute and observe.

propertycompletion
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertyeffects
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertypipeline
readonly pipeline: Pipeline

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

interfaceSheetDeleteColumnsInputsource ↗
interface SheetDeleteColumnsInput

Public input for deleting columns starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetDeleteRowsInputsource ↗
interface SheetDeleteRowsInput

Public input for deleting rows starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetInsertColumnsInputsource ↗
interface SheetInsertColumnsInput

Public input for inserting columns before index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetInsertRowsInputsource ↗
interface SheetInsertRowsInput

Public input for inserting rows before index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetMoveAxisInputsource ↗
interface SheetMoveAxisInput

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

propertybefore
readonly before: number
propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetQueryDefinitionsource ↗
interface SheetQueryDefinition<Input, Result>

A stable query identifier carrying its input and result contract.

property__input
readonly __input?: Input
property__result
readonly __result?: Result
propertyid
readonly id: string
propertyresultMode
readonly resultMode?: "reader"

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

interfaceSheetRangeBoundssource ↗
interface SheetRangeBounds

Normalized rectangular sheet range bounds expressed as inclusive cell coordinates.

propertyend
readonly end: SheetCellPoint

Inclusive bottom-right cell coordinate.

propertystart
readonly start: SheetCellPoint

Inclusive top-left cell coordinate.

interfaceSheetRangeInputsource ↗
interface SheetRangeInput

Common range input accepted by explicit range commands.

propertyanchor
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocus
readonly focus: SheetCellPoint

Opposite corner of the target range.

interfaceSheetStructureCommandDataSourcesource ↗
interface SheetStructureCommandDataSource<Cell>

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

propertytarget
readonly target: PluginKey

Plugin key that owns the persisted sheet data matrix.

methodgetColumnCount
getColumnCount(): number

Current column count.

methodgetRowCount
getRowCount(): number

Current row count.

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

Reads a dense column payload for invertible column deletion.

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

Reads a dense row payload for invertible row deletion.

index: number
typeCommandExecutionPhasesource ↗
type CommandExecutionPhase = typeof CommandExecutionPhase[keyof typeof CommandExecutionPhase]

Public string union for command lifecycle event phases.

typeDocCommandDefinitionResultsource ↗
type DocCommandDefinitionResult = conditional

Extracts the result contract from a typed document command definition.

typeDocCommandEffectsource ↗
type DocCommandEffect = { type: "focus-document" } | { type: "reset-caret-blink" }

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

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

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

typeDocCommandInputsource ↗
type DocCommandInput = conditional

Extracts the input contract from a typed document command definition.

typeDocCommandListenersource ↗
type DocCommandListener = (event: DocCommandEvent): void

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

typeSelectionMoveDirectionsource ↗
type SelectionMoveDirection = typeof SelectionMoveDirection[keyof typeof SelectionMoveDirection]

Type contract for SelectionMoveDirection.

typeSheetCellPointsource ↗
type SheetCellPoint = readonly [number, number]

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

typeSheetCommandDefinitionResultsource ↗
type SheetCommandDefinitionResult = conditional

Extracts the result contract from a typed command definition.

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

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

typeSheetCommandInputsource ↗
type SheetCommandInput = conditional

Extracts the input contract from a typed command definition.

typeSheetCommandListenersource ↗
type SheetCommandListener = (event: SheetCommandEvent): void

Observer invoked when command execution starts, completes or fails.

typeSheetQueryHandlersource ↗
type SheetQueryHandler = (input: Input): Result
typeSheetQueryInputsource ↗
type SheetQueryInput = conditional
typeSheetQueryResultsource ↗
type SheetQueryResult = conditional
typeSheetRangeCommandDataSourcesource ↗
type SheetRangeCommandDataSource = SheetClearRangeContentsCommandDataSource<Cell>

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

variableClearRangeContentsCommandsource ↗
ClearRangeContentsCommand: SheetCommandDefinition<SheetClearRangeContentsInput, SheetCommandResult>

Clears persisted cell contents in an explicit rectangular range.

variableCommandExecutionPhasesource ↗
CommandExecutionPhase: { Completed: "completed"; Failed: "failed"; Started: "started" }

Stable lifecycle phases emitted by Sheet, Doc, and Workbook command buses.

variableDeleteColumnCommandsource ↗
DeleteColumnCommand: SheetCommandDefinition<SheetDeleteColumnsInput, SheetCommandResult>

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

variableDeleteRowCommandsource ↗
DeleteRowCommand: SheetCommandDefinition<SheetDeleteRowsInput, SheetCommandResult>

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

variableInsertColumnCommandsource ↗
InsertColumnCommand: SheetCommandDefinition<SheetInsertColumnsInput, SheetCommandResult>

Inserts one or more columns before the requested column index.

variableInsertRowCommandsource ↗
InsertRowCommand: SheetCommandDefinition<SheetInsertRowsInput, SheetCommandResult>

Inserts one or more rows before the requested row index.

variableMoveColumnsCommandsource ↗
MoveColumnsCommand: SheetCommandDefinition<SheetMoveAxisInput, SheetCommandResult>

Reorders complete columns without overwriting their neighbors.

variableMoveRowsCommandsource ↗
MoveRowsCommand: SheetCommandDefinition<SheetMoveAxisInput, SheetCommandResult>

Reorders complete rows without overwriting their neighbors.

variableSelectionMoveDirectionsource ↗
SelectionMoveDirection: { Down: "down"; Left: "left"; Right: "right"; Up: "up" }

Cardinal directions accepted by sheet-selection navigation commands.

functioncreateClearRangeContentsOperationssource ↗
createClearRangeContentsOperations<Cell>(input: SheetClearRangeContentsInput, dataSource: SheetClearRangeContentsCommandDataSource<Cell>): UpdateCellOTOperation<Cell>[]

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

input: SheetClearRangeContentsInput
dataSource: SheetClearRangeContentsCommandDataSource<Cell>
functioncreateDeleteColumnOperationssource ↗
createDeleteColumnOperations(input: SheetDeleteColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount" | "readColumn">): DeleteColOTOperation<unknown>[]

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

input: SheetDeleteColumnsInput
dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount" | "readColumn">
functioncreateDeleteRowOperationssource ↗
createDeleteRowOperations(input: SheetDeleteRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount" | "readRow">): DeleteRowOTOperation<unknown>[]

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

input: SheetDeleteRowsInput
dataSource: Pick<SheetStructureCommandDataSource, "getRowCount" | "readRow">
functioncreateInsertColumnOperationssource ↗
createInsertColumnOperations(input: SheetInsertColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount">): InsertColOTOperation<unknown>[]

Creates ColInsert operations from public command input.

input: SheetInsertColumnsInput
dataSource: Pick<SheetStructureCommandDataSource, "getRowCount">
functioncreateInsertRowOperationssource ↗
createInsertRowOperations(input: SheetInsertRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount">): InsertRowOTOperation<unknown>[]

Creates RowInsert operations from public command input.

input: SheetInsertRowsInput
dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount">
functioncreateMoveColumnsOperationssource ↗
createMoveColumnsOperations(input: SheetMoveAxisInput, size: number): MoveColOTOperation<unknown>[]

Creates column swaps implementing insertion at an original column boundary.

input: SheetMoveAxisInput
size: number
functioncreateMoveRowsOperationssource ↗
createMoveRowsOperations(input: SheetMoveAxisInput, size: number): MoveRowOTOperation<unknown>[]

Creates row swaps implementing insertion at an original row boundary.

input: SheetMoveAxisInput
size: number
functioncreateSheetTransactionsource ↗
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.

target: PluginKey
operations: readonly OperationType[]
meta: Readonly<Record<string, unknown>>
functiondefineDocCommandsource ↗
defineDocCommand<Input, Result>(id: string): DocCommandDefinition<Input, Result>

Creates an immutable, feature-owned document command contract.

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

Creates an immutable, feature-owned command contract.

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

Creates an immutable, feature-owned query contract.

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

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

id: string
functionextendSelectionsource ↗
extendSelection(input: ExtendSelectionCommandInput): { anchor: [number, number]; cursor: [number, number]; focus: [number, number] }

Extends a selection by one keyboard navigation step.

ReturnsNormalized selection range and updated moving cursor.

input: ExtendSelectionCommandInput
Current selection extension state.
functionmoveSelectionsource ↗
moveSelection(input: MoveSelectionCommandInput): MoveSelectionCommandResult

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

input: MoveSelectionCommandInput
functionregisterSheetRangeCommandssource ↗
registerSheetRangeCommands(commands: SheetCommandBus, dataSource: SheetRangeCommandDataSource): void

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

commands: SheetCommandBus
dataSource: SheetRangeCommandDataSource
functionregisterSheetStructureCommandssource ↗
registerSheetStructureCommands(commands: SheetCommandBus, dataSource: SheetStructureCommandDataSource, moves?: SheetStructureMoveRegistry): void

Registers the default sheet row/column structure commands.

commands: SheetCommandBus
dataSource: SheetStructureCommandDataSource
moves: SheetStructureMoveRegistry
functionselectRangesource ↗
selectRange(input: SelectRangeCommandInput): SelectRangeCommandResult

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

input: SelectRangeCommandInput
classSheetQueryBussource ↗
class SheetQueryBus

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

constructorconstructor
SheetQueryRegistry(): SheetQueryRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for registration changes after assembly.

assertWrite: (): void
methodgetRegisteredQueryIds
getRegisteredQueryIds(): readonly string[]
methodhas
has(definition: string | SheetQueryDefinition<unknown, unknown>): boolean
definition: string | SheetQueryDefinition<unknown, unknown>
methodregister
register<Definition>(definition: Definition, handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>): (): void
definition: Definition
handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>
methodrun
run<Definition>(definition: Definition, input: SheetQueryInput<Definition>): SheetQueryResult<Definition>
definition: Definition
input: SheetQueryInput<Definition>

Package

@searsuite/sear-assembly-config

8 exports

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

classConfigEnginesource ↗
class ConfigEngine<TConfig>

Registry and merger for one editor-owned configuration scope.

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

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

defaults: TConfig
initialConfig: EditorDefaultConfigOverrides<TConfig>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the shared configuration engine.

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

Seals retained configuration handles after editor initialization.

isCommandExecuting: (): boolean
methodgetCombinedConfig
getCombinedConfig<T>(): ConfigUnit<T> & T

Get merged config of all plugins

ReturnsMerged config

methodgetDefaultConfig
getDefaultConfig(): TConfig

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

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

Get config of specified plugin

ReturnsPlugin configuration

pluginKey: ConfigKey
Stable key whose configuration should be returned.
methodregisterPluginConfig
registerPluginConfig<T>(pluginKey: ConfigKey, pluginConfig: T): void

Register plugin config

pluginKey: ConfigKey
Stable key that owns the configuration.
pluginConfig: T
Plugin config
methodupdateDefaultConfigOverrides
updateDefaultConfigOverrides(overrides: EditorDefaultConfigOverrides<TConfig>): void

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

overrides: EditorDefaultConfigOverrides<TConfig>
classConfigUnitsource ↗
class ConfigUnit<T>

Mutable configuration unit registered by a plugin or assembly module.

constructorconstructor
ConfigUnit<T>(initialConfig?: T): ConfigUnit<T>

Creates a config unit by copying the provided initial values.

initialConfig: T
interfaceDocConfigsource ↗
interface DocConfig

Configuration owned by a standalone Doc editor.

propertydevicePixelRatio
readonly devicePixelRatio: number
propertydocFontFamily
readonly docFontFamily: string
propertydocFontSize
readonly docFontSize: number
propertydocLineHeightMultiplier
readonly docLineHeightMultiplier: number

Default paragraph line-height multiplier used by standalone Doc.

propertydocParagraphSpacingAfter
readonly docParagraphSpacingAfter: number

Default paragraph spacing after each non-final block.

propertydocVerticalAlign
readonly docVerticalAlign: "center" | "top"
propertyincrementalRenderPolicyLimits
readonly incrementalRenderPolicyLimits: IncrementalRenderPolicyLimitsConfig
interfaceIncrementalRenderPolicyLimitsConfigsource ↗
interface IncrementalRenderPolicyLimitsConfig

Guardrails for accepting an incremental document render plan.

propertymaxCopiedAreaRatio
readonly maxCopiedAreaRatio: number
propertymaxCopyCount
readonly maxCopyCount: number
propertymaxInvalidAreaRatio
readonly maxInvalidAreaRatio: number
propertymaxInvalidRectCount
readonly maxInvalidRectCount: number
interfaceSheetConfigsource ↗
interface SheetConfig

Configuration owned by a standalone Sheet editor.

propertycellPadding
readonly cellPadding: number
propertydefaultCellAlign
readonly defaultCellAlign: SheetHorizontalAlignment
propertydefaultCellVerticalAlign
readonly defaultCellVerticalAlign: SheetVerticalAlignment
propertydefaultColumnSize
readonly defaultColumnSize: number
propertydefaultRowSize
readonly defaultRowSize: number
propertydevicePixelRatio
readonly devicePixelRatio: number
propertysheetCellFontFamily
readonly sheetCellFontFamily: string
propertysheetCellFontSize
readonly sheetCellFontSize: number
propertysheetOffsetX
readonly sheetOffsetX: number
propertysheetOffsetY
readonly sheetOffsetY: number
typeEditorDefaultConfigOverridessource ↗
type EditorDefaultConfigOverrides = Partial<TConfig> & Record<string, unknown>

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

variabledefaultDocConfigsource ↗
defaultDocConfig: DocConfig

Built-in defaults for standalone Doc editors.

variabledefaultSheetConfigsource ↗
defaultSheetConfig: SheetConfig

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

Package

@searsuite/sear-assembly-core

65 exports

The staged Sheet and Doc runtimes that execute pipelines and commit transactions.

enumPipelineStepKindsource ↗
enum PipelineStepKind

Built-in pipeline step kinds understood by SearCoreSheet.

enum memberInteraction
Interaction: "interaction"

Update local sheet interaction state; never synchronized through OT.

enum memberLocalAction
LocalAction: "local-action"

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

enum memberPostCommit
PostCommit: "post-commit"

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

enum memberPostRender
PostRender: "post-render"

Re-render after the current frame's dirty regions have been flushed.

enum memberPreparedAction
PreparedAction: "prepared-action"

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

enum memberRender
Render: "render"

Re-render a single plugin (no state change).

enum memberTransaction
Transaction: "transaction"

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

classConsolePipelineLoggersource ↗
class ConsolePipelineLogger extends PipelineLifecycle

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, 1 dirty)
📝 commit-cell-value → set R0C0 = {richtext}
✅ commit-cell-value
📝 exit-edit-mode → clear editor
✅ exit-edit-mode
🏁 Pipeline done — rendered

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

constructorconstructor
ConsolePipelineLogger(): ConsolePipelineLogger
methodonComplete
onComplete(_pipeline: Pipeline, rendered: boolean): void

Handles the complete lifecycle event.

_pipeline: Pipeline
rendered: boolean
methodonStart
onStart(pipeline: Pipeline): void

Handles the start lifecycle event.

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

Handles the step complete lifecycle event.

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

Handles the step start lifecycle event.

step: PipelineStep
_pipeline: Pipeline
detail: string
classDocCompositionManagersource ↗
class DocCompositionManager extends DocCompositionProvider

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

constructorconstructor
DocCompositionManager(textShaper: TextShaper): DocCompositionManager
textShaper: TextShaper
propertysymbolstatic
readonly symbol: symbol

DI token for resolving DocCompositionManager.

methodclear
clear(teardownToken?: object): void

Clears all composing state.

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

Closes direct composition writes after editor assembly.

isCommandExecuting: (): boolean
teardownToken: object
methodgetCaretOffset
getCaretOffset(): number

Returns the logical caret offset inside the composing text.

methodgetCaretPixelOffset
getCaretPixelOffset(): number

Returns the latest measured caret pixel offset.

methodgetText
getText(): string

Returns the current composing text.

methodmeasure
measure(font?: string): DocCompositionLayout

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

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

Updates the active composing text and logical caret offset.

text: string
caretOffset: number
classDocCursorManagersource ↗
class DocCursorManager

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.

constructorconstructor
DocCursorManager(): DocCursorManager
propertysymbolstatic
readonly symbol: symbol

DI token for resolving DocCursorManager.

methodclearCursor
clearCursor(teardownToken?: object): void

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

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

Seals assembled cursor writes while preserving command-owned rendering.

isCommandExecuting: (): boolean
teardownToken: object
methodgetCursor
getCursor(): CursorRenderInfo | null

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

methodgetSelectionRects
getSelectionRects(): SelectionRect[]

Read the selection highlight rectangles.

methodsetCursor
setCursor(info: CursorRenderInfo): void

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

info: CursorRenderInfo
methodsetSelectionRects
setSelectionRects(rects: SelectionRect[]): void

Set selection highlight rectangles for the upcoming draw call.

rects: SelectionRect[]
classDocImmediateRenderPaintersource ↗
class DocImmediateRenderPainter

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

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

Creates a painter over the document cursor and scroll services.

cursorManager: DocCursorManager
scrollManager: ScrollManager
lineRenderer: RichTextLineRenderer
compositionManager: DocCompositionManager | null
methoddrawContent
drawContent(context: RenderContext, input: DocImmediateRenderPainterContentInput): void

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

context: RenderContext
input: DocImmediateRenderPainterContentInput
methoddrawSelectionRectsInViewport
drawSelectionRectsInViewport(context: RenderContext): void

Draws selection rectangles in viewport coordinates under an identity transform.

context: RenderContext
methoddrawSelectionRectsInWorld
drawSelectionRectsInWorld(context: RenderContext): void

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

context: RenderContext
methoddrawTextCursorOverlayInViewport
drawTextCursorOverlayInViewport(context: RenderContext): void

Draws IME composing text and caret in viewport coordinates.

context: RenderContext
classDocInputPluginsource ↗
class DocInputPlugin extends Plugin<SearCoreDoc, NodeProperties, DocInputState>

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

constructorconstructor
DocInputPlugin(docLayoutEngine: DocLayoutEngine, platform?: Platform): DocInputPlugin

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

docLayoutEngine: DocLayoutEngine
platform: Platform
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<DocInputState, object> | readonly PluginDocumentStateContribution<DocInputState, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

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

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

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for document input state.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the document input plugin.

memberkeyinherited
key: unknown
membersession
session: unknown
methodapply
apply(state: DocInputState, transaction: Transaction): DocInputState | null

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

state: DocInputState
transaction: Transaction
methodclearSession
clearSession(): void

Clears the current edit session state.

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

Builds a transaction for arrow-key cursor navigation.

direction: DocCursorDirection
shiftKey: boolean
methodcreateDeleteTransaction
createDeleteTransaction(): Transaction

Builds a transaction for Backspace deletion.

methodcreateInputTransaction
createInputTransaction(text: string): Transaction

Builds a transaction for committed text input.

text: string
methodcreateReplaceDocumentTransaction
createReplaceDocumentTransaction(document: RichDocNode[], selection?: DocSelection): Transaction

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

document: RichDocNode[]
selection: DocSelection
methodcreateSelectAllTransaction
createSelectAllTransaction(): Transaction

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

methodcreateSoftEnterTransaction
createSoftEnterTransaction(): Transaction

Builds a transaction for soft-enter paragraph splitting.

methodcreateTransaction
createTransaction(command: DocCommand, docTransaction?: DocTransaction): Transaction

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

command: DocCommand
docTransaction: DocTransaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

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

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

isCommandExecuting: (): boolean
commitToken: object
runWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetLastSnapshot
getLastSnapshot(): LayoutSnapshot | null

Returns the derived layout snapshot used for vertical cursor movement.

methodgetPluginConfig
getPluginConfig(_searCore: SearCoreDoc): null

Document input has no plugin configuration.

_searCore: SearCoreDoc
methodgetStateinherited
getState(): DocInputState

Returns the plugin-owned state currently registered with the manager.

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

Handles arrow-key cursor navigation.

direction: DocCursorDirection
shiftKey: boolean
methodhandleDelete
handleDelete(): DocInputDispatchResult

Handles Backspace deletion.

methodhandleInput
handleInput(text: string): DocInputDispatchResult

Handles committed text input.

text: string
methodhandleSelectAll
handleSelectAll(): DocInputDispatchResult

Selects all content in the current document session.

methodhandleSoftEnter
handleSoftEnter(): DocInputDispatchResult

Handles soft-enter paragraph splitting.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: DocInputState): void

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

state: DocInputState
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

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

transaction: Transaction
methodprojectTransactioninherited
projectTransaction(state: DocInputState, 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.

state: DocInputState
transaction: Transaction
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

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

Registers document input state under the plugin key.

methodrender
render(_searCore: SearCoreDoc): Node<NodeProperties>[] | null

Document input does not render scene nodes directly.

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

Replaces the current edit session document and selection.

doc: RichDocNode[]
selection: DocSelection
methodrestoreSelection
restoreSelection(selection: DocSelection): void

Replaces local selection during session restoration without changing document content.

selection: DocSelection
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsealSessionRestoration
sealSessionRestoration(): void

Closes the document initialization and session restoration phase.

methodsetLastSnapshot
setLastSnapshot(snapshot: LayoutSnapshot | null): void

Stores the last layout snapshot for cursor navigation.

snapshot: LayoutSnapshot | null
methodsetStateinherited
setState(state: DocInputState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: DocInputState
commitToken: object
methodsubscribeDocument
subscribeDocument(listener: (): void): (): void

Subscribes to committed document projection changes.

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

Subscribes to committed selection projection changes.

listener: (): void
classDocRenderEnginesource ↗
class DocRenderEngine extends RenderEngine<NodeProperties, RenderCoordinatorManager>

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.

constructorconstructor
DocRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeProperties>, renderStrategyManager: RenderStrategyManager<NodeProperties>, screenRenderStrategy: ScreenRenderStrategy<NodeProperties>, dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>, stickyRenderStrategy: StickyRenderStrategy<NodeProperties>, overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>): DocRenderEngine

Creates a render engine for one document editor instance.

scrollManager: ScrollManager
renderContext: RenderContext
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeProperties>
renderStrategyManager: RenderStrategyManager<NodeProperties>
screenRenderStrategy: ScreenRenderStrategy<NodeProperties>
dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>
stickyRenderStrategy: StickyRenderStrategy<NodeProperties>
overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>
propertyconfigEngineinherited
readonly configEngine: ConfigEngine
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyrenderStrategyManagerinherited
readonly renderStrategyManager: RenderStrategyManager<NodeProperties>
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertysymbolstatic
readonly symbol: symbol

DI token for resolving DocRenderEngine.

methodgetLastScreenRenderMode
getLastScreenRenderMode(): ScreenRenderFrameMode | null

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

methodinitialize
initialize(): void

Initializes DocRenderEngine.

methodinvalidateScreenCache
invalidateScreenCache(): void

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

methodmarkDirty
markDirty(rect: PositionRect<templateLiteral>): void

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

rect: PositionRect<templateLiteral>
methodrender
render(node: Node<NodeProperties>): void

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

node: Node<NodeProperties>
methodresize
resize(width: number, height: number, scale: number): void

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

width: number
height: number
scale: number
methodsetBlockRasterCopyPlan
setBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): void

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

plan: BlockRasterCopyPlan | null
methodsetViewport
setViewport(viewport: DocRenderViewport): void

Updates the viewport model used by subsequent render frames.

viewport: DocRenderViewport
methodsetViewScale
setViewScale(scale: number): void

Updates the view scale on every render strategy context.

scale: number
classNoopDocCompositionProvidersource ↗
class NoopDocCompositionProvider extends DocCompositionProvider

Null provider used when no composition plugin is installed.

constructorconstructor
NoopDocCompositionProvider(): NoopDocCompositionProvider
methodmeasure
measure(_font: string): DocCompositionLayout

Measures no composing text.

_font: string
classPipelinesource ↗
class Pipeline

An observable, ordered conduit for state changes and renders.

The Pipeline is **not** a batch-optimisation — it is a monitoring and
debugging tool. Every operation (transaction dispatch, render-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:
``ts
// A single-transaction dispatch (selection, collab, etc.)
const p = Pipeline.fromTransaction('select-cell', 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.addRender(featureRefreshStepName, selectionPluginKey);
p.markDirty(editorRect);
searCore.executePipeline(p);
``

constructorconstructor
Pipeline(name: string): Pipeline

Creates a named pipeline for diagnostics and command results.

name: string
propertydirtyRects
readonly dirtyRects: PositionRect<templateLiteral>[]

Dirty rectangles accumulated before the render phase.

propertyname
readonly name: string
propertysteps
readonly steps: PipelineStep[]

Ordered steps that will be executed by the pipeline executor.

methodadd
add(stepName: string, transaction: Transaction): this

Append a transaction step (shorthand).

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

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

stepName: string
kind: string
data: unknown
methodaddInteraction
addInteraction(stepName: string, interaction: SheetInteractionSignal): this

Append a local interaction-state transition.

stepName: string
interaction: SheetInteractionSignal
methodaddLocalAction
addLocalAction(stepName: string, localAction: (): void): this

Append a command-owned local action step.

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

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

stepName: string
postCommit: (): void
methodaddPostRender
addPostRender(stepName: string, pluginKey: PluginKey): this

Schedule a visual refresh after this pipeline's normal frame has
completed. Use this when a second scene update must not consume dirty
regions produced by transaction-driven plugins in the same frame.

stepName: string
pluginKey: PluginKey
methodaddPreparedAction
addPreparedAction(stepName: string, prepare: (): (): void): this

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

stepName: string
prepare: (): (): void
methodaddRender
addRender(stepName: string, pluginKey: PluginKey): this

Append a render-only step for the given plugin.

stepName: string
pluginKey: PluginKey
methodaddTransaction
addTransaction(stepName: string, transaction: Transaction): this

Append a transaction step.

stepName: string
transaction: Transaction
methodemitComplete
emitComplete(rendered: boolean): void

Notify all hooks that the pipeline has completed.

rendered: boolean
methodemitStart
emitStart(): void

Notify all hooks that the pipeline is starting.

methodemitStepComplete
emitStepComplete(step: PipelineStep): void

Notify all hooks that a step has completed.

step: PipelineStep
methodemitStepStart
emitStepStart(step: PipelineStep): void

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

step: PipelineStep
methodmarkDirty
markDirty(rect: PositionRect<templateLiteral>): this

Defers a dirty rectangle until the pipeline executor reaches render.

rect: PositionRect<templateLiteral>
methoduse
use(hook: PipelineLifecycle): this

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

hook: PipelineLifecycle
methodfromRenderstatic
fromRender(name: string, pluginKey: PluginKey): Pipeline

Creates a pipeline containing one render step for a plugin key.

name: string
pluginKey: PluginKey
methodfromTransactionstatic
fromTransaction(name: string, transaction: Transaction): Pipeline

Creates a pipeline containing one transaction step.

name: string
transaction: Transaction
classPipelineStepExecutorRegistrysource ↗
class PipelineStepExecutorRegistry

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.

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

DI token for resolving PipelineStepExecutorRegistry.

methodget
get(kind: string): PipelineStepExecutor | undefined

Returns the value.

kind: string
methodregister
register(executor: PipelineStepExecutor): (): void

Registers the value.

executor: PipelineStepExecutor
classSearContractViolationErrorsource ↗
class SearContractViolationError extends SearError

Error thrown when an internal assembly contract is violated.

constructorconstructor
SearContractViolationError(message: string, details?: SearErrorDetails): SearContractViolationError

Creates a SearContractViolationError instance.

message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_CONTRACT_VIOLATION"

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSearCoresource ↗
class SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>

Platform-neutral core contract shared by sheet and document hosts.

constructorconstructor
SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>(): SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the active core implementation.

methodgetPlugin
getPlugin(pluginKey: PluginKey): unknown

Retrieves a plugin instance by plugin key.

pluginKey: PluginKey
methodregisterPlugin
registerPlugin<T>(plugin: Plugin<SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>, NodeTypeProperties, T>): void

Registers a plugin with the core's plugin manager.

plugin: Plugin<SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>, NodeTypeProperties, T>
classSearCoreDocsource ↗
class SearCoreDoc extends SearCore<SearCoreDoc, NodeProperties, unknown>

Stages and commits rich-document transactions for one editor runtime.

constructorconstructor
SearCoreDoc(blockManager: BlockManager, docCursorManager: DocCursorManager, docCompositionManager: DocCompositionManager, docLayoutEngine: DocLayoutEngine, pluginManager: PluginManager<SearCoreDoc, NodeProperties>, stepExecutorRegistry?: PipelineStepExecutorRegistry, runtimeLayers?: SearCoreDocRuntimeLayers): SearCoreDoc

Creates a SearCoreDoc instance.

blockManager: BlockManager
docCursorManager: DocCursorManager
docCompositionManager: DocCompositionManager
docLayoutEngine: DocLayoutEngine
pluginManager: PluginManager<SearCoreDoc, NodeProperties>
stepExecutorRegistry: PipelineStepExecutorRegistry
runtimeLayers: SearCoreDocRuntimeLayers
propertyblockManager
blockManager: BlockManager
propertyconfigEngine
configEngine: ConfigEngine<any> | null

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

propertyeventEngine
eventEngine: EventEngine<NodeProperties> | null

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

propertypluginManager
readonly pluginManager: PluginManager<SearCoreDoc, NodeProperties>

Plugin manager for document runtime service plugins.

propertyrenderEngine
renderEngine: DocRenderEngine | null

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

propertyrenderStage
renderStage: SceneGraph<NodeProperties> | null

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

propertypluginManagerSymbolstatic
readonly pluginManagerSymbol: symbol

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

propertyruntimeLayersSymbolstatic
readonly runtimeLayersSymbol: symbol

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

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SearCoreDoc.

methodbindDocRenderRequestHandler
bindDocRenderRequestHandler(handler: DocRenderRequestHandler): void

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

handler: DocRenderRequestHandler
methodclearDocRenderRequests
clearDocRenderRequests(): void

Clears diagnostic document render request history.

methoddestroy
destroy(ownerToken?: object): void

Releases standalone document runtime ownership held by Core.

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

Permanently require command dispatch for state-changing pipelines in an assembled editor.

isCommandExecuting: (): boolean
runWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodenforceTeardownBoundary
enforceTeardownBoundary(ownerToken: object): void

Reserves assembled Doc Core cleanup for its editor facade.

ownerToken: object
methodexecutePipeline
executePipeline(pipeline: Pipeline): void

Executes document command work through the shared observable Pipeline contract.

pipeline: Pipeline
methodexportSnapshot
exportSnapshot(document?: readonly RichDocNode[]): Schema[]

Exports a runtime document as the shared rich-document schema snapshot.

document: readonly RichDocNode[]
methodgetDocRenderLayoutState
getDocRenderLayoutState(): DocRenderLayoutState | null

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

methodgetDocRenderRequests
getDocRenderRequests(): readonly DocRenderRequest[]

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

methodgetLayoutSnapshot
getLayoutSnapshot(): LayoutSnapshot | null

Returns the latest document layout snapshot prepared by Core.

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

Returns the plugin.

pluginKey: PluginKey
methodgetPluginInstance
getPluginInstance(pluginKey: PluginKey): Plugin<SearCoreDoc, NodeProperties, any> | undefined

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

pluginKey: PluginKey
methodinitialize
initialize(): void

Initializes core-owned state, scene nodes, and runtime services.

methodloadSnapshot
loadSnapshot(snapshot: readonly Schema[]): RichDocNode[]

Loads one shared rich-document schema snapshot into this Core runtime.

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

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

snapshot: readonly Schema[]
methodprepareEditorRenderLayout
prepareEditorRenderLayout(input: DocEditorRenderLayoutInput): DocPreparedEditorRenderLayout

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

input: DocEditorRenderLayoutInput
methodregisterPlugin
registerPlugin<T>(plugin: Plugin<SearCoreDoc, NodeProperties, T>): (): void

Registers the plugin.

plugin: Plugin<SearCoreDoc, NodeProperties, T>
methodrequestDocRender
requestDocRender(pluginKey?: PluginKey): void

Requests a document render for plugin-owned render nodes.

pluginKey: PluginKey
methodresolveCursorFromPoint
resolveCursorFromPoint(x: number, y: number, snapshot: LayoutSnapshot): DocCursorPos

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

x: number
y: number
snapshot: LayoutSnapshot
methodsetDocRenderLayoutState
setDocRenderLayoutState(state: DocRenderLayoutState | null): void

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

state: DocRenderLayoutState | null
methodstart
start(): void

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

methodunregisterPlugin
unregisterPlugin(pluginKey: PluginKey): void

Unregisters a plugin and removes core-owned runtime output for it.

pluginKey: PluginKey
classSearCoreSheetsource ↗
class SearCoreSheet extends SearCore<SearCoreSheet, CellProperties, SheetRenderCoordinatorManager>

Sheet-specific core runtime that coordinates plugins, data, render, events and pipeline execution.

constructorconstructor
SearCoreSheet(stage: SceneGraph<CellProperties>, pluginManager: PluginManager<SearCoreSheet, CellProperties>, dataEngine: SheetDataEngine, renderEngine: RenderEngine<CellProperties, SheetRenderCoordinatorManager>, eventEngine: EventEngine<CellProperties>, configEngine: ConfigEngine, lifecycleCoordinator: SheetLifecycleCoordinator, interactionStore: SheetInteractionStore, stepExecutorRegistry: PipelineStepExecutorRegistry, platform?: Platform): SearCoreSheet

Creates a sheet core from the DI-provided runtime services.

stage: SceneGraph<CellProperties>
pluginManager: PluginManager<SearCoreSheet, CellProperties>
dataEngine: SheetDataEngine
renderEngine: RenderEngine<CellProperties, SheetRenderCoordinatorManager>
eventEngine: EventEngine<CellProperties>
configEngine: ConfigEngine
lifecycleCoordinator: SheetLifecycleCoordinator
interactionStore: SheetInteractionStore
stepExecutorRegistry: PipelineStepExecutorRegistry
platform: Platform
propertyconfigEngine
configEngine: ConfigEngine

Configuration registry used by sheet plugins.

propertydataEngine
dataEngine: DataEngine

Data registry for plugin-owned sheet state.

propertyeventEngine
eventEngine: EventEngine<CellProperties>

Event pipeline and hit-testing facade for sheet interactions.

propertypluginManager
readonly pluginManager: PluginManager<SearCoreSheet, CellProperties>

Ordered plugin registry for this sheet runtime.

propertyrenderEngine
renderEngine: RenderEngine<CellProperties, SheetRenderCoordinatorManager>

Render pipeline facade for visible sheet scene updates.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving the active core implementation.

methoddestroy
destroy(token?: object): void

Releases runtime controllers and their subscriptions owned by this sheet.

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

Permanently require command dispatch for state-changing pipelines in an assembled editor.

isCommandExecuting: (): boolean
methodenforceTeardownBoundary
enforceTeardownBoundary(token: object): void

Reserves assembled runtime teardown for the owning editor facade.

token: object
methodexecutePipeline
executePipeline(pipeline: Pipeline): void

Execute a Pipeline — the single monitoring conduit for all state
changes and render triggers.

Lifecycle hooks on the Pipeline emit observability events. Callers that
construct a Pipeline can attach ConsolePipelineLogger explicitly when
console diagnostics are desired.

pipeline: Pipeline
methodgetDataEngine
getDataEngine(): SheetDataEngine

Returns the sheet data engine with sheet-specific helpers.

methodgetPlugin
getPlugin(pluginKey: PluginKey): unknown

Returns state owned by the plugin identified by the given key.

pluginKey: PluginKey
methodgetRenderEngine
getRenderEngine(): RenderEngine<CellProperties, SheetRenderCoordinatorManager>

Returns the render engine bound to this sheet core.

methodgetStage
getStage(): SceneGraph<CellProperties>

Returns the scene graph used by render and event strategies.

methodinitialize
initialize(): void

Builds plugin state and initial scene nodes without starting runtime effects.

methodregisterPlugin
registerPlugin<T>(plugin: Plugin<SearCoreSheet, CellProperties, T>): void

Registers and initializes a plugin after core startup.

plugin: Plugin<SearCoreSheet, CellProperties, T>
methodrequestRender
requestRender<T>(plugin: Plugin<SearCoreSheet, CellProperties, T>): void

Convenience: wrap a render-only refresh in a Pipeline and execute it.

plugin: Plugin<SearCoreSheet, CellProperties, T>
methodstart
start(): void

Starts rendering, events, and lifecycle-owned runtime controllers.

classSearDocParseErrorsource ↗
class SearDocParseError extends SearError

Error thrown when document input cannot be parsed.

constructorconstructor
SearDocParseError(message: string, details?: SearErrorDetails): SearDocParseError

Creates a SearDocParseError instance.

message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_DOC_PARSE"

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSearLifecycleErrorsource ↗
class SearLifecycleError extends SearError

Error thrown for invalid sheet lifecycle transitions.

constructorconstructor
SearLifecycleError(operation: string, state: string, message?: string): SearLifecycleError

Creates a SearLifecycleError instance.

operation: string
state: string
message: string
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_LIFECYCLE_INVALID_STATE"

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSearPipelineStepExecutorNotFoundErrorsource ↗
class SearPipelineStepExecutorNotFoundError extends SearError

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

constructorconstructor
SearPipelineStepExecutorNotFoundError(kind: string): SearPipelineStepExecutorNotFoundError

Creates a SearPipelineStepExecutorNotFoundError instance.

kind: string
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSearRegistryConflictErrorsource ↗
class SearRegistryConflictError extends SearError

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

constructorconstructor
SearRegistryConflictError(registry: string, key: string, message?: string): SearRegistryConflictError

Creates a SearRegistryConflictError instance.

registry: string
key: string
message: string
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_REGISTRY_CONFLICT"

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSearRegistryEntryNotFoundErrorsource ↗
class SearRegistryEntryNotFoundError extends SearError

Error thrown when a required registry entry is missing.

constructorconstructor
SearRegistryEntryNotFoundError(registry: string, key: string, message?: string): SearRegistryEntryNotFoundError

Creates a SearRegistryEntryNotFoundError instance.

registry: string
key: string
message: string
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_REGISTRY_ENTRY_NOT_FOUND"

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetInteractionReducerRegistrysource ↗
class SheetInteractionReducerRegistry

Extensible dispatch table for local interaction-state transitions.

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

DI token for resolving SheetInteractionReducerRegistry.

methodget
get(type: string): SheetInteractionReducer | undefined

Returns the value.

type: string
methodregister
register(reducer: SheetInteractionReducer): (): void

Registers the value.

reducer: SheetInteractionReducer
classSheetInteractionStoresource ↗
class SheetInteractionStore

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

constructorconstructor
SheetInteractionStore(reducers: SheetInteractionReducerRegistry, platform?: Platform): SheetInteractionStore

Creates a SheetInteractionStore instance.

reducers: SheetInteractionReducerRegistry
platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetInteractionStore.

methodapply
apply(signal: SheetInteractionSignal): void

Applies a transaction to SheetInteractionStore state.

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

Publishes a previously staged interaction state after pipeline commit.

state: SheetInteractionState
Final interaction state to make visible.
signals: readonly SheetInteractionSignal[]
Ordered signals to deliver to subscribers.
methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): void

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

isCommandExecuting: (): boolean
runWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodgetState
getState(): Readonly<SheetInteractionState>

Returns the state.

methodreduce
reduce(state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): SheetInteractionState

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: Readonly<SheetInteractionState>
Interaction state visible before the signal.
signal: SheetInteractionSignal
Local interaction transition to reduce.
methodsubscribe
subscribe(listener: (state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): void): (): void

Subscribes to state changes and returns an idempotent disposer.

listener: (state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): void
classSheetLifecycleCoordinatorsource ↗
class SheetLifecycleCoordinator

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

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

DI token for resolving SheetLifecycleCoordinator.

methodbeginTeardown
beginTeardown(token: object): void

Permits cleanup only for the owning editor.

token: object
methoddestroy
destroy(): void

Releases resources owned by SheetLifecycleCoordinator.

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

Closes runtime registration after editor assembly.

assertCommandWrite: (): void
teardownToken: object
methodregister
register(controller: SheetLifecycleController): (): void

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

controller: SheetLifecycleController
methodstart
start(context: SheetLifecycleContext): void

Starts SheetLifecycleCoordinator.

context: SheetLifecycleContext
classSheetMatrixsource ↗
class SheetMatrix extends CSRMatrix<CellMatrixElement>

SheetMatrix public API.

constructorconstructor
SheetMatrix(data?: { data: CellMatrixElement[]; indices: number[]; indptr: number[] }, shape?: [number, number]): SheetMatrix

Constructs a CSRMatrix instance.

data: { data: CellMatrixElement[]; indices: number[]; indptr: number[] }
The data for the matrix.
shape: [number, number]
The shape of the matrix as [numRows, numCols].
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: CellMatrixElement | null[]): SheetMatrix

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: number
The index where the new column should be inserted.
col: CellMatrixElement | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddIteminherited
addItem(row: number, col: number, value: CellMatrixElement): SheetMatrix

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
value: CellMatrixElement
The value to add.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: CellMatrixElement | null[]): SheetMatrix

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: number
The index at which to add the row.
row: CellMatrixElement | null[]
The row to add.
methodclone
clone(): this

Copies stored cell payloads as well as sparse indexes.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: CellMatrixElement): CellMatrixElement): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: CellMatrixElement): CellMatrixElement
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): SheetMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<CellMatrixElement>[]): SheetMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<CellMatrixElement>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: CellMatrixElement | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: CellMatrixElement | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: CellMatrixElement, 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).

callback: (value: CellMatrixElement, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: CellMatrixElement, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: CellMatrixElement, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: CellMatrixElement, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: CellMatrixElement, col: number): void
methodfromDenseinherited
fromDense(denseArray: CellMatrixElement | null[][]): SheetMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: CellMatrixElement | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): CellMatrixElement | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): CellMatrixElement | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): SheetMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: CellMatrixElement): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: CellMatrixElement
The default value to return for missing elements
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): SheetMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): SheetMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): CellMatrixElement[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetViewportResizeControllersource ↗
class SheetViewportResizeController extends SheetLifecycleController

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

constructorconstructor
SheetViewportResizeController(subscriptionManager: SubscriptionManager): SheetViewportResizeController

Creates a SheetViewportResizeController instance.

subscriptionManager: SubscriptionManager
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetViewportResizeController.

methodapplyViewportResize
applyViewportResize(width: number, height: number): void

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

width: number
height: number
methoddestroy
destroy(): void

Releases resources owned by SheetViewportResizeController.

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

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

executor: (size: { height: number; width: number }): void
methodstart
start(context: SheetLifecycleContext): void

Starts SheetViewportResizeController.

context: SheetLifecycleContext
interfaceCellMatrixElementsource ↗
interface CellMatrixElement

Persisted cell payload stored in the sheet matrix.

propertyformula
formula?: string

Formula source text for formula cells; calculated results live in formula plugin state.

propertyformulaEvaluationMode
formulaEvaluationMode?: "dynamic" | "legacy"

Array evaluation mode used when the formula was entered.

propertytype
type: string

Cell type identifier owned by the cell type catalog.

propertyvalue
value?: unknown

Raw value whose shape is owned by the cell type.

interfaceCursorRenderInfosource ↗
interface CursorRenderInfo

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

propertyheight
height: number

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

propertyvisible
visible: boolean

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

propertyx
x: number

Absolute canvas X for the committed text caret.

propertyy
y: number

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

interfaceDocCompositionLayoutsource ↗
interface DocCompositionLayout

Layout contribution from an in-flight IME composition.

propertyactive
readonly active: boolean

Whether there is active composing text to render.

propertycaretPixelOffset
readonly caretPixelOffset: number

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

propertytext
readonly text: string

Current in-flight composing text.

propertytextWidth
readonly textWidth: number

Full composing text width in pixels.

interfaceDocCompositionProvidersource ↗
interface DocCompositionProvider

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

methodmeasure
measure(font: string): DocCompositionLayout

Measures the active composing text against the current render font.

font: string
interfaceDocEditorRenderLayoutInputsource ↗
interface DocEditorRenderLayoutInput

Input used by SearCoreDoc to initialize one editable document frame.

propertycompositionProvider
readonly compositionProvider?: DocCompositionProvider

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

propertycursorVisible
readonly cursorVisible?: boolean

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

propertydocument
readonly document: RichDocNode[]

Rich-document content to lay out and render.

propertyfitContentWidth
readonly fitContentWidth?: boolean

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

propertyfont
readonly font?: string

Font descriptor used by the text shaper for this layout.

propertyminContentWidth
readonly minContentWidth?: number

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

propertyminHeight
readonly minHeight: number

Minimum editor height supplied by the host surface.

propertyminWidth
readonly minWidth: number

Minimum editor width supplied by the host surface.

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

Editor origin in world coordinates.

propertypadding
readonly padding?: number

Padding inside the editable frame.

propertyselection
readonly selection: DocSelection

Current document selection.

propertyverticalAlign
readonly verticalAlign?: DocVerticalAlign

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

interfaceDocImmediateRenderPainterContentInputsource ↗
interface DocImmediateRenderPainterContentInput

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

propertyblockIndexes
readonly blockIndexes?: readonly number[]

Optional block indexes to draw; omitted means all blocks.

propertyclipRect
readonly clipRect?: PositionRect<templateLiteral>

Optional world-coordinate clipping rectangle.

propertyfont
readonly font?: string

Base font selected by the host for this document frame.

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

Content origin in world coordinates.

propertysnapshot
readonly snapshot: LayoutSnapshot

Layout snapshot whose lines are relative to the content origin.

interfaceDocInputDispatchResultsource ↗
interface DocInputDispatchResult

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

propertycontentChanged
readonly contentChanged: boolean

Whether the command produced document OT operations.

propertyselection
readonly selection: DocSelection

Selection after all command steps have been applied and mapped.

propertyselectionOnly
readonly selectionOnly: boolean

Whether the command only changed selection/caret state.

interfaceDocInputStatesource ↗
interface DocInputState

State for an active rich-document input session.

propertydocSelection
docSelection: DocSelection

Current rich-document selection.

propertypendingDoc
pendingDoc: RichDocNode[]

Pending document content owned by the current edit session.

propertypreferredX
preferredX: number | null

Preferred x-position for repeated vertical cursor movement.

interfaceDocPreparedEditorRenderLayoutsource ↗
interface DocPreparedEditorRenderLayout

Doc-owned layout result consumed by host render surfaces.

propertycomposingCaretPixelOffset
readonly composingCaretPixelOffset: number

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

propertycontentWidth
readonly contentWidth: number

Width available to document content after padding.

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

Cursor point relative to the editor frame.

propertypositionRect
readonly positionRect: PositionRectProps

Final editor frame in world coordinates.

propertysnapshot
readonly snapshot: LayoutSnapshot

Layout snapshot owned by the Doc input/render session.

interfaceDocRenderLayoutStatesource ↗
interface DocRenderLayoutState

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

propertyblockLayoutDiff
readonly blockLayoutDiff: DocBlockLayoutDiff

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

propertyblockRender
readonly blockRender?: DocBlockRenderDebugSnapshot

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

propertycontentRect
readonly contentRect: PositionRectProps

Editable content rectangle in viewport coordinates.

propertydocumentRect
readonly documentRect: PositionRectProps

Current document layout rectangle in world coordinates.

propertyfont
readonly font: string

Font selected by the host for this document render layout.

propertylayoutCache
readonly layoutCache: DocLayoutCache

Latest full-document layout cache.

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

Current viewport scroll offset.

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

Visible viewport dimensions.

propertyvisibleBlocks
readonly visibleBlocks: readonly DocBlockLayout[]

Laid-out blocks selected for the current viewport.

interfaceDocRenderOperationsource ↗
interface DocRenderOperation

Render-facing operation derived from a RichDoc OT operation.

propertyot
readonly ot: RichDocOTOperation
propertytype
readonly type: DocTransactionRenderOperationType
interfaceDocRenderRequestsource ↗
interface DocRenderRequest

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

propertyrenderOperations
readonly renderOperations?: DocRenderOperations

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

propertyrenderPluginKey
readonly renderPluginKey?: PluginKey

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

interfaceDocRenderViewportsource ↗
interface DocRenderViewport

Snapshot of the current document viewport used by render strategies.

propertycontentRect
readonly contentRect: PositionRectProps

Editable content rectangle inside the viewport.

propertyheight
readonly height: number

Visible viewport height in host-view units.

propertywidth
readonly width: number

Visible viewport width in host-view units.

interfacePipelineLifecyclesource ↗
interface PipelineLifecycle

Observer hooks emitted while a pipeline executes.

methodonComplete
onComplete(pipeline: Pipeline, rendered: boolean): void

Pipeline finished (all steps + render).

pipeline: Pipeline
rendered: boolean
methodonStart
onStart(pipeline: Pipeline): void

Pipeline begins execution.

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

A single step has finished executing.

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

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

step: PipelineStep
pipeline: Pipeline
detail: string
interfacePipelineStepsource ↗
interface PipelineStep

One ordered unit of work inside a pipeline.

propertydata
data?: unknown

Extension-owned payload for a custom step executor.

propertyinteraction
interaction?: SheetInteractionSignal

Local interaction transition for interaction steps.

propertykind
kind: string

Built-in or extension-provided executor key.

propertylocalAction
localAction?: (): void

Command-owned action for local-action steps.

propertyname
name: string

Human-readable step name used by diagnostics.

propertypostCommit
postCommit?: (): void

Deferred local state publication after document and interaction commits.

propertyprepare
prepare?: (): (): void

Local preparation that returns its rollback action.

propertyrenderPluginKey
renderPluginKey?: PluginKey

Plugin key to re-render for render steps.

propertytransaction
transaction?: Transaction<Operation>

Transaction payload for transaction steps.

interfacePipelineStepExecutionContextsource ↗
interface PipelineStepExecutionContext

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

methodapplyInteraction
applyInteraction(step: PipelineStep): void
step: PipelineStep
methodexecuteTransaction
executeTransaction(step: PipelineStep): void
step: PipelineStep
methodmarkDirty
markDirty(rect: PositionRect<templateLiteral>): void
rect: PositionRect<templateLiteral>
methodprepareLocalAction
prepareLocalAction(step: PipelineStep): void
step: PipelineStep
methodrenderPlugin
renderPlugin(step: PipelineStep): void
step: PipelineStep
methodrunLocalAction
runLocalAction(step: PipelineStep): void
step: PipelineStep
methodschedulePostCommit
schedulePostCommit(step: PipelineStep): void
step: PipelineStep
methodschedulePostRender
schedulePostRender(step: PipelineStep): void
step: PipelineStep
interfacePipelineStepExecutorsource ↗
interface PipelineStepExecutor

Handles one extensible Pipeline step kind.

propertykind
readonly kind: string
methodexecute
execute(context: PipelineStepExecutionContext, step: PipelineStep): void
context: PipelineStepExecutionContext
step: PipelineStep
interfaceSearCoreDocRuntimeLayerssource ↗
interface SearCoreDocRuntimeLayers

Runtime layers owned by one SearCoreDoc instance.

propertyconfigEngine
readonly configEngine?: ConfigEngine<any> | null

Configuration layer used by standalone document hosts.

propertyeventEngine
readonly eventEngine?: EventEngine<NodeProperties> | null

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

propertyplatform
readonly platform?: Platform | null

Platform diagnostics adapter used by document core guard clauses.

propertyrenderEngine
readonly renderEngine?: DocRenderEngine | null

Render engine used by standalone document hosts.

propertyrenderStage
readonly renderStage?: SceneGraph<NodeProperties> | null

Scene graph used by standalone document rendering.

interfaceSelectionRectsource ↗
interface SelectionRect

A single selection highlight rectangle in canvas coordinates.

propertyheight
height: number
propertywidth
width: number
propertyx
x: number
propertyy
y: number
interfaceSheetEditSessionsource ↗
interface SheetEditSession

Public contract for SheetEditSession.

propertyeditor
editor: string
propertytarget
target: readonly [number, number]
interfaceSheetInteractionReducersource ↗
interface SheetInteractionReducer

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

propertytype
readonly type: string
methodreduce
reduce(state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): SheetInteractionState
state: Readonly<SheetInteractionState>
signal: SheetInteractionSignal
interfaceSheetInteractionSignalsource ↗
interface SheetInteractionSignal

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

propertytype
type: string
interfaceSheetInteractionStatesource ↗
interface SheetInteractionState

Public contract for SheetInteractionState.

propertyeditSession
editSession: SheetEditSession | null
propertyselection
selection: { anchor: readonly [number, number]; focus: readonly [number, number]; source: string } | null
propertyselectionRevision
selectionRevision: number

Increments for every explicit selection transition.

propertysuppressedSelectionRevision
suppressedSelectionRevision: number | null

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

interfaceSheetLifecycleContextsource ↗
interface SheetLifecycleContext

Shared context supplied to lifecycle controllers for one sheet instance.

propertycore
readonly core: SearCoreSheet
methodrefreshSheetBoundaries
refreshSheetBoundaries(): void
interfaceSheetLifecycleControllersource ↗
interface SheetLifecycleController

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

methoddestroy
destroy(): void
methodstart
start(context: SheetLifecycleContext): void
context: SheetLifecycleContext
typeDocRenderDirtyBlockIdssource ↗
type DocRenderDirtyBlockIds = ReadonlySet<DocNodeId> | null

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

typeDocRenderOperationssource ↗
type DocRenderOperations = readonly DocRenderOperation[] | null

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

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

Function that handles committed document render requests.

variableDocInputTransactionMetasource ↗
DocInputTransactionMeta: { PreferredX: "docInput.preferredX"; RenderOperation: "docInput.renderOperation"; ReplaceSelection: "docInput.replaceSelection"; SelectionOnly: "docInput.selectionOnly"; Steps: "docInput.steps" }

Transaction metadata key containing selection mapping for DocInputPlugin.

variableSearAssemblyErrorCodesource ↗
SearAssemblyErrorCode: { contractViolation: "SEAR_CONTRACT_VIOLATION"; docParse: "SEAR_DOC_PARSE"; lifecycleInvalidState: "SEAR_LIFECYCLE_INVALID_STATE"; pipelineStepExecutorNotFound: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"; registryConflict: "SEAR_REGISTRY_CONFLICT"; registryEntryNotFound: "SEAR_REGISTRY_ENTRY_NOT_FOUND" }

Stable machine-readable error codes owned by assembly packages.

functioncollectDocReflowBlockIdssource ↗
collectDocReflowBlockIds(renderOperations: DocRenderOperations, document: readonly RichDocNode[]): DocRenderDirtyBlockIds

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

renderOperations: DocRenderOperations
document: readonly RichDocNode[]
functioncollectDocRenderOperationssource ↗
collectDocRenderOperations(transactions: readonly Transaction<Operation>[]): DocRenderOperations

Collects render operations derived from committed RichDoc OT transactions.

transactions: readonly Transaction<Operation>[]
functioncollectDocRepaintBlockIdssource ↗
collectDocRepaintBlockIds(renderOperations: DocRenderOperations, document: readonly RichDocNode[]): ReadonlySet<DocNodeId>

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

renderOperations: DocRenderOperations
document: readonly RichDocNode[]
functiongetActiveCommandIdsource ↗
getActiveCommandId(): string | null
functiongetCommandObserverEpochsource ↗
getCommandObserverEpoch(): number

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

functionisInsideCommandExecutionsource ↗
isInsideCommandExecution(): boolean
functionlockCommittedSheetStatesource ↗
lockCommittedSheetState(state: unknown): void

Locks document-owned state after initialization or a successful transaction commit.

state: unknown
functionrunInsideCommandExecutionsource ↗
runInsideCommandExecution<T>(commandId: string, callback: CommandExecutionCallback<T>): T
commandId: string
callback: CommandExecutionCallback<T>
functionrunOutsideCommandExecutionsource ↗
runOutsideCommandExecution<T>(callback: CommandExecutionCallback<T>): T

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

callback: CommandExecutionCallback<T>
functionwarnIfOutsideCommandExecutionsource ↗
warnIfOutsideCommandExecution(operationName: string, warn?: CommandExecutionWarningReporter): void
operationName: string
warn: CommandExecutionWarningReporter
functionwarnIfSyntheticCommandDefinitionsource ↗
warnIfSyntheticCommandDefinition(busName: string, commandId: string, warn?: CommandExecutionWarningReporter): void
busName: string
commandId: string
warn: CommandExecutionWarningReporter

Package

@searsuite/sear-assembly-doc

112 exports

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

enumBoldTextStyleKeysource ↗
enum BoldTextStyleKey

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

enum memberBold
Bold: "bold"
enumFontFamilyTextStyleKeysource ↗
enum FontFamilyTextStyleKey

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

enum memberFontFamily
FontFamily: "fontFamily"
enumFontSizeTextStyleKeysource ↗
enum FontSizeTextStyleKey

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

enum memberFontSize
FontSize: "fontSize"
enumItalicTextStyleKeysource ↗
enum ItalicTextStyleKey
enum memberItalic
Italic: "italic"
enumStrikethroughTextStyleKeysource ↗
enum StrikethroughTextStyleKey
enum memberStrikethrough
Strikethrough: "strikethrough"
enumTextColorStyleKeysource ↗
enum TextColorStyleKey

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

enum memberColor
Color: "color"
enumUnderlineTextStyleKeysource ↗
enum UnderlineTextStyleKey
enum memberUnderline
Underline: "underline"
classBoldTextStylePluginsource ↗
class BoldTextStylePlugin extends InlineTextStylePluginBase

Contributes bold rendering and bold document commands.

constructorconstructor
BoldTextStylePlugin(): BoldTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving BoldTextStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classDocPluginsource ↗
class DocPlugin<StateType> extends Plugin<SearCoreDoc, NodeProperties, StateType>, PluginExtension<DocCommandBus, ObservationRegistry, SessionStateRegistry, DocRuntimeExtensionRegistry>

Convenience base class for a Plugin targeting createDocEditor().

constructorconstructor
DocPlugin<StateType>(__namedParameters: PluginSpec<StateType>): DocPlugin<StateType>

Creates a plugin with its stable identity and initial state.

__namedParameters: PluginSpec<StateType>
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<StateType, object> | readonly PluginDocumentStateContribution<StateType, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

memberkeyinherited
key: unknown
methodapplyinherited
apply(pluginState: StateType, transaction: Transaction): StateType | null

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

pluginState: StateType
transaction: Transaction
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(searCore: SearCoreDoc): unknown

Returns this plugin's runtime configuration view for the current core.

searCore: SearCoreDoc
methodgetStateinherited
getState(): StateType

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: StateType): void

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

state: StateType
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(context: DocPluginRuntimeContext): void

Releases resources owned by this plugin before the Core is destroyed.

context: DocPluginRuntimeContext
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: StateType, 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.

state: StateType
transaction: Transaction
methodregisterBlockFlows
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilities
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderers
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStyles
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): PluginStateRegistration<unknown>[] | PluginStateRegistration<StateType>

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

methodrenderinherited
render(searCore: SearCoreDoc, offset?: { x: number; y: number }): Node<NodeProperties> | Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

searCore: SearCoreDoc
offset: { x: number; y: number }
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: StateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: StateType
commitToken: object
methodstart
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classDocRuntimeExtensionRegistrysource ↗
class DocRuntimeExtensionRegistry extends RuntimeCapabilityRegistry

Registry of extension capabilities available to document plugins.

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

DI token for resolving the document runtime extension registry.

methoddestroyinherited
destroy(): void

Permanently closes the registry and releases all published values.

methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for capability changes after assembly.

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

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

capability: RuntimeCapability<T>
value: T
methodrequireinherited
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
classFontFamilyTextStylePluginsource ↗
class FontFamilyTextStylePlugin extends InlineTextStylePluginBase

Contributes font-family rendering and the set-font-family document command.

constructorconstructor
FontFamilyTextStylePlugin(): FontFamilyTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FontFamilyTextStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classFontSizeTextStylePluginsource ↗
class FontSizeTextStylePlugin extends InlineTextStylePluginBase

Contributes font-size rendering and the set-font-size document command.

constructorconstructor
FontSizeTextStylePlugin(): FontSizeTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FontSizeTextStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classInlineTextStylePluginBasesource ↗
class InlineTextStylePluginBase extends DocPlugin<null>

Shared lifecycle helper for concrete inline style plugins.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderers
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStyles
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classItalicTextStylePluginsource ↗
class ItalicTextStylePlugin extends InlineTextStylePluginBase

Contributes italic rendering, mutation, and keyboard commands.

constructorconstructor
ItalicTextStylePlugin(): ItalicTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classParagraphPluginsource ↗
class ParagraphPlugin extends DocPlugin<null>

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

constructorconstructor
ParagraphPlugin(): ParagraphPlugin

Creates a ParagraphPlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving ParagraphPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlows
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers paragraph node model support owned by this plugin.

context: DocPluginServiceContext
classRichTextLineBoxPluginsource ↗
class RichTextLineBoxPlugin extends DocPlugin<null>

Registers rich-text line box resolution for document layout.

constructorconstructor
RichTextLineBoxPlugin(): RichTextLineBoxPlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving RichTextLineBoxPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(context: DocPluginRuntimeContext): void

Releases resources owned by this plugin before the Core is destroyed.

context: DocPluginRuntimeContext
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classStrikethroughTextStylePluginsource ↗
class StrikethroughTextStylePlugin extends InlineTextStylePluginBase

Contributes strikethrough rendering, mutation, and keyboard commands.

constructorconstructor
StrikethroughTextStylePlugin(): StrikethroughTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classTablePluginsource ↗
class TablePlugin extends DocPlugin<null>

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

constructorconstructor
TablePlugin(): TablePlugin

Creates a TablePlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving TablePlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers table node model support owned by this plugin.

context: DocPluginServiceContext
classTextColorStylePluginsource ↗
class TextColorStylePlugin extends InlineTextStylePluginBase

Contributes text-color rendering and mutation for text nodes.

constructorconstructor
TextColorStylePlugin(): TextColorStylePlugin

Creates a TextColorStylePlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving TextColorStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classUnderlineTextStylePluginsource ↗
class UnderlineTextStylePlugin extends InlineTextStylePluginBase

Contributes underline rendering, mutation, and keyboard commands.

constructorconstructor
UnderlineTextStylePlugin(): UnderlineTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
interfaceDocCaretStateCapabilitysource ↗
interface DocCaretStateCapability

Caret-state capability consumed by document plugins.

methodisVisible
isVisible(): boolean
methodreset
reset(): void
interfaceDocInputBindingRegistryCapabilitysource ↗
interface DocInputBindingRegistryCapability

Input-binding capability consumed by document plugins.

methodregisterKeyboardHandlers
registerKeyboardHandlers(handlers: KeyboardRouterHandlers): (): void
handlers: KeyboardRouterHandlers
methodregisterTextHandlers
registerTextHandlers(handlers: TextInputHandlers): (): void
handlers: TextInputHandlers
interfaceDocInteractionContentRectsource ↗
interface DocInteractionContentRect extends DocInteractionViewport

Current document content rectangle exposed to interaction plugins.

propertyheightinherited
readonly height: number
propertywidthinherited
readonly width: number
propertyx
readonly x: number
propertyy
readonly y: number
interfaceDocInteractionRuntimesource ↗
interface DocInteractionRuntime

View services exposed to document interaction plugins.

methodgetContentRect
getContentRect(): DocInteractionContentRect
methodgetRoot
getRoot(): unknown
methodgetViewport
getViewport(): DocInteractionViewport
methodreadRootViewOffset
readRootViewOffset(): { x: number; y: number }
methodresolveCursorFromPointer
resolveCursorFromPointer(input: DocPointerInput): DocCursorPos
input: DocPointerInput
methodsubscribePointerDrag
subscribePointerDrag(handlers: DocPointerDragHandlers): (): void
handlers: DocPointerDragHandlers
interfaceDocInteractionViewportsource ↗
interface DocInteractionViewport

Current document viewport model exposed to interaction plugins.

propertyheight
readonly height: number
propertywidth
readonly width: number
interfaceDocKeyboardHandlerRegistrationContextsource ↗
interface DocKeyboardHandlerRegistrationContext

Services available while a Doc plugin registers keyboard bindings.

propertybindings
readonly bindings: DocInputBindingRegistryCapability

Aggregates plugin-owned keyboard handlers for the host adapter.

propertycommands
readonly commands: DocCommandBus

Executes semantic editor commands from keyboard handlers.

interfaceDocPluginImplementationsource ↗
interface DocPluginImplementation<TPlugin>

Injectable DocPlugin class accepted by createDocEditor().

constructorconstructor
DocPluginImplementation(...args: never[]): TPlugin
args: never[]
propertysymbol
readonly symbol: symbol
methodregisterServices
registerServices(context: DocPluginServiceContext): void
context: DocPluginServiceContext
interfaceDocPluginRuntimesource ↗
interface DocPluginRuntime

Stable host capabilities supplied to a DocPlugin after editor assembly.

propertycommands
readonly commands: DocCommandBus

Command bus exposed by the document editor instance.

propertydocument
readonly document: { blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }

Rich-document domain services.

propertyevents
readonly events: { engine: EventEngine<NodeProperties>; registrar: EventRegistrar }

Event and hit-test services used by document interactions.

propertyextensions
readonly extensions: DocRuntimeExtensionRegistry

Extension capability registry for third-party document plugins.

propertyinput
readonly input: { keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }

Host input adapters used by document editing commands.

propertyobservations
readonly observations: ObservationRegistry

Typed state and event observations owned by this editor instance.

propertyplatform
readonly platform: Platform

Platform adapter for timers, resize observation, and diagnostics.

propertyplugins
readonly plugins: PluginManager<SearCoreDoc, NodeProperties>

Ordered document plugin registry for this editor.

propertyrender
readonly render: { context: RenderContext; engine: DocRenderEngineCapability }

Document render services and visible context.

propertyscroll
readonly scroll: { manager: ScrollManager }

Scroll state shared by document layout and rendering.

propertysession
readonly session: SessionStateRegistry

Local remount state contributed by built-in and third-party plugins.

propertytextShaper
readonly textShaper: TextShaper

Text shaper used by document layout and rendering.

interfaceDocPluginRuntimeContextsource ↗
interface DocPluginRuntimeContext extends DocPluginSetupContext

Document setup capabilities plus the Core created by createDocEditor().

propertycontainerinherited
readonly container: Container

DI container used by the document assembly root.

propertycore
readonly core: SearCoreDoc

Core document runtime.

propertyruntimeinherited
readonly runtime: DocPluginRuntime

Runtime services available to document plugins.

interfaceDocPluginServiceContextsource ↗
interface DocPluginServiceContext

Services available while createDocEditor() registers document plugins.

propertycontainer
readonly container: Container

DI container used by the document assembly root.

interfaceDocPluginSetupContextsource ↗
interface DocPluginSetupContext

Typed public services available before createDocEditor() starts Core.

propertycontainer
readonly container: Container

DI container used by the document assembly root.

propertyruntime
readonly runtime: DocPluginRuntime

Runtime services available to document plugins.

interfaceDocPointerDragHandlerssource ↗
interface DocPointerDragHandlers

Document pointer-drag lifecycle consumed by interaction plugins.

methodonEnd
onEnd(): void
methodonMove
onMove(input: DocPointerInput): void
input: DocPointerInput
methodonStart
onStart(input: DocPointerInput): void
input: DocPointerInput
interfaceDocPointerInputsource ↗
interface DocPointerInput

Pointer input used by document interaction plugins.

propertyviewX
readonly viewX: number
propertyviewY
readonly viewY: number
methodpreventDefault
preventDefault(): void
interfaceDocRenderEngineCapabilitysource ↗
interface DocRenderEngineCapability

Render-engine surface exposed to Doc plugins.

methodrender
render(pluginKey?: unknown): void
pluginKey: unknown
interfaceDocRenderLayoutServiceCapabilitysource ↗
interface DocRenderLayoutServiceCapability

Public layout-service surface exposed to Doc plugins and hosts.

methodgetLatestVirtualLayoutSummary
getLatestVirtualLayoutSummary(): DocVirtualLayoutSummary | null
methodreset
reset(): void
methodsubscribeVirtualLayoutSummary
subscribeVirtualLayoutSummary(listener: DocVirtualLayoutSummaryListener): (): void
listener: DocVirtualLayoutSummaryListener
interfaceDocVirtualLayoutSummarysource ↗
interface DocVirtualLayoutSummary

Public virtual layout summary exposed through the Doc layout-service capability.

propertyblockRender
readonly blockRender?: DocBlockRenderDebugSnapshot
propertycacheHits
readonly cacheHits: number
propertycacheMisses
readonly cacheMisses: number
propertycursorBlock
readonly cursorBlock: number | null
propertydocumentHeight
readonly documentHeight: number
propertyheightIndexUpdated
readonly heightIndexUpdated: boolean
propertyinitialLoadMs
readonly initialLoadMs?: number
propertymaterializedBlocks
readonly materializedBlocks: number
propertymaterializedIndexes
readonly materializedIndexes: string
propertymodel
readonly model: "reused" | "rebuilt"
propertyrangeEnd
readonly rangeEnd: number
propertyrangeStart
readonly rangeStart: number
propertyrenderPhase
readonly renderPhase?: DocVirtualLayoutRenderPhase
propertytimings
readonly timings: DocVirtualLayoutTimingSummary
propertytotalBlocks
readonly totalBlocks: number
interfaceDocVirtualLayoutTimingSummarysource ↗
interface DocVirtualLayoutTimingSummary

Timing summary reported by virtual document layout instrumentation.

propertycursorSelectionMs
readonly cursorSelectionMs: number
propertydocumentModelMs
readonly documentModelMs: number
propertyheightCorrectionMs
readonly heightCorrectionMs: number
propertymaterializeBlocksMs
readonly materializeBlocksMs: number
propertyrenderPrepareMode
readonly renderPrepareMode?: "full" | "viewport"
propertyrenderPrepareMs
readonly renderPrepareMs?: number
propertysnapshotCacheMs
readonly snapshotCacheMs: number
propertyviewportRangeMs
readonly viewportRangeMs: number
propertyvirtualLayoutTotalMs
readonly virtualLayoutTotalMs: number
interfaceInsertDocTableInputsource ↗
interface InsertDocTableInput

Input accepted by InsertDocTableCommand.

propertycolumns
readonly columns: number

Number of columns in the inserted table.

propertyrows
readonly rows: number

Number of rows in the inserted table.

interfaceInsertDocTextInputsource ↗
interface InsertDocTextInput

Input accepted by InsertDocTextCommand.

propertytext
readonly text: string

Text to insert at the current document selection.

interfaceLoadDocumentInputsource ↗
interface LoadDocumentInput

Input accepted by LoadDocumentCommand.

propertydocument
readonly document: RichDocNode[]

Rich-document content to load into the document editor.

interfaceMoveDocCursorInputsource ↗
interface MoveDocCursorInput

Input accepted by MoveDocCursorCommand.

propertydirection
readonly direction: DocCursorDirection

Direction for cursor movement.

propertyshiftKey
readonly shiftKey?: boolean

Whether the movement should extend the current selection.

interfaceSetDocBoldInputsource ↗
interface SetDocBoldInput

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

propertybold
readonly bold: boolean | null
interfaceSetDocCompositionInputsource ↗
interface SetDocCompositionInput

Input accepted by SetDocCompositionCommand.

propertycaretOffset
readonly caretOffset: number

Caret offset inside the composing text.

propertytext
readonly text: string

Current composing text emitted by the host input method.

interfaceSetDocFontFamilyInputsource ↗
interface SetDocFontFamilyInput

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

propertyfontFamily
readonly fontFamily: string | null
interfaceSetDocFontSizeInputsource ↗
interface SetDocFontSizeInput

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

propertyfontSize
readonly fontSize: number | null
interfaceSetDocItalicInputsource ↗
interface SetDocItalicInput
propertyitalic
readonly italic: boolean | null
interfaceSetDocLineSpacingInputsource ↗
interface SetDocLineSpacingInput

Input accepted by SetDocLineSpacingCommand. Null clears the paragraph override.

propertylineSpacing
readonly lineSpacing: RichTextLineSpacing | null
interfaceSetDocParagraphSpacingAfterInputsource ↗
interface SetDocParagraphSpacingAfterInput

Input accepted by SetDocParagraphSpacingAfterCommand. Null clears the paragraph override.

propertyspacingAfter
readonly spacingAfter: number | null
interfaceSetDocSelectionInputsource ↗
interface SetDocSelectionInput

Input accepted by SetDocSelectionCommand.

propertyselection
readonly selection: DocSelection

Selection to make active in the document editor.

interfaceSetDocStrikethroughInputsource ↗
interface SetDocStrikethroughInput
propertystrikethrough
readonly strikethrough: boolean | null
interfaceSetDocTextColorInputsource ↗
interface SetDocTextColorInput

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

propertycolor
readonly color: string | null
interfaceSetDocUnderlineInputsource ↗
interface SetDocUnderlineInput
propertyunderline
readonly underline: boolean | null
typeDocRuntimeCapabilityReadersource ↗
type DocRuntimeCapabilityReader = RuntimeCapabilityReader

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

typeDocRuntimeCapabilityTokensource ↗
type DocRuntimeCapabilityToken = RuntimeCapability<T>

Typed token used to publish and consume document runtime capabilities.

typeDocVirtualLayoutRenderPhasesource ↗
type DocVirtualLayoutRenderPhase = "initial" | "realtime"

Render phase reported by virtual document layout instrumentation.

typeDocVirtualLayoutSummaryListenersource ↗
type DocVirtualLayoutSummaryListener = (summary: DocVirtualLayoutSummary): void

Listener notified when the virtual layout summary changes.

variableClearDocCompositionCommandsource ↗
ClearDocCompositionCommand: DocCommandDefinition<void, DocCommandResult>

Clears the active IME composition preview text.

variableDeleteDocBackwardCommandsource ↗
DeleteDocBackwardCommand: DocCommandDefinition<void, DocCommandResult>

Deletes content before the current document selection.

variableDocCaretPluginKeysource ↗
DocCaretPluginKey: PluginKey
variableDocCompositionPluginKeysource ↗
DocCompositionPluginKey: PluginKey
variableDocContentRenderPluginKeysource ↗
DocContentRenderPluginKey: PluginKey

Default document feature plugin keys used by command pipelines.

variableDocPluginRuntimeCapabilitysource ↗
DocPluginRuntimeCapability: { CaretState: DocRuntimeCapability<DocCaretStateCapability>; Composition: DocRuntimeCapability<DocCompositionManager>; InputBindings: DocRuntimeCapability<DocInputBindingRegistryCapability>; Interaction: DocRuntimeCapability<DocInteractionRuntime> }

Runtime extension tokens owned by document plugins assembled by editor composition roots.

variableDocRuntimeCapabilitysource ↗
DocRuntimeCapability: { BlockFlows: DocRuntimeCapability<RichTextBlockFlowRegistry>; Commands: DocRuntimeCapability<DocCommandBus>; Config: DocRuntimeCapability<ConfigEngine<any>>; Document: DocRuntimeCapability<{ blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }>; Events: DocRuntimeCapability<{ engine: EventEngine<NodeProperties>; registrar: EventRegistrar }>; InlineStyles: DocRuntimeCapability<RichTextInlineStyleRegistry>; Input: DocRuntimeCapability<{ keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }>; LayoutService: DocRuntimeCapability<DocRenderLayoutServiceCapability>; … }

Document runtime capabilities registered by the default assembly root.

variableDocSelectionPluginKeysource ↗
DocSelectionPluginKey: PluginKey
variableFocusDocCommandsource ↗
FocusDocCommand: DocCommandDefinition<void, DocCommandResult>

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

variableInsertDocTableCommandsource ↗
InsertDocTableCommand: DocCommandDefinition<InsertDocTableInput, DocCommandResult>

Inserts a table block at the current document position.

variableInsertDocTextCommandsource ↗
InsertDocTextCommand: DocCommandDefinition<InsertDocTextInput, DocCommandResult>

Inserts text at the current document selection.

variableLoadDocumentCommandsource ↗
LoadDocumentCommand: DocCommandDefinition<LoadDocumentInput, DocCommandResult>

Replaces the active document content.

variableMoveDocCursorCommandsource ↗
MoveDocCursorCommand: DocCommandDefinition<MoveDocCursorInput, DocCommandResult>

Moves the current document cursor.

variableRenderDocCommandsource ↗
RenderDocCommand: DocCommandDefinition<void, DocCommandResult>

Requests a document render without changing content.

variableSelectAllDocCommandsource ↗
SelectAllDocCommand: DocCommandDefinition<void, DocCommandResult>

Selects all document content.

variableSetDocBoldCommandsource ↗
SetDocBoldCommand: DocCommandDefinition<SetDocBoldInput, DocCommandResult>

Sets whether the selected document text is bold.

variableSetDocCompositionCommandsource ↗
SetDocCompositionCommand: DocCommandDefinition<SetDocCompositionInput, DocCommandResult>

Sets the active IME composition preview text.

variableSetDocFontFamilyCommandsource ↗
SetDocFontFamilyCommand: DocCommandDefinition<SetDocFontFamilyInput, DocCommandResult>

Sets the font family on the selected document text.

variableSetDocFontSizeCommandsource ↗
SetDocFontSizeCommand: DocCommandDefinition<SetDocFontSizeInput, DocCommandResult>

Sets the font size in pixels on the selected document text.

variableSetDocItalicCommandsource ↗
SetDocItalicCommand: DocCommandDefinition<SetDocItalicInput, DocCommandResult>
variableSetDocLineSpacingCommandsource ↗
SetDocLineSpacingCommand: DocCommandDefinition<SetDocLineSpacingInput, DocCommandResult>

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

variableSetDocParagraphSpacingAfterCommandsource ↗
SetDocParagraphSpacingAfterCommand: DocCommandDefinition<SetDocParagraphSpacingAfterInput, DocCommandResult>

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

variableSetDocSelectionCommandsource ↗
SetDocSelectionCommand: DocCommandDefinition<SetDocSelectionInput, DocCommandResult>

Sets the active document selection without changing content.

variableSetDocStrikethroughCommandsource ↗
SetDocStrikethroughCommand: DocCommandDefinition<SetDocStrikethroughInput, DocCommandResult>
variableSetDocTextColorCommandsource ↗
SetDocTextColorCommand: DocCommandDefinition<SetDocTextColorInput, DocCommandResult>

Sets the text color on the selected document text.

variableSetDocUnderlineCommandsource ↗
SetDocUnderlineCommand: DocCommandDefinition<SetDocUnderlineInput, DocCommandResult>
variableSplitDocParagraphCommandsource ↗
SplitDocParagraphCommand: DocCommandDefinition<void, DocCommandResult>

Splits the current paragraph at the current document selection.

variableToggleDocBoldCommandsource ↗
ToggleDocBoldCommand: DocCommandDefinition<void, DocCommandResult>

Toggles bold on the selected document text.

variableToggleDocItalicCommandsource ↗
ToggleDocItalicCommand: DocCommandDefinition<void, DocCommandResult>
variableToggleDocStrikethroughCommandsource ↗
ToggleDocStrikethroughCommand: DocCommandDefinition<void, DocCommandResult>
variableToggleDocUnderlineCommandsource ↗
ToggleDocUnderlineCommand: DocCommandDefinition<void, DocCommandResult>
functioncreateBoldContributionsource ↗
createBoldContribution(): RichTextInlineStyleContribution

Creates the shared bold inline style contribution.

functioncreateBoldRenderContributionsource ↗
createBoldRenderContribution(): RichTextRunRenderContribution

Creates the render-layer bold contribution.

functioncreateDocCommandsource ↗
createDocCommand(id: string, renderPluginKey: PluginKey | readonly PluginKey[], createTransaction?: (): Transaction, effects?: readonly DocCommandEffect[] | undefined, localAction?: (): void): DocEditorCommand

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

id: string
renderPluginKey: PluginKey | readonly PluginKey[]
createTransaction: (): Transaction
effects: readonly DocCommandEffect[] | undefined
localAction: (): void
functioncreateFontFamilyContributionsource ↗
createFontFamilyContribution(): RichTextInlineStyleContribution

Creates the shared font-family inline style contribution.

functioncreateFontFamilyRenderContributionsource ↗
createFontFamilyRenderContribution(): RichTextRunRenderContribution

Creates the render-layer font-family contribution.

functioncreateFontSizeContributionsource ↗
createFontSizeContribution(): RichTextInlineStyleContribution

Creates the shared font-size inline style contribution.

functioncreateFontSizeRenderContributionsource ↗
createFontSizeRenderContribution(): RichTextRunRenderContribution

Creates the render-layer font-size contribution.

functioncreateItalicContributionsource ↗
createItalicContribution(): RichTextInlineStyleContribution
functioncreateItalicRenderContributionsource ↗
createItalicRenderContribution(): RichTextRunRenderContribution

Creates the render-layer italic contribution.

functioncreateStrikethroughContributionsource ↗
createStrikethroughContribution(): RichTextInlineStyleContribution
functioncreateStrikethroughRenderContributionsource ↗
createStrikethroughRenderContribution(): RichTextRunRenderContribution

Creates the render-layer strikethrough contribution.

functioncreateTextColorContributionsource ↗
createTextColorContribution(): RichTextInlineStyleContribution

Creates the shared text-color inline style contribution.

functioncreateTextColorRenderContributionsource ↗
createTextColorRenderContribution(): RichTextRunRenderContribution

Creates the render-layer text-color contribution.

functioncreateUnderlineContributionsource ↗
createUnderlineContribution(): RichTextInlineStyleContribution
functioncreateUnderlineRenderContributionsource ↗
createUnderlineRenderContribution(): RichTextRunRenderContribution

Creates the render-layer underline contribution.

functiondefineDocRuntimeCapabilitysource ↗
defineDocRuntimeCapability<T>(id: string): DocRuntimeCapability<T>

Creates a typed document runtime capability token.

id: string
functionregisterDocPluginBlockFlowssource ↗
registerDocPluginBlockFlows(plugins: readonly unknown[], registry: RichTextBlockFlowRegistry): (): void

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

plugins: readonly unknown[]
registry: RichTextBlockFlowRegistry
functionregisterDocPluginCapabilitiessource ↗
registerDocPluginCapabilities(plugins: readonly unknown[], registry: DocRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by document plugins.

plugins: readonly unknown[]
registry: DocRuntimeExtensionRegistry
functionregisterDocPluginCommandssource ↗
registerDocPluginCommands(plugins: readonly unknown[], commands: DocCommandBus): (): void

Runs the register document plugin commands helper.

plugins: readonly unknown[]
commands: DocCommandBus
functionregisterDocPluginInlineStyleRendererssource ↗
registerDocPluginInlineStyleRenderers(plugins: readonly unknown[], registry: RichTextRunRenderRegistry): (): void

Registers every rich-text run renderer contributed by document plugins.

plugins: readonly unknown[]
registry: RichTextRunRenderRegistry
functionregisterDocPluginInlineStylessource ↗
registerDocPluginInlineStyles(plugins: readonly unknown[], registry: RichTextInlineStyleRegistry): (): void

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

plugins: readonly unknown[]
registry: RichTextInlineStyleRegistry
functionregisterDocPluginKeyboardHandlerssource ↗
registerDocPluginKeyboardHandlers(plugins: readonly unknown[], context: DocKeyboardHandlerRegistrationContext): (): void

Registers every keyboard binding contributed by document plugins.

plugins: readonly unknown[]
context: DocKeyboardHandlerRegistrationContext
functionregisterDocPluginLineBoxessource ↗
registerDocPluginLineBoxes(plugins: readonly unknown[], registry: RichTextLineBoxRegistry): (): void

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

plugins: readonly unknown[]
registry: RichTextLineBoxRegistry
functionregisterDocPluginObservationssource ↗
registerDocPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void

Registers every typed observation source contributed by document plugins.

plugins: readonly unknown[]
observations: ObservationRegistry
functionregisterDocPluginSessionStatessource ↗
registerDocPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): void

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

plugins: readonly unknown[]
registry: SessionStateRegistry

Package

@searsuite/sear-assembly-headless

7 exports

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

classHeadlessXmlXPathEvaluatorsource ↗
class HeadlessXmlXPathEvaluator extends XmlXPathEvaluator

Node-safe XML/XPath adapter for tests, servers, and other headless hosts.

constructorconstructor
HeadlessXmlXPathEvaluator(): HeadlessXmlXPathEvaluator
propertysymbolstatic
readonly symbol: symbol

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

methodevaluateinherited
evaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluation

Evaluates an XPath expression against one XML document.

xml: string
xpath: string
options: XmlXPathOptions
typeHeadlessEditorsource ↗
type HeadlessEditor = SheetEditor

Public editor returned by the headless assembly helper.

typeHeadlessEditorOptionssource ↗
type HeadlessEditorOptions = Omit<SheetEditorConfiguration, "adapters"> & { currentDateTime?: (): number; dateSystem?: FormulaDateSystem; iteration?: FormulaIterationSettings }

Sheet editor options for hosts that do not provide platform adapters.

typeHeadlessWorkbookEditorsource ↗
type HeadlessWorkbookEditor = WorkbookEditor

Public workbook editor returned by the headless assembly helper.

typeHeadlessWorkbookEditorOptionssource ↗
type HeadlessWorkbookEditorOptions = Omit<WorkbookEditorConfiguration, "adapters"> & { currentDateTime?: (): number; dateSystem?: FormulaDateSystem; iteration?: FormulaIterationSettings }

Workbook editor options for hosts that do not provide platform adapters.

functioncreateHeadlessEditorsource ↗
createHeadlessEditor(options: HeadlessEditorOptions): SheetEditor createHeadlessEditor(options: HeadlessWorkbookEditorOptions): WorkbookEditor

Creates a sheet editor backed entirely by headless adapters.

ReturnsA sheet editor suitable for tests, servers, or non-UI hosts.

options: HeadlessWorkbookEditorOptions
Sheet editor configuration excluding adapter overrides.
functioncreateHeadlessWorkbookEditorsource ↗
createHeadlessWorkbookEditor(options: HeadlessWorkbookEditorOptions): WorkbookEditor

Creates a workbook editor backed entirely by platform-neutral headless adapters.

Use this assembly for server-side processing, deterministic tests, and hosts that
provide their own visual presentation. The returned editor exposes the same typed
command, observation, capability, document, and sheet facades as the visual assembly.

ReturnsAn isolated workbook editor that owns its plugins and runtime services.

options: HeadlessWorkbookEditorOptions
Workbook configuration excluding platform adapter construction.

Package

@searsuite/sear-assembly-plugin

91 exports

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

classEditorLifecycleErrorsource ↗
class EditorLifecycleError extends SearError

Public error raised when lifecycle stack ownership is violated.

constructorconstructor
EditorLifecycleError(code: EditorLifecycleErrorCode, message: string, details?: SearErrorDetails): EditorLifecycleError
code: EditorLifecycleErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: EditorLifecycleErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classEditorLifecycleStacksource ↗
class EditorLifecycleStack

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

constructorconstructor
EditorLifecycleStack(): EditorLifecycleStack
methodadd
add(disposer: (): void): void

Adds one owned resource disposer in acquisition order.

disposer: (): void
methoddispose
dispose(): void

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

classHeadlessToolbarsource ↗
class HeadlessToolbar extends SearToolbar

Toolbar implementation for hosts without a UI surface.

constructorconstructor
HeadlessToolbar(): HeadlessToolbar
propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessToolbar.

methoddestroy
destroy(): void

Releases resources owned by SearToolbar.

methodmount
mount(_target: unknown): void

Attaches this adapter to its host surface.

_target: unknown
classPluginsource ↗
class Plugin<SearCoreType, NodeTypeProperties, PluginStateType>

Base contract implemented by sheet and document plugins.

Plugins own their state, declare lifecycle hooks, transform transactions into
state, and render scene nodes for their host core. Runtime packages should
extend this contract rather than reaching into Core internals.

constructorconstructor
Plugin<SearCoreType, NodeTypeProperties, PluginStateType>(__namedParameters: PluginSpec<PluginStateType>): Plugin<SearCoreType, NodeTypeProperties, PluginStateType>

Creates a plugin with its stable identity and initial state.

__namedParameters: PluginSpec<PluginStateType>
propertydepth
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState?: PluginDocumentStateContribution<PluginStateType, object> | readonly PluginDocumentStateContribution<PluginStateType, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: string[]

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

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKey
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistory
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

memberkey
key: unknown
methodapply
apply(pluginState: PluginStateType, transaction: Transaction): PluginStateType | null

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

pluginState: PluginStateType
transaction: Transaction
methoddirtyRect
dirtyRect(searCore: SearCoreType, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreType
transaction: Transaction
methodenforceRuntimeWriteBoundary
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundary
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreType): unknown

Returns this plugin's runtime configuration view for the current core.

searCore: SearCoreType
methodgetState
getState(): PluginStateType

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundary
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedState
lockCommittedState(state: PluginStateType): void

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

state: PluginStateType
methodonClick
onClick(earCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonDblClick
onDblClick(earCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonInitialDataCell
onInitialDataCell(searCore: SearCoreType, cell: unknown, row: number, col: number): void

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

searCore: SearCoreType
cell: unknown
row: number
col: number
methodonInitialDataComplete
onInitialDataComplete(searCore: SearCoreType): void

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

searCore: SearCoreType
methodonMouseDown
onMouseDown(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonMouseMove
onMouseMove(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonMouseUp
onMouseUp(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonResize
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScroll
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransaction
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.

state: PluginStateType
transaction: Transaction
methodregisterConfig
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

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

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

methodrender
render(searCore: SearCoreType, offset?: { x: number; y: number }): Node<NodeTypeProperties> | Node<NodeTypeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

searCore: SearCoreType
offset: { x: number; y: number }
methodsealRuntimeMetadata
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethods
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWrites
sealRuntimeWrites(): void

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

methodsetState
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
classPluginKeysource ↗
class PluginKey

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.

constructorconstructor
PluginKey(key?: string): PluginKey

Constructs a key using the provided base name.

key: string
Human-readable plugin key prefix.
propertykey
readonly key: string

Unique plugin key string.

classPluginManagersource ↗
class PluginManager<SearCoreType, NodeTypeProperties>

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

constructorconstructor
PluginManager<SearCoreType, NodeTypeProperties>(platform?: Platform): PluginManager<SearCoreType, NodeTypeProperties>

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

platform: Platform
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the runtime plugin manager.

methodclearPlugins
clearPlugins(token?: object): void

Removes all registered plugins during host teardown.

token: object
methodenforceWriteBoundary
enforceWriteBoundary(token: object): void

Gives the owning runtime exclusive registry write access after assembly.

token: object
methodforEach
forEach(callbackfn: (plugin: Plugin<SearCoreType, NodeTypeProperties, any>): void): void

Visits plugins in depth order so event, apply and render flows stay deterministic.

callbackfn: (plugin: Plugin<SearCoreType, NodeTypeProperties, any>): void
methodgetAllPlugins
getAllPlugins(): Plugin<SearCoreType, NodeTypeProperties, any>[]

Returns all registered plugins in insertion order.

methodgetCollaborativeTransactionPlugin
getCollaborativeTransactionPlugin(ownerId: string): Plugin<SearCoreType, NodeTypeProperties, any> | undefined

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

ownerId: string
methodgetCollaborativeTransactionPlugins
getCollaborativeTransactionPlugins(): readonly Plugin<SearCoreType, NodeTypeProperties, any>[]

Lists collaborative transaction owners registered in this runtime.

methodgetDocumentStateContributions
getDocumentStateContributions(): readonly RegisteredPluginDocumentStateContribution[]

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

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

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

key: PluginKey
methodgetTransactionHistoryAdapter
getTransactionHistoryAdapter(transaction: Transaction): PluginTransactionHistoryAdapter | undefined

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

transaction: Transaction
methodgetTransactionOTContribution
getTransactionOTContribution(transaction: Transaction): PluginTransactionOTContribution<OTOperation> | undefined

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

transaction: Transaction
methodinvertTransaction
invertTransaction(transaction: Transaction): Transaction<Operation> | null

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

transaction: Transaction
methodregisterPlugin
registerPlugin<T>(plugin: Plugin<SearCoreType, NodeTypeProperties, T>, token?: object): void

Registers a plugin under its key and rejects duplicate ownership.

plugin: Plugin<SearCoreType, NodeTypeProperties, T>
token: object
methodtransformTransaction
transformTransaction(transaction: Transaction, other: Transaction): Transaction<Operation> | null

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

transaction: Transaction
other: Transaction
methodunregisterPlugin
unregisterPlugin(pluginOrKey: string | PluginKey | Plugin<SearCoreType, NodeTypeProperties, any>, token?: object): void

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

pluginOrKey: string | PluginKey | Plugin<SearCoreType, NodeTypeProperties, any>
token: object
classRuntimeCapabilityErrorsource ↗
class RuntimeCapabilityError extends SearError

Public error raised when a runtime capability contract is violated.

constructorconstructor
RuntimeCapabilityError(code: RuntimeCapabilityErrorCode, message: string, details?: SearErrorDetails): RuntimeCapabilityError
code: RuntimeCapabilityErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: RuntimeCapabilityErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classRuntimeCapabilityRegistrysource ↗
class RuntimeCapabilityRegistry extends RuntimeCapabilityReader

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

constructorconstructor
RuntimeCapabilityRegistry(owner?: string): RuntimeCapabilityRegistry
owner: string
methoddestroy
destroy(): void

Permanently closes the registry and releases all published values.

methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for capability changes after assembly.

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

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

capability: RuntimeCapability<T>
value: T
methodrequire
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
classSearFormulaBarsource ↗
class SearFormulaBar

Platform-neutral lifecycle for a Sheet formula input surface.

constructorconstructor
SearFormulaBar(): SearFormulaBar
propertysymbolstatic
readonly symbol: symbol
methoddestroy
destroy(): void
methodmount
mount(target: unknown): void
target: unknown
classSearToolbarsource ↗
class SearToolbar

Platform-neutral toolbar lifecycle contract.

constructorconstructor
SearToolbar(): SearToolbar
propertysymbolstatic
readonly symbol: symbol

DI token for resolving SearToolbar.

methoddestroy
destroy(): void

Releases resources owned by SearToolbar.

methodmount
mount(target: unknown): void

Attaches this adapter to its host surface.

target: unknown
classSessionStateErrorsource ↗
class SessionStateError extends SearError

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

constructorconstructor
SessionStateError(code: SessionStateErrorCode, message: string, details?: SearErrorDetails): SessionStateError

Creates a session-state contract error.

code: SessionStateErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: SessionStateErrorCode

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSessionStateRegistrysource ↗
class SessionStateRegistry

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

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

DI token for resolving the editor-local registry.

methodassertRestorationOpen
assertRestorationOpen(): void

Rejects a retained contributor restore callback after editor initialization.

methodcapture
capture(): SessionStateSnapshot

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

methodclear
clear(lifecycleToken?: object): void

Clears contributors and retained state owned by this registry instance.

lifecycleToken: object
methodgetCompletedRestorePhases
getCompletedRestorePhases(): readonly SessionStateRestorePhase[]

Returns restore phases already completed by this editor lifecycle.

methodgetRegisteredStateIds
getRegisteredStateIds(): readonly string[]

Returns sorted ids for currently registered contributors.

methodloadSnapshot
loadSnapshot(snapshot: SessionStateSnapshot): void

Loads a complete snapshot before lifecycle restoration begins.

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

Registers one state owner and returns an idempotent disposer.

definition: SessionStateDefinition<State>
adapter: SessionStateAdapter<State>
methodrestorePhase
restorePhase(phase: SessionStateRestorePhase): void

Restores every registered contributor assigned to one ordered lifecycle phase.

phase: SessionStateRestorePhase
methodsealRestoration
sealRestoration(lifecycleToken: object): void

Closes initialization-only restore operations for an assembled editor.

lifecycleToken: object
classSheetFormatTransferRegistrysource ↗
class SheetFormatTransferRegistry

Editor-local composition of state-owner format transfers.

constructorconstructor
SheetFormatTransferRegistry(): SheetFormatTransferRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

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

range: SheetMoveRange
methoddestroy
destroy(): void
methodregister
register(owner: SheetFormatTransferContribution): (): void
owner: SheetFormatTransferContribution
classSheetRangeMoveRegistrysource ↗
class SheetRangeMoveRegistry

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

constructorconstructor
SheetRangeMoveRegistry(): SheetRangeMoveRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodanalyze
analyze(context: SheetRangeMoveContext): SheetRangeMoveAnalysis

Assesses all owner constraints without planning or publishing any mutation.

context: SheetRangeMoveContext
methoddestroy
destroy(): void

Releases all editor-owned registrations.

methodhasConflict
hasConflict(context: SheetRangeMoveContext): boolean

Validates all owners before testing destination conflicts.

context: SheetRangeMoveContext
methodplan
plan(context: SheetRangeMoveContext): readonly SheetRangeMovePlan[]

Plans all owners against the same pre-move state.

context: SheetRangeMoveContext
methodregister
register(contribution: SheetRangeMoveContribution): (): void

Registers one owner and returns an idempotent disposer.

contribution: SheetRangeMoveContribution
classSheetRangeMoveRejectedErrorsource ↗
class SheetRangeMoveRejectedError extends SearError

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

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

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

analysis: { context: SheetRangeMoveContext; issue: { code: string; details: SearErrorDetails; message: string; ownerId: string }; status: "blocked" }
propertycauseinherited
cause?: unknown
propertycode
readonly code: string

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetRangeReorderRegistrysource ↗
class SheetRangeReorderRegistry
constructorconstructor
SheetRangeReorderRegistry(): SheetRangeReorderRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void
methodplan
plan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]
context: SheetRangeReorderContext
methodregister
register(contribution: SheetRangeReorderContribution): (): void
contribution: SheetRangeReorderContribution
classSheetStructureMoveRegistrysource ↗
class SheetStructureMoveRegistry

Editor-local preflight and operation planning for complete-axis moves.

constructorconstructor
SheetStructureMoveRegistry(): SheetStructureMoveRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void

Releases editor-owned contributions.

methodplan
plan(context: SheetStructureMoveContext): readonly Operation[]

Validates the original intent before compiling dependent operation updates.

context: SheetStructureMoveContext
methodregister
register(contribution: SheetStructureMoveContribution): (): void

Registers one contribution with order-independent, idempotent disposal.

contribution: SheetStructureMoveContribution
interfacePluginCommandExtensionsource ↗
interface PluginCommandExtension<CommandBus>

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

methodregisterCommands
registerCommands(commands: CommandBus): void

Registers every stable command id owned by this plugin.

commands: CommandBus
interfacePluginCommandRegistrarsource ↗
interface PluginCommandRegistrar<CommandBus>

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

methodregisterCommands
registerCommands(commands: CommandBus): void

Registers every stable command id owned by this plugin.

commands: CommandBus
interfacePluginConfigRegistrationsource ↗
interface PluginConfigRegistration<ConfigType>

Default configuration contributed by one plugin during editor setup.

propertyconfig
readonly config: ConfigType

Plain configuration values consumed and wrapped by ConfigEngine.

propertykey
readonly key: PluginKey

Plugin key that owns this configuration unit.

interfacePluginDataEngineRegistrationOptionssource ↗
interface PluginDataEngineRegistrationOptions<PluginStateType>

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

propertydataView
readonly dataView?: readonly PluginDataViewFieldRegistration<PluginStateType>[]

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

propertyenabled
readonly enabled?: boolean

When false, Core keeps the plugin private to PluginManager and skips DataEngine registration.

interfacePluginDataViewFieldRegistrationsource ↗
interface PluginDataViewFieldRegistration<PluginStateType>

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

propertyfieldKey
readonly fieldKey: string

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

propertyrequired
readonly required?: boolean

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

propertyselect
readonly select: (state: PluginStateType): unknown

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

propertyviewKey
readonly viewKey: string

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

interfacePluginDocumentStateCodecsource ↗
interface PluginDocumentStateCodec<TDocumentState>

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

propertykey
readonly key: string
methoddeserialize
deserialize(payload: unknown, path: string): Partial<TDocumentState>
payload: unknown
path: string
methodserialize
serialize(state: TDocumentState): unknown
state: TDocumentState
interfacePluginDocumentStateContributionsource ↗
interface PluginDocumentStateContribution<TOwnerState, TDocumentState>

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

propertycodec
readonly codec: PluginDocumentStateCodec<TDocumentState>
propertykey
readonly key: string
methodcapture
capture(ownerState: TOwnerState): Partial<TDocumentState> | undefined
ownerState: TOwnerState
interfacePluginObservationExtensionsource ↗
interface PluginObservationExtension<ObservationRegistry>

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

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
interfacePluginObservationRegistrarsource ↗
interface PluginObservationRegistrar<ObservationRegistry>

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

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
interfacePluginQueryRegistrarsource ↗
interface PluginQueryRegistrar<QueryRegistry>
methodregisterQueries
registerQueries(queries: QueryRegistry): void
queries: QueryRegistry
interfacePluginRuntimeCapabilityExtensionsource ↗
interface PluginRuntimeCapabilityExtension<RuntimeCapabilityRegistry>

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

methodregisterCapabilities
registerCapabilities(registry: RuntimeCapabilityRegistry): void

Registers every runtime capability owned by this plugin.

registry: RuntimeCapabilityRegistry
interfacePluginRuntimeCapabilityRegistrarsource ↗
interface PluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>

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

methodregisterCapabilities
registerCapabilities(registry: RuntimeCapabilityRegistry): void
registry: RuntimeCapabilityRegistry
interfacePluginSessionStateExtensionsource ↗
interface PluginSessionStateExtension<SessionStateRegistry>

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

methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
interfacePluginSessionStateRegistrarsource ↗
interface PluginSessionStateRegistrar<SessionStateRegistry>

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

methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
interfacePluginSpecsource ↗
interface PluginSpec<T>

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

propertykey
key: PluginKey

Stable key under which the plugin registers state, config and scene nodes.

propertystate
state: T

Initial state owned by the plugin.

interfacePluginStateRegistrationsource ↗
interface PluginStateRegistration<PluginStateType>

State registration returned by plugins during editor initialization.

propertydataEngine
readonly dataEngine?: PluginDataEngineRegistrationOptions<PluginStateType>

DataEngine exposure metadata for this state registration.

propertykey
readonly key: PluginKey

Plugin key that owns the registered state.

propertystate
readonly state: PluginStateType

State value to register for that plugin key.

interfacePluginTransactionHistoryAdaptersource ↗
interface PluginTransactionHistoryAdapter

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

methodinvert
invert(transaction: Transaction): Transaction<Operation> | null

Creates the transaction that reverses the supplied committed transaction.

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

Rebases a retained transaction over a transaction that committed later.

transaction: Transaction
other: Transaction
interfacePluginTransactionHistoryOperationssource ↗
interface PluginTransactionHistoryOperations

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

methodinvert
invert(operations: Operation[]): Operation[]

Reverses an operation list in rollback order.

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

Rebases an operation list over operations that committed later.

operations: Operation[]
other: Operation[]
interfacePluginTransactionOTContributionsource ↗
interface PluginTransactionOTContribution<OperationType>

Transaction algebra and collaboration metadata contributed by one state owner.

propertycollaborative
readonly collaborative?: boolean

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

propertydefinition
readonly definition: TransactionOTDefinition<OperationType>

Versioned operation family used by history and collaboration.

propertyownerId
readonly ownerId: string

Stable wire identity independent from process-local PluginKey suffixes.

propertyrelations
readonly relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]

Explicit relations needed by third-party operation families.

interfaceRegisteredPluginDocumentStateContributionsource ↗
interface RegisteredPluginDocumentStateContribution

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

propertycontribution
readonly contribution: PluginDocumentStateContribution<unknown>
propertyplugin
readonly plugin: Plugin<unknown, NodeProperties, unknown>
interfaceRuntimeCapabilitysource ↗
interface RuntimeCapability<T>

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

propertyid
readonly id: string
propertysymbol
readonly symbol: symbol
propertytype
readonly type?: T

Phantom member preserving the capability value type.

interfaceRuntimeCapabilityReadersource ↗
interface RuntimeCapabilityReader

Read-only capability view exposed by an editor facade.

methodget
get<T>(capability: RuntimeCapability<T>): T | undefined
capability: RuntimeCapability<T>
methodgetRegisteredCapabilityIds
getRegisteredCapabilityIds(): readonly string[]
methodhas
has(capability: RuntimeCapability<unknown>): boolean
capability: RuntimeCapability<unknown>
methodrequire
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
interfaceSessionStateAdaptersource ↗
interface SessionStateAdapter<State>

Captures and restores one detached local session value.

propertyrestoreAfter
readonly restoreAfter?: readonly SessionStateDefinition<unknown>[]

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

propertyrestorePhase
readonly restorePhase: SessionStateRestorePhase

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

methodcapture
capture(): State | undefined

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

methodrestore
restore(state: State): void

Restores local state during the declared lifecycle phase.

state: State
interfaceSessionStateDefinitionsource ↗
interface SessionStateDefinition<State>

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

propertyid
readonly id: string

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

propertystateType
readonly stateType?: State

Compile-time state carrier; never populated at runtime.

interfaceSheetFormatMatrixsource ↗
interface SheetFormatMatrix<Value>

Sparse read contract implemented by feature-owned matrices.

methodforEachStoredInRange
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: Value, row: number, column: number): void): void
startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (value: Value, row: number, column: number): void
methodgetDefaultValue
getDefaultValue(): Value | null | undefined
methodgetItem
getItem(row: number, column: number): Value | null | undefined
row: number
column: number
interfaceSheetFormatTransferContributionsource ↗
interface SheetFormatTransferContribution

Optional state-owner contribution to format painting.

propertyid
readonly id: string
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

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

range: SheetMoveRange
interfaceSheetFormatTransferPlansource ↗
interface SheetFormatTransferPlan

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

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetFormatTransferRegistrarsource ↗
interface SheetFormatTransferRegistrar

Optional plugin lifecycle extension for format-transfer registration.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void
registry: SheetFormatTransferRegistry
interfaceSheetFormatTransferSnapshotsource ↗
interface SheetFormatTransferSnapshot

Captured format data, independent of subsequent source changes.

methodplan
plan(destination: SheetMoveRange): readonly SheetFormatTransferPlan[]
destination: SheetMoveRange
interfaceSheetMoveRangesource ↗
interface SheetMoveRange

Zero-based inclusive bounds of a cell range.

propertyend
readonly end: readonly [number, number]
propertystart
readonly start: readonly [number, number]
interfaceSheetRangeMoveContextsource ↗
interface SheetRangeMoveContext

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

propertydestination
readonly destination: SheetMoveRange
propertysource
readonly source: SheetMoveRange
interfaceSheetRangeMoveContributionsource ↗
interface SheetRangeMoveContribution

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

propertyid
readonly id: string

Unique registration identity, conventionally <owner>.rangeMove; not a document field or operation target.

methodhasConflict
hasConflict(context: SheetRangeMoveContext): boolean

Reports whether destination data outside the source would be replaced.

context: SheetRangeMoveContext
methodplan
plan(context: SheetRangeMoveContext): readonly SheetRangeMovePlan[]

Reads current state and produces an isolated operation plan.

context: SheetRangeMoveContext
methodtransformPlans
transformPlans(context: SheetRangeMoveContext, plans: readonly SheetRangeMovePlan[]): readonly SheetRangeMovePlan[]

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

context: SheetRangeMoveContext
plans: readonly SheetRangeMovePlan[]
methodvalidate
validate(context: SheetRangeMoveContext): void

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

context: SheetRangeMoveContext
interfaceSheetRangeMovePlansource ↗
interface SheetRangeMovePlan

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

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetRangeReorderContextsource ↗
interface SheetRangeReorderContext

One stable row permutation within an inclusive cell range.

propertydestinationOf
readonly destinationOf: (row: number): number

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

propertyrange
readonly range: SheetMoveRange
interfaceSheetRangeReorderContributionsource ↗
interface SheetRangeReorderContribution

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

propertyid
readonly id: string
methodplan
plan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]
context: SheetRangeReorderContext
methodtransformPlans
transformPlans(context: SheetRangeReorderContext, plans: readonly SheetRangeReorderPlan[]): readonly SheetRangeReorderPlan[]
context: SheetRangeReorderContext
plans: readonly SheetRangeReorderPlan[]
methodvalidate
validate(context: SheetRangeReorderContext): void
context: SheetRangeReorderContext
interfaceSheetRangeReorderPlansource ↗
interface SheetRangeReorderPlan
propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetRangeRuleEntrysource ↗
interface SheetRangeRuleEntry<Rule>

A feature-owned rule and the rectangle it covers.

propertyrange
readonly range: SheetMoveRange
propertyrule
readonly rule: Rule
interfaceSheetRangeRuleFragmentsource ↗
interface SheetRangeRuleFragment<Rule>

One retained or relocated piece of an original rule.

propertyoriginal
readonly original: SheetRangeRuleEntry<Rule>
propertyplacement
readonly placement: "retained" | "moved"
propertyrange
readonly range: SheetMoveRange
interfaceSheetRangeRuleMoveAdaptersource ↗
interface SheetRangeRuleMoveAdapter<Rule>

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

propertyid
readonly id: string
methodplan
plan(context: SheetRangeMoveContext, affected: readonly SheetRangeRuleEntry<Rule>[], fragments: readonly SheetRangeRuleFragment<Rule>[]): readonly SheetRangeMovePlan[]
context: SheetRangeMoveContext
affected: readonly SheetRangeRuleEntry<Rule>[]
fragments: readonly SheetRangeRuleFragment<Rule>[]
methodreadRules
readRules(): readonly SheetRangeRuleEntry<Rule>[]
methodvalidate
validate(context: SheetRangeMoveContext): void
context: SheetRangeMoveContext
interfaceSheetStructureMoveContextsource ↗
interface SheetStructureMoveContext

One original-state structure permutation owned by a matrix plugin.

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetStructureMoveContributionsource ↗
interface SheetStructureMoveContribution

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

propertyid
readonly id: string
methodtransformOperations
transformOperations(context: SheetStructureMoveContext): readonly Operation[]
context: SheetStructureMoveContext
methodvalidate
validate(context: SheetStructureMoveContext): void
context: SheetStructureMoveContext
typeEditorLifecycleErrorCodesource ↗
type EditorLifecycleErrorCode = typeof EditorLifecycleErrorCode[keyof typeof EditorLifecycleErrorCode]

Stable machine-readable errors raised by editor lifecycle stacks.

typePluginDataViewFieldSelectorsource ↗
type PluginDataViewFieldSelector = { select: unknown }["select"]

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

typePluginExtensionsource ↗
type PluginExtension = PluginCommandExtension<CommandBus> & conditional & conditional & conditional & conditional

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

typeRuntimeCapabilityErrorCodesource ↗
type RuntimeCapabilityErrorCode = typeof RuntimeCapabilityErrorCode[keyof typeof RuntimeCapabilityErrorCode]

Supported runtime capability error codes.

typeSessionStateErrorCodesource ↗
type SessionStateErrorCode = typeof SessionStateErrorCode[keyof typeof SessionStateErrorCode]

Supported session-state error codes.

typeSessionStateRestorePhasesource ↗
type SessionStateRestorePhase = typeof SessionStateRestorePhase[keyof typeof SessionStateRestorePhase]

A supported local-state restoration phase.

typeSessionStateSnapshotsource ↗
type SessionStateSnapshot = Readonly<Record<string, unknown>>

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

typeSheetFormatRangesource ↗
type SheetFormatRange = SheetMoveRange

Inclusive range shared by format-transfer owners and hosts.

typeSheetRangeMoveAnalysissource ↗
type SheetRangeMoveAnalysis = { context: SheetRangeMoveContext; status: typeof SheetRangeMoveStatus.Allowed | typeof SheetRangeMoveStatus.RequiresConfirmation } | { context: SheetRangeMoveContext; issue: { code: string; details: SearErrorDetails; message: string; ownerId: string }; status: typeof SheetRangeMoveStatus.Blocked }

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

variableEditorLifecycleErrorCodesource ↗
EditorLifecycleErrorCode: { MultipleDisposalFailures: "SEAR_EDITOR_LIFECYCLE_MULTIPLE_DISPOSAL_FAILURES"; StackDisposed: "SEAR_EDITOR_LIFECYCLE_STACK_DISPOSED" }

Stable machine-readable errors raised by editor lifecycle stacks.

variableRuntimeCapabilityErrorCodesource ↗
RuntimeCapabilityErrorCode: { InvalidDefinition: "SEAR_RUNTIME_CAPABILITY_INVALID_DEFINITION"; NotRegistered: "SEAR_RUNTIME_CAPABILITY_NOT_REGISTERED"; RegistrationConflict: "SEAR_RUNTIME_CAPABILITY_REGISTRATION_CONFLICT"; RegistryDestroyed: "SEAR_RUNTIME_CAPABILITY_REGISTRY_DESTROYED" }

Stable machine-readable errors raised by runtime capability registries.

variableSessionStateErrorCodesource ↗
SessionStateErrorCode: { invalidDefinition: "SEAR_SESSION_STATE_INVALID_DEFINITION"; invalidRestoreDependency: "SEAR_SESSION_STATE_INVALID_RESTORE_DEPENDENCY"; invalidRestoreOrder: "SEAR_SESSION_STATE_INVALID_RESTORE_ORDER"; invalidRestorePhase: "SEAR_SESSION_STATE_INVALID_RESTORE_PHASE"; registrationConflict: "SEAR_SESSION_STATE_REGISTRATION_CONFLICT"; restoreDependencyCycle: "SEAR_SESSION_STATE_RESTORE_DEPENDENCY_CYCLE"; restoreInProgress: "SEAR_SESSION_STATE_RESTORE_IN_PROGRESS"; restorePhaseClosed: "SEAR_SESSION_STATE_RESTORE_PHASE_CLOSED"; … }

Stable machine-readable errors raised by session-state contracts.

variableSessionStateRestorePhasesource ↗
SessionStateRestorePhase: { AfterInitialize: "afterInitialize"; BeforeInitialize: "beforeInitialize" }

Ordered lifecycle phases in which local state may be restored.

variableSheetRangeMoveStatussource ↗
SheetRangeMoveStatus: { Allowed: "allowed"; Blocked: "blocked"; RequiresConfirmation: "requiresConfirmation" }

Canonical outcomes shared by move preview and execution.

functionassertSheetContributionWritesource ↗
assertSheetContributionWrite(owner: object): void

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

owner: object
functioncloneSessionStateValuesource ↗
cloneSessionStateValue<T>(value: T): T

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

value: T
functioncreateMatrixFormatTransfersource ↗
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<SheetFormatTransferContribution>

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

id: string
target: PluginKey
readMatrix: (): SheetFormatMatrix<Value>
functioncreatePluginTransactionHistoryAdaptersource ↗
createPluginTransactionHistoryAdapter(operations: PluginTransactionHistoryOperations): PluginTransactionHistoryAdapter

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

operations: PluginTransactionHistoryOperations
functioncreateRuntimeCapabilityReadersource ↗
createRuntimeCapabilityReader(registry: RuntimeCapabilityRegistry, hidden?: readonly RuntimeCapability<unknown>[]): RuntimeCapabilityReader

Exposes selected capabilities without handing hosts the mutable registry itself.

registry: RuntimeCapabilityRegistry
hidden: readonly RuntimeCapability<unknown>[]
functioncreateSheetRangeRuleMoveContributionsource ↗
createSheetRangeRuleMoveContribution<Rule>(adapter: SheetRangeRuleMoveAdapter<Rule>): SheetRangeMoveContribution

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

adapter: SheetRangeRuleMoveAdapter<Rule>
functiondefineRuntimeCapabilitysource ↗
defineRuntimeCapability<T>(id: string): RuntimeCapability<T>

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

id: string
functiondefineSessionStatesource ↗
defineSessionState<State>(id: string): SessionStateDefinition<State>

Creates an immutable typed identity for one local session value.

id: string
functionhasPluginCommandRegistrarsource ↗
hasPluginCommandRegistrar<CommandBus>(plugin: unknown): plugin

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

plugin: unknown
functionhasPluginObservationRegistrarsource ↗
hasPluginObservationRegistrar<ObservationRegistry>(plugin: unknown): plugin

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

plugin: unknown
functionhasPluginQueryRegistrarsource ↗
hasPluginQueryRegistrar<QueryRegistry>(plugin: unknown): plugin
plugin: unknown
functionhasPluginRuntimeCapabilityRegistrarsource ↗
hasPluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>(plugin: unknown): plugin

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

plugin: unknown
functionhasPluginSessionStateRegistrarsource ↗
hasPluginSessionStateRegistrar<SessionStateRegistry>(plugin: unknown): plugin

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

plugin: unknown
functionintersectSheetMoveRangessource ↗
intersectSheetMoveRanges(left: SheetMoveRange, right: SheetMoveRange): SheetMoveRange | null

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

left: SheetMoveRange
right: SheetMoveRange
functionisPointInSheetMoveRangesource ↗
isPointInSheetMoveRange(range: SheetMoveRange, row: number, column: number): boolean

Tests inclusive range membership.

range: SheetMoveRange
row: number
column: number
functionreadSessionStatesource ↗
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefined

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

snapshot: SessionStateSnapshot
definition: SessionStateDefinition<State>
functionsealSheetContributionWritessource ↗
sealSheetContributionWrites(owner: object, assertWrite: (): void): void

Seals setup-time Sheet contribution registries after editor startup.

owner: object
assertWrite: (): void
functionsubtractSheetMoveRangesource ↗
subtractSheetMoveRange(original: SheetMoveRange, cut: SheetMoveRange): SheetMoveRange[]

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

original: SheetMoveRange
cut: SheetMoveRange
functiontranslateSheetMoveRangesource ↗
translateSheetMoveRange(range: SheetMoveRange, source: SheetMoveRange, destination: SheetMoveRange): SheetMoveRange

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

range: SheetMoveRange
source: SheetMoveRange
destination: SheetMoveRange

Package

@searsuite/sear-assembly-setup

202 exports

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

classCaretPluginsource ↗
class CaretPlugin extends DocPlugin<null>

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

constructorconstructor
CaretPlugin(caretState: DocCaretState): CaretPlugin

Creates a CaretPlugin instance.

caretState: DocCaretState
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving CaretPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers caret-owned state before the plugin is resolved.

context: DocPluginServiceContext
classDefaultSheetClipboardDataSourcesource ↗
class DefaultSheetClipboardDataSource extends SheetClipboardDataSource

Default data source bridging clipboard commands to the active Sheet data view.

constructorconstructor
DefaultSheetClipboardDataSource(dataEngine: DataEngine, queries: SheetQueryRegistry): DefaultSheetClipboardDataSource
dataEngine: DataEngine
queries: SheetQueryRegistry
propertyformatTarget
readonly formatTarget: PluginKey
propertytarget
readonly target: PluginKey
methodgetColumnCount
getColumnCount(): number
methodgetRowCount
getRowCount(): number
methodgetSelection
getSelection(): SheetRangeBounds | null
methodreadCell
readCell(row: number, column: number): CellMatrixElement | null
row: number
column: number
methodreadCellFormat
readCellFormat(row: number, column: number): CellFormat | null
row: number
column: number
classDocCaretStatesource ↗
class DocCaretState

Shared caret blink state used by document feature plugins and render layout.

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

DI token for resolving caret state owned by CaretPlugin.

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

Closes direct caret writes after editor assembly.

isCommandExecuting: (): boolean
methodisVisible
isVisible(): boolean

Returns whether the caret should be painted in the current frame.

methodreset
reset(): void

Restarts the blink cycle with the caret visible.

methodsetVisible
setVisible(visible: boolean): void

Sets the current caret visibility.

visible: boolean
methodtoggle
toggle(): boolean

Toggles the caret visibility for a blink tick.

classDocContentRenderPluginsource ↗
class DocContentRenderPlugin extends DocPlugin<null>

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

constructorconstructor
DocContentRenderPlugin(): DocContentRenderPlugin

Creates a DocContentRenderPlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving DocContentRenderPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(searCore: SearCoreDoc): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

searCore: SearCoreDoc
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classDocDebugOverlayPluginsource ↗
class DocDebugOverlayPlugin extends DocPlugin<null>

Debug overlay for document block-level render bounds.

constructorconstructor
DocDebugOverlayPlugin(): DocDebugOverlayPlugin

Creates a DocDebugOverlayPlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving DocDebugOverlayPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstart
start(): void

Starts runtime behavior after the first document frame.

methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classDocInputBindingRegistrysource ↗
class DocInputBindingRegistry

Registry that lets multiple document plugins contribute handlers to single-subscription input adapters.

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

DI token for resolving the input binding registry.

methodclear
clear(): void

Removes every registered handler.

methodcreateKeyboardHandlers
createKeyboardHandlers(): KeyboardRouterHandlers

Creates the composed keyboard handlers passed to the host keyboard adapter.

methodcreateTextHandlers
createTextHandlers(): TextInputHandlers

Creates the composed text handlers passed to the host text adapter.

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

Closes registration changes after editor startup.

isCommandExecuting: (): boolean
isTearingDown: (): boolean
methodregisterKeyboardHandlers
registerKeyboardHandlers(handlers: KeyboardRouterHandlers): (): void

Adds keyboard-action handlers and returns a disposer.

handlers: KeyboardRouterHandlers
methodregisterTextHandlers
registerTextHandlers(handlers: TextInputHandlers): (): void

Adds text-input handlers and returns a disposer.

handlers: TextInputHandlers
classDocRenderLayoutServicesource ↗
class DocRenderLayoutService

Owns Doc layout cache, page map, and viewport range derivation.

constructorconstructor
DocRenderLayoutService(inputPlugin: DocInputPlugin, extensions: DocRuntimeExtensionRegistry, renderContext: RenderContext, scrollManager: ScrollManager, sceneTree: Tree<PositionRect<templateLiteral>>, configuration: DocEditorRuntimeConfiguration, configEngine: ConfigEngine, cursorManager: DocCursorManager, compositionProvider: DocCompositionProvider, layoutEngine: DocLayoutEngine, virtualLayouts: DocVirtualLayoutStore, commands: DocCommandBus): DocRenderLayoutService

Creates a render-layout service for one standalone document editor.

inputPlugin: DocInputPlugin
extensions: DocRuntimeExtensionRegistry
renderContext: RenderContext
scrollManager: ScrollManager
sceneTree: Tree<PositionRect<templateLiteral>>
configuration: DocEditorRuntimeConfiguration
configEngine: ConfigEngine
cursorManager: DocCursorManager
compositionProvider: DocCompositionProvider
layoutEngine: DocLayoutEngine
virtualLayouts: DocVirtualLayoutStore
commands: DocCommandBus
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the render-layout service.

methodgetLatestVirtualLayoutSummary
getLatestVirtualLayoutSummary(): DocVirtualLayoutSummary | null
methodprepareRenderLayout
prepareRenderLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport, renderOperations?: DocRenderOperations): DocRenderLayout

Builds the current render layout before plugins produce render nodes.

contentRect: DocEditorContentRect
viewport: DocEditorViewport
renderOperations: DocRenderOperations
methodprepareViewportLayout
prepareViewportLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport): DocRenderLayout

Reuses the previous full-document layout and updates only viewport-derived fields.

contentRect: DocEditorContentRect
viewport: DocEditorViewport
methodrecordBlockRenderDebugSnapshot
recordBlockRenderDebugSnapshot(snapshot: DocBlockRenderDebugSnapshot): void

Records block-render reuse/debug stats for the latest render frame.

snapshot: DocBlockRenderDebugSnapshot
methodrecordRenderPrepareTiming
recordRenderPrepareTiming(mode: DocRenderPrepareMode, durationMs: number): void
mode: DocRenderPrepareMode
durationMs: number
methodrefreshInteractionLayout
refreshInteractionLayout(contentRect: DocEditorContentRect, _viewport: DocEditorViewport): DocRenderLayout | null

Reuses the latest layout snapshot and refreshes selection/caret geometry only.

contentRect: DocEditorContentRect
_viewport: DocEditorViewport
methodreset
reset(): void

Clears cached layout and page state.

methodsubscribeVirtualLayoutSummary
subscribeVirtualLayoutSummary(listener: DocVirtualLayoutSummaryListener): (): void
listener: DocVirtualLayoutSummaryListener
classHistoryPluginsource ↗
class HistoryPlugin extends DocPlugin<null>

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

constructorconstructor
HistoryPlugin(input: DocInputPlugin, platform?: Platform): HistoryPlugin
input: DocInputPlugin
platform: Platform
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving HistoryPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: Transaction): null

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

_state: null
_transaction: Transaction
methodconfigure
configure(context: DocPluginSetupContext): void

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

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodgetStatus
getStatus(): DocHistoryStatus
methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(): void

Aligns the history baseline with state restored before Core initialization.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

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

transaction: Transaction
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

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

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

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodsubscribe
subscribe(listener: (status: DocHistoryStatus): void): (): void
listener: (status: DocHistoryStatus): void
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classRichTextBlockNodesource ↗
class RichTextBlockNode extends RichTextVisualNode

Scene node that indexes and draws one top-level rich-text block.

constructorconstructor
RichTextBlockNode(input: { block: { id: string; index: number }; font: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; origin?: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }): RichTextBlockNode

Creates a block-level rich-text scene node.

input: { block: { id: string; index: number }; font: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; origin?: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws all visible text runs inside this block.

context: RenderContext
clipRegion: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextBlockNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classRichTextRunNodesource ↗
class RichTextRunNode extends RichTextVisualNode

Scene node that draws one contiguous styled rich-text run in world coordinates.

constructorconstructor
RichTextRunNode(input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; properties: Partial<RichTextRenderNodeProperties>; rect: PositionRectProps; runRenderer: RichTextRunRenderer; style?: Readonly<Record<string, unknown>>; … }): RichTextRunNode

Creates a text-run scene node.

input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; properties: Partial<RichTextRenderNodeProperties>; rect: PositionRectProps; runRenderer: RichTextRunRenderer; style?: Readonly<Record<string, unknown>>; … }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the text run into the active world-space transform.

context: RenderContext
clipRegion: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextRunNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classSelectionPluginsource ↗
class SelectionPlugin extends DocPlugin<null>

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

constructorconstructor
SelectionPlugin(input: DocInputPlugin): SelectionPlugin
input: DocInputPlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SelectionPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers the host-facing selection observation.

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers selection-owned local remount state.

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstart
start(): void

Starts runtime behavior after the first document frame.

methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classSheetDebugOverlayPluginsource ↗
class SheetDebugOverlayPlugin extends SheetPlugin<null>

Empty Sheet debug overlay placeholder used by hosts that enable ?debug.

constructorconstructor
SheetDebugOverlayPlugin(): SheetDebugOverlayPlugin

Creates a SheetDebugOverlayPlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetDebugOverlayPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: SheetPluginSetupContext): void

Configures the Sheet editor before its Core is created.

context: SheetPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: SheetPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before
the first frame and other runtime effects.

context: SheetPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroyinherited
onEditorDestroy(context: SheetPluginRuntimeContext): void

Releases resources owned by this plugin before the Core is destroyed.

This deliberately does not use the name destroy: DI containers may
treat a no-argument destroy() method as an owned-instance disposer.

context: SheetPluginRuntimeContext
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

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

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

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

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCapabilitiesinherited
registerCapabilities(registry: SheetRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this plugin.

registry: SheetRuntimeExtensionRegistry
methodregisterCellVisualReadersinherited
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): void

Registers plugin-owned properties used to compose rendered Sheet cells.

registry: SheetCellVisualReaderRegistry
context: SheetCellVisualReaderRegistrationContext
methodregisterCommandsinherited
registerCommands(commands: SheetCommandBus): void

Registers every stable command id owned by this plugin.

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

Registers default configuration values owned by this plugin.

methodregisterFormatTransfersinherited
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Contributes owner-defined format capture and transfer plans.

registry: SheetFormatTransferRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

Registers typed state and event observations owned by this plugin.

observations: ObservationRegistry
methodregisterQueriesinherited
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMovesinherited
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes state-owner planning for same-sheet cell moves.

registry: SheetRangeMoveRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodregisterStructureMovesinherited
registerStructureMoves(registry: SheetStructureMoveRegistry): void

Contributes preflight and dependent operation planning for whole-axis reordering.

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

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: SheetPluginRuntimeContext): void

Starts runtime behavior after the Core has rendered its first frame.

context: SheetPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: SheetPluginServiceContext): void

Registers bindings required before this Sheet plugin is instantiated.

context: SheetPluginServiceContext
classSheetPluginsource ↗
class SheetPlugin<StateType> extends Plugin<SearCoreSheet, CellProperties, StateType>, PluginExtension<SheetCommandBus, ObservationRegistry, SessionStateRegistry, SheetRuntimeExtensionRegistry, SheetQueryRegistry>

Convenience base class for a Plugin targeting createSheetEditor().

constructorconstructor
SheetPlugin<StateType>(__namedParameters: PluginSpec<StateType>): SheetPlugin<StateType>

Creates a plugin with its stable identity and initial state.

__namedParameters: PluginSpec<StateType>
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<StateType, object> | readonly PluginDocumentStateContribution<StateType, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

memberkeyinherited
key: unknown
methodapplyinherited
apply(pluginState: StateType, transaction: Transaction): StateType | null

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

pluginState: StateType
transaction: Transaction
methodconfigure
configure(context: SheetPluginSetupContext): void

Configures the Sheet editor before its Core is created.

context: SheetPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(searCore: SearCoreSheet): unknown

Returns this plugin's runtime configuration view for the current core.

searCore: SearCoreSheet
methodgetStateinherited
getState(): StateType

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(context: SheetPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before
the first frame and other runtime effects.

context: SheetPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: StateType): void

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

state: StateType
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroy
onEditorDestroy(context: SheetPluginRuntimeContext): void

Releases resources owned by this plugin before the Core is destroyed.

This deliberately does not use the name destroy: DI containers may
treat a no-argument destroy() method as an owned-instance disposer.

context: SheetPluginRuntimeContext
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

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

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

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

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: StateType, 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.

state: StateType
transaction: Transaction
methodregisterCapabilities
registerCapabilities(registry: SheetRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this plugin.

registry: SheetRuntimeExtensionRegistry
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): void

Registers plugin-owned properties used to compose rendered Sheet cells.

registry: SheetCellVisualReaderRegistry
context: SheetCellVisualReaderRegistrationContext
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers every stable command id owned by this plugin.

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

Registers default configuration values owned by this plugin.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Contributes owner-defined format capture and transfer plans.

registry: SheetFormatTransferRegistry
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers typed state and event observations owned by this plugin.

observations: ObservationRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes state-owner planning for same-sheet cell moves.

registry: SheetRangeMoveRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): PluginStateRegistration<unknown>[] | PluginStateRegistration<StateType>

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

methodregisterStructureMoves
registerStructureMoves(registry: SheetStructureMoveRegistry): void

Contributes preflight and dependent operation planning for whole-axis reordering.

registry: SheetStructureMoveRegistry
methodrenderinherited
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties> | Node<CellProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

searCore: SearCoreSheet
offset: { x: number; y: number }
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: StateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: StateType
commitToken: object
methodstart
start(context: SheetPluginRuntimeContext): void

Starts runtime behavior after the Core has rendered its first frame.

context: SheetPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: SheetPluginServiceContext): void

Registers bindings required before this Sheet plugin is instantiated.

context: SheetPluginServiceContext
classSheetRuntimeExtensionRegistrysource ↗
class SheetRuntimeExtensionRegistry extends RuntimeCapabilityRegistry

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.

constructorconstructor
SheetRuntimeExtensionRegistry(): SheetRuntimeExtensionRegistry
methoddestroyinherited
destroy(): void

Permanently closes the registry and releases all published values.

methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for capability changes after assembly.

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

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

capability: RuntimeCapability<T>
value: T
methodrequireinherited
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
classTextInputPluginsource ↗
class TextInputPlugin extends DocPlugin<null>

Owns printable text input and delete bindings.

constructorconstructor
TextInputPlugin(): TextInputPlugin

Creates a TextInputPlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving TextInputPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers text node model support owned by this plugin.

context: DocPluginServiceContext
classViewportOverlayNodesource ↗
class ViewportOverlayNode extends RichTextVisualNode

Viewport overlay node that draws transient UI under an identity transform.

constructorconstructor
ViewportOverlayNode(input: { depth?: number; drawOverlay: (context: RenderContext): void; nodeKey: string; rect: PositionRectProps; role?: "selection" | "caret" }): ViewportOverlayNode

Creates a viewport overlay render node.

input: { depth?: number; drawOverlay: (context: RenderContext): void; nodeKey: string; rect: PositionRectProps; role?: "selection" | "caret" }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext): void

Draws overlay content; the node owns transform isolation for viewport-space plugins.

context: RenderContext
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): ViewportOverlayNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

interfaceCaptureDocSessionStateCommandResultsource ↗
interface CaptureDocSessionStateCommandResult extends DocCommandResult

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

propertyeffectsinherited
readonly effects?: readonly DocCommandEffect[]

Optional local effects requested after operation execution.

propertypipelineinherited
readonly pipeline: Pipeline

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

propertysessionState
readonly sessionState: DocSessionState
interfaceCaptureSheetSessionStateCommandResultsource ↗
interface CaptureSheetSessionStateCommandResult extends SheetCommandResult

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

propertycompletioninherited
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertyeffectsinherited
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertypipelineinherited
readonly pipeline: Pipeline

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

propertysessionState
readonly sessionState: SheetSessionState
interfaceDocBaseServicessource ↗
interface DocBaseServices

Base service instances created before runtime adapters and plugins are wired.

propertyconfigEngine
readonly configEngine: ConfigEngine

Configuration engine registered in the DI container.

propertystage
readonly stage: SceneGraph<RichTextRenderNodeProperties>

Scene graph that owns standalone document content render nodes.

interfaceDocDocumentStatesource ↗
interface DocDocumentState

Document-owned rich content eligible for future ExportPlugin serialization.

propertydocument
readonly document: RichDocNode[]

Rich-document tree owned by this editor document.

interfaceDocEditorsource ↗
interface DocEditor

Public standalone document editor API returned by createDocEditor().

propertycapabilities
readonly capabilities: RuntimeCapabilityReader

Read-only access to typed services owned by this editor's isolated runtime.

propertycommands
readonly commands: DocCommandBus

The supported command entry point for document user and program actions.

propertyobservations
readonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

methoddestroy
destroy(): void

Releases listeners, timers, adapter state, and DI-owned services for this editor instance.

methodfocus
focus(): void

Requests focus for the host text-input adapter, preserving IME placement.

methodgetDocument
getDocument(): RichDocNode[]

Returns a clone of the current rich-document content.

methodgetText
getText(): string

Returns the current plain-text view using one newline between paragraphs.

methodloadDocument
loadDocument(document: RichDocNode[]): void

Replaces the document content and renders the new state.

document: RichDocNode[]
methodrender
render(): void

Renders the current editor state into the configured render context.

interfaceDocEditorAdapterssource ↗
interface DocEditorAdapters

Platform-specific services required to assemble a standalone document editor.

propertyeventRegistrar
eventRegistrar?: InjectableImplementation<EventRegistrar>

Optional host event registrar; defaults to a headless registrar when omitted.

propertykeyboardRouter
keyboardRouter: InjectableImplementation<KeyboardRouter>

Keyboard router for action keys such as arrows, backspace, enter, and select-all.

propertyplatform
platform: InjectableImplementation<Platform>

Platform implementation that owns timers, resize observation, and diagnostics.

propertypointerCapture
pointerCapture: InjectableImplementation<PointerCapture>

Host-wide pointer capture adapter that emits render-root view coordinates.

propertyscroller
scroller?: InjectableImplementation<Scroller & { getPublisher: unknown }>

Optional host scroller adapter for wheel/touch viewport scrolling.

propertytextInput
textInput: InjectableImplementation<TextInput>

Text input adapter for printable text, paste/cut, and IME composition.

methodcreateRenderContext
createRenderContext(): RenderContext

Creates the visible render context used by the document editor.

methodcreateTextShaper
createTextShaper(renderContext: RenderContext): TextShaper

Optional text-shaping adapter; omission uses render-context measurements.

renderContext: RenderContext
methodregisterEnvironment
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.

container: Container
interfaceDocEditorChangesource ↗
interface DocEditorChange

Snapshot delivered when the document content changes.

propertydocument
readonly document: RichDocNode[]

Cloned rich-document content after the change.

propertytext
readonly text: string

Plain-text view using one newline between paragraphs.

interfaceDocEditorConfigurationsource ↗
interface DocEditorConfiguration

Configuration for assembling a standalone rich-document editor.

propertyadapters
adapters: DocEditorAdapters

Platform adapters supplied by the host application.

propertydefaultPlugins
defaultPlugins?: false | readonly DocPluginImplementation<DocPlugin<unknown>>[]

Default document feature plugins; pass false to assemble only custom plugins.

propertydevicePixelRatio
devicePixelRatio?: number

Raster scale used to initialize and resize the render context.

propertydocumentState
documentState: DocDocumentState

Initial document-owned state.

propertyfontFamily
fontFamily?: string

Default font family and fallback list applied to document text.

propertyfontSize
fontSize?: number

Default font size applied when measuring and rendering document text.

propertyincrementalRenderPolicyLimits
incrementalRenderPolicyLimits?: IncrementalRenderPolicyLimitsConfig

Guardrails used when deciding whether document block raster reuse should run for a frame.

propertylineHeightMultiplier
lineHeightMultiplier?: number

Default line-height multiplier applied to paragraphs without an explicit override.

propertyparagraphSpacingAfter
paragraphSpacingAfter?: number

Default spacing after non-final paragraphs.

propertyplugins
plugins?: DocPluginImplementation<DocPlugin<unknown>>[]

Document plugins installed after the default editing and rendering features.

propertysessionState
sessionState?: Readonly<Record<string, unknown>>

Optional editor-local state restored during an in-memory remount.

propertyverticalAlign
verticalAlign?: DocVerticalAlign

Vertical positioning used by standalone document layout; defaults to top.

propertyviewport
viewport?: DocEditorViewport

Initial viewport size; defaults to 800 by 600 when the host cannot know it yet.

methodcontentRect
contentRect(viewport: DocEditorViewport): DocEditorContentRect

Resolves the editable content rectangle from the current viewport.
Hosts use this to add page margins, rulers, or chrome without changing core document layout.

viewport: DocEditorViewport
methodonCreated
onCreated(editor: DocEditor): void

Called once the editor object has been assembled and initial content rendered.

editor: DocEditor
interfaceDocEditorContentRectsource ↗
interface DocEditorContentRect extends DocEditorViewport

Rectangle used for document text layout and rendering.

propertyheightinherited
height: number

Viewport height in host-view units.

propertywidthinherited
width: number

Viewport width in host-view units.

propertyx
x: number

Left edge in host-view coordinates.

propertyy
y: number

Top edge in host-view coordinates.

interfaceDocEditorViewportsource ↗
interface DocEditorViewport

Viewport dimensions in host-view coordinates.

propertyheight
height: number

Viewport height in host-view units.

propertywidth
width: number

Viewport width in host-view units.

interfaceDocHistoryEntrysource ↗
interface DocHistoryEntry

Detached before/after snapshots for one committed document mutation.

propertyafterDocument
readonly afterDocument: RichDocNode[]
propertyafterSelection
readonly afterSelection: DocSelection
propertybeforeDocument
readonly beforeDocument: RichDocNode[]
propertybeforeSelection
readonly beforeSelection: DocSelection
propertyoperations
readonly operations?: readonly RichDocOTOperation[]

RichDoc OT operations committed by the document mutation.

interfaceDocHistorySessionStatesource ↗
interface DocHistorySessionState

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

propertyredoStack
readonly redoStack: readonly DocHistoryEntry[]
propertyundoStack
readonly undoStack: readonly DocHistoryEntry[]
interfaceDocHistoryStatussource ↗
interface DocHistoryStatus

Current document undo/redo availability.

propertycanRedo
readonly canRedo: boolean
propertycanUndo
readonly canUndo: boolean
interfaceDocInlineStyleStatussource ↗
interface DocInlineStyleStatus

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

propertyactive
readonly active: boolean
propertyenabled
readonly enabled: boolean
propertyvalue
readonly value: unknown

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

interfaceDocRenderLayoutsource ↗
interface DocRenderLayout

Layout/cache/page-map result exposed to document plugins for one render pass.

propertyblockLayoutDiff
readonly blockLayoutDiff: DocBlockLayoutDiff

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

propertycomposingCaretPixelOffset
readonly composingCaretPixelOffset: number

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

propertycursorX
readonly cursorX: number

Cursor x in world coordinates.

propertycursorY
readonly cursorY: number

Cursor y in world coordinates.

propertydocumentRect
readonly documentRect: { height: number; width: number; x: number; y: number }

Current document layout rectangle in world coordinates.

propertylayoutCache
readonly layoutCache: DocLayoutCache

Latest full-document layout cache.

propertypageMap
readonly pageMap: DocPageMap

Latest page map derived from the layout cache.

propertyvisibleBlocks
readonly visibleBlocks: readonly DocBlockLayout[]

Laid-out blocks selected for plugin-owned render nodes.

interfaceDocRuntimesource ↗
interface DocRuntime

Runtime services assembled after Doc base services and host environment values are available.

propertyeventEngine
readonly eventEngine: EventEngine<NodeProperties>

Event pipeline and hit-testing facade for document interactions.

propertyeventRegistrar
readonly eventRegistrar: EventRegistrar

Event registrar selected by the host or the headless fallback.

propertypluginManager
readonly pluginManager: PluginManager<SearCoreDoc, NodeProperties>

Document plugin manager populated by feature registration.

propertyrenderContexts
readonly renderContexts: { hit: RenderContext; main: RenderContext; offScreen: RenderContext }

Render contexts for visible, off-screen, and hit-test layers.

propertyrenderEngine
readonly renderEngine: DocRenderEngine

Document render engine populated with the shared Sheet-like strategy chain.

propertyscrollManager
readonly scrollManager: ScrollManager

Scroll manager coordinating document viewport state.

interfaceDocViewportSessionStatesource ↗
interface DocViewportSessionState

Local viewport position retained while remounting one document editor.

propertyx
readonly x: number
propertyy
readonly y: number
interfaceExportDocStateCommandResultsource ↗
interface ExportDocStateCommandResult extends DocCommandResult

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

propertydocumentState
readonly documentState: DocDocumentState
propertyeffectsinherited
readonly effects?: readonly DocCommandEffect[]

Optional local effects requested after operation execution.

propertypipelineinherited
readonly pipeline: Pipeline

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

interfaceExportSheetStateCommandResultsource ↗
interface ExportSheetStateCommandResult extends SheetCommandResult

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.

propertycompletioninherited
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertyeffectsinherited
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertypipelineinherited
readonly pipeline: Pipeline

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

propertysheetState
readonly sheetState: SheetDocumentState

Cloned state payload suitable for workbook persistence or sheet remounting.

interfaceRichTextRenderLinesource ↗
interface RichTextRenderLine

Minimal layout-line shape consumed by rich-text render nodes.

propertychars
readonly chars: readonly RichTextRenderChar[]
propertycharStartOffset
readonly charStartOffset: number
propertycursorXOffsets
readonly cursorXOffsets?: readonly number[]
propertyfontAscent
readonly fontAscent: number
propertyheight
readonly height: number
propertytextNodePath
readonly textNodePath: readonly number[]
propertyx
readonly x: number
propertyy
readonly y: number
interfaceRichTextRenderNodePropertiessource ↗
interface RichTextRenderNodeProperties extends NodeProperties

Render-node properties used by rich-text scene graphs.

propertyblockId
readonly blockId?: string

Stable top-level rich-text block id.

propertyblockIndex
readonly blockIndex?: number

Top-level rich-text block index.

propertybottominherited
bottom?: number
propertycontentInsetStartinherited
contentInsetStart?: number

Space reserved before projected text for a cell visual.

propertycornerRadiusinherited
cornerRadius?: [number, number, number, number]
propertydepthinherited
depth?: number
propertyfillinherited
fill?: string
propertyfitNumberValueinherited
fitNumberValue?: number

Raw General-format number fitted against the actual render width.

propertyhideTextinherited
hideText?: boolean

Suppresses projected text while preserving its underlying value.

propertyhorizontalAligninherited
horizontalAlign?: SheetHorizontalAlignment
propertyisEditinherited
isEdit?: boolean
propertyleftinherited
left?: number
propertylineDashinherited
lineDash?: number[]
propertylineIndex
readonly lineIndex?: number

Layout line index inside the full rich-text snapshot.

propertynodeKeyinherited
nodeKey?: string

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.

propertyoverlayClipRectinherited
overlayClipRect?: PositionRectProps

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).

propertyrenderRole
readonly renderRole?: "block" | "line" | "page" | "text-run" | "selection" | "caret" | "composition"

Semantic role for rich-text render nodes.

propertyrightinherited
right?: number
propertysemanticOwnerinherited
semanticOwner?: string

Stable semantic ownership exposed by retained render targets.

propertysemanticRoleinherited
semanticRole?: string

Stable semantic role exposed by retained render targets.

propertyshouldBeClipInDirtyRenderinherited
shouldBeClipInDirtyRender?: boolean

Business marker: true when selection represents a whole row or whole column range.
Dirty render may use this to choose a different redraw shape.

propertyskipHitinherited
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.

propertystrokeinherited
stroke?: string
propertystrokeWidthinherited
strokeWidth?: number
propertytextColorinherited
textColor?: string

Foreground color used by text-rendering nodes.

propertytextFillCharacterinherited
textFillCharacter?: string

Character repeated to fill the remaining inline width of formatted text.

propertytopinherited
top?: number
propertyverticalAligninherited
verticalAlign?: SheetVerticalAlignment
interfaceSheetDocumentStatesource ↗
interface SheetDocumentState

Document data owned by one sheet and eligible for future ExportPlugin serialization.

propertycellAlignments
cellAlignments: AlignmentMatrix
propertycellBorders
cellBorders?: CellBorderMatrix

Sparse custom cell-edge state; absence initializes an empty border owner.

propertycellFills
cellFills: CellFillMatrix

Sparse cell fill state.

propertycellFormats
cellFormats: CellFormatMatrix

Sparse per-cell number-format state.

propertycellHighlights
cellHighlights: CellHighlightMatrix

Sparse conditional highlight rules anchored at their range starts.

propertycellMerges
cellMerges: CellMergeMatrix
propertycellVerticalAlignments
cellVerticalAlignments: VerticalAlignmentMatrix

Sparse vertical cell alignment state.

propertycolumnHiddenOriginalSizes
columnHiddenOriginalSizes?: CSRMatrix<number>
propertycolumnSizes
columnSizes: ColumnShapeDimensionsCSRMatrix
propertydataValidations
dataValidations?: DataValidationMatrix

Sparse data validation rules anchored at range starts.

propertyduplicates
duplicates: DuplicateMatrix

Sparse duplicate-item highlight state.

propertyfilters
filters?: SheetFilterMatrix

Sheet-owned filter range and column rules.

propertyfixedRows
fixedRows?: FixedRowMatrix

Sparse per-row fixed state.

propertyfreeze
freeze?: SheetFreezeMatrix

Persistent top and left freeze boundaries.

propertyrowHiddenOriginalSizes
rowHiddenOriginalSizes?: CSRMatrix<number>
propertyrowSizes
rowSizes: RowShapeDimensionsCSRMatrix
propertysheetData
sheetData: SheetMatrix
interfaceSheetEditorsource ↗
interface SheetEditor

Public contract for SheetEditor.

propertycapabilities
readonly capabilities: RuntimeCapabilityReader

Read-only access to typed services owned by this editor's isolated runtime.

propertycommands
readonly commands: SheetCommandBus

The sole supported entry point for user and program commands.

propertyobservations
readonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

propertyqueries
readonly queries: SheetQueryRegistry

Typed runtime query registry for side-effect-free editor reads.

methoddestroy
destroy(): void

Releases runtime services and every active host observation subscription.

interfaceSheetEditorAdapterssource ↗
interface SheetEditorAdapters

Platform-specific services required to assemble the default sheet editor.

propertyclipboard
clipboard?: InjectableImplementation<SheetClipboard>
propertycollabTransport
collabTransport: InjectableImplementation<CollabTransport>
propertycursorEngine
cursorEngine: InjectableImplementation<CursorEngine>
propertyeventRegistrar
eventRegistrar: InjectableImplementation<EventRegistrar>
propertyfileDownload
fileDownload?: InjectableImplementation<FileDownload>

Optional host file-save capability; existing environment bindings take precedence. The editor owns newly created adapters.

propertyformulaBar
formulaBar?: InjectableImplementation<SearFormulaBar>

Optional formula input surface supplied by the host.

propertykeyboardRouter
keyboardRouter: InjectableImplementation<KeyboardRouter>
propertyplatform
platform: InjectableImplementation<Platform>
propertypointerCapture
pointerCapture: InjectableImplementation<PointerCapture>
propertyscroller
scroller: InjectableImplementation<Scroller & { getPublisher: unknown }>
propertytextInput
textInput: InjectableImplementation<TextInput>
propertytoolbar
toolbar: InjectableImplementation<SearToolbar>
propertyuserInteraction
userInteraction?: InjectableImplementation<UserInteractionService>

Host-owned service for decisions that require a user response.

propertywebServiceClient
webServiceClient?: InjectableImplementation<WebServiceClient>

Asynchronous web-service transport used by host-managed formula caches.

propertyxmlXPathEvaluator
xmlXPathEvaluator?: InjectableImplementation<XmlXPathEvaluator>

XML/XPath evaluator used by XML-backed formula plugins.

methodcreateFunctionRegistry
createFunctionRegistry(): IFunctionRegistry

Creates the function catalog owned by this editor or its parent workbook.

methodcreateRenderContexts
createRenderContexts(): { hitRenderContext: RenderContext; offScreenRenderContext: RenderContext; renderContext: RenderContext }
methodcreateTextShaper
createTextShaper(renderContext: RenderContext): TextShaper

Creates an editor-local text shaper; omission uses render-context measurements.

renderContext: RenderContext
methodregisterEnvironment
registerEnvironment(container: Container): void
container: Container
interfaceSheetEditorConfigurationsource ↗
interface SheetEditorConfiguration

Public contract for SheetEditorConfiguration.

propertyadapters
adapters: SheetEditorAdapters
propertycellFontFamily
cellFontFamily?: string

Default font family and fallback list used by ordinary Sheet cells.

propertycellFontSize
cellFontSize?: number

Default font size used by ordinary Sheet cells.

propertyembeddedEditor
embeddedEditor?: SheetEmbeddedEditor

Optional editor used to render and edit rich text embedded in Sheet cells.

propertyplugins
plugins?: SheetEditorPluginImplementation[]
propertysessionState
sessionState?: Readonly<Record<string, unknown>>

Optional editor-local state restored when remounting a workbook sheet.

propertysheetState
sheetState: SheetDocumentState
propertyviewport
viewport?: { height: number; width: number }
methodonCreated
onCreated(editor: SheetEditor): void
editor: SheetEditor
interfaceSheetPluginImplementationsource ↗
interface SheetPluginImplementation<TPlugin>

Injectable SheetPlugin class accepted by createSheetEditor().

constructorconstructor
SheetPluginImplementation(...args: never[]): TPlugin
args: never[]
propertysymbol
readonly symbol: symbol
methodregisterServices
registerServices(context: SheetPluginServiceContext): void
context: SheetPluginServiceContext
interfaceSheetPluginRuntimesource ↗
interface SheetPluginRuntime extends SheetPluginSetupRuntime

Runtime capabilities available after the command bus is bound and Core exists.

propertycellsinherited
readonly cells: { catalog: CellTypeCatalog }
propertycollaborationinherited
readonly collaboration: { session: Pick<CollaborationSession, "getStatus"> }
propertycommands
readonly commands: SheetCommandBus
propertyconfiginherited
readonly config: ConfigEngine
propertydatainherited
readonly data: SheetDataEngine
propertyembeddedEditorinherited
readonly embeddedEditor?: { editor: SheetEmbeddedEditor }

Optional Sheet-facing rich-text editor supplied by the host.

propertyeventsinherited
readonly events: { engine: EventEngine<CellProperties>; registrar: EventRegistrar }
propertyextensionsinherited
readonly extensions: SheetRuntimeExtensionRegistry
propertyformulainherited
readonly formula: { externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; results: FormulaResultProviderRegistry; richResults: FormulaRichResultProviderRegistry; sources: FormulaSourceProviderRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }
propertyinputinherited
readonly input: { cursor: CursorEngine; cursorRules: CursorRegistry; keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }
propertyinteractioninherited
readonly interaction: { pipelineSteps: PipelineStepExecutorRegistry; reducers: SheetInteractionReducerRegistry; store: SheetInteractionStore }
propertylifecycleinherited
readonly lifecycle: SheetLifecycleCoordinator
propertyobservationsinherited
readonly observations: ObservationRegistry
propertyplatforminherited
readonly platform: Platform
propertypluginsinherited
readonly plugins: PluginManager<SearCoreSheet, CellProperties>
propertyqueriesinherited
readonly queries: SheetQueryRegistry
propertyrenderinherited
readonly render: { cellVisualReaders: SheetCellVisualReaderRegistry; contexts: { hit: RenderContext; main: RenderContext; offScreen: RenderContext }; coordinator: SheetRenderCoordinatorManager; dirtyTracker: GenerationalDirtyTracker; dirtyTree: Tree<PositionRect<templateLiteral>>; engine: SheetRenderEngine; rendererRegistry: SheetRendererRegistry<CellProperties>; stage: SceneGraph<CellProperties>; … }
propertyscrollinherited
readonly scroll: { coordinates: CoordinateEngine; manager: ScrollManager; scroller: Scroller; transformer: CoordinateTransformer }
propertysessioninherited
readonly session: SessionStateRegistry

Editor-local capture and restore registry shared by every session-state owner.

propertytextShaperinherited
readonly textShaper: TextShaper
propertytoolbar
readonly toolbar: SearToolbar
interfaceSheetPluginRuntimeContextsource ↗
interface SheetPluginRuntimeContext extends SheetPluginSetupContext

Sheet setup capabilities plus the Core created by createSheetEditor().

propertycontainerinherited
readonly container: Container
propertycore
readonly core: SearCoreSheet
propertyruntime
readonly runtime: SheetPluginRuntime
methodaddStrategyinherited
addStrategy(token: symbol, strategy: RenderStrategy<CellProperties>, position: { before: symbol } | { after: symbol }): void
token: symbol
strategy: RenderStrategy<CellProperties>
position: { before: symbol } | { after: symbol }
interfaceSheetPluginServiceContextsource ↗
interface SheetPluginServiceContext

Services available while createSheetEditor() registers Sheet plugins.

propertycontainer
readonly container: Container
interfaceSheetPluginSetupContextsource ↗
interface SheetPluginSetupContext

Typed public services available before createSheetEditor() creates its Core.

propertycontainer
readonly container: Container
propertyruntime
readonly runtime: SheetPluginSetupRuntime
methodaddStrategy
addStrategy(token: symbol, strategy: RenderStrategy<CellProperties>, position: { before: symbol } | { after: symbol }): void
token: symbol
strategy: RenderStrategy<CellProperties>
position: { before: symbol } | { after: symbol }
interfaceSheetPluginSetupRuntimesource ↗
interface SheetPluginSetupRuntime

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.

propertycells
readonly cells: { catalog: CellTypeCatalog }
propertycollaboration
readonly collaboration: { session: Pick<CollaborationSession, "getStatus"> }
propertyconfig
readonly config: ConfigEngine
propertydata
readonly data: SheetDataEngine
propertyembeddedEditor
readonly embeddedEditor?: { editor: SheetEmbeddedEditor }

Optional Sheet-facing rich-text editor supplied by the host.

propertyevents
readonly events: { engine: EventEngine<CellProperties>; registrar: EventRegistrar }
propertyextensions
readonly extensions: SheetRuntimeExtensionRegistry
propertyformula
readonly formula: { externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; results: FormulaResultProviderRegistry; richResults: FormulaRichResultProviderRegistry; sources: FormulaSourceProviderRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }
propertyinput
readonly input: { cursor: CursorEngine; cursorRules: CursorRegistry; keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }
propertyinteraction
readonly interaction: { pipelineSteps: PipelineStepExecutorRegistry; reducers: SheetInteractionReducerRegistry; store: SheetInteractionStore }
propertylifecycle
readonly lifecycle: SheetLifecycleCoordinator
propertyobservations
readonly observations: ObservationRegistry
propertyplatform
readonly platform: Platform
propertyplugins
readonly plugins: PluginManager<SearCoreSheet, CellProperties>
propertyqueries
readonly queries: SheetQueryRegistry
propertyrender
readonly render: { cellVisualReaders: SheetCellVisualReaderRegistry; contexts: { hit: RenderContext; main: RenderContext; offScreen: RenderContext }; coordinator: SheetRenderCoordinatorManager; dirtyTracker: GenerationalDirtyTracker; dirtyTree: Tree<PositionRect<templateLiteral>>; engine: SheetRenderEngine; rendererRegistry: SheetRendererRegistry<CellProperties>; stage: SceneGraph<CellProperties>; … }
propertyscroll
readonly scroll: { coordinates: CoordinateEngine; manager: ScrollManager; scroller: Scroller; transformer: CoordinateTransformer }
propertysession
readonly session: SessionStateRegistry

Editor-local capture and restore registry shared by every session-state owner.

propertytextShaper
readonly textShaper: TextShaper
interfaceSheetScrollToInputsource ↗
interface SheetScrollToInput

Public programmatic input for an absolute world-space viewport position.

propertyx
readonly x: number
propertyy
readonly y: number
interfaceSheetViewportSessionStatesource ↗
interface SheetViewportSessionState

Local viewport position retained while remounting one workbook sheet.

propertyx
readonly x: number
propertyy
readonly y: number
typeDocInlineStyleStatesource ↗
type DocInlineStyleState = Readonly<Record<string, DocInlineStyleStatus>>

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

typeDocSessionStatesource ↗
type DocSessionState = SessionStateSnapshot

Opaque in-memory contributor snapshot retained while remounting a document editor.

typeDocViewportScrollInputsource ↗
type DocViewportScrollInput = ScrollManagerState

Internal adapter input for one platform-originated document scroll state update.

typeDocVirtualLayoutSummaryListenersource ↗
type DocVirtualLayoutSummaryListener = (summary: DocVirtualLayoutSummary): void
typeSheetRuntimeCapabilityReadersource ↗
type SheetRuntimeCapabilityReader = RuntimeCapabilityReader

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

typeSheetRuntimeCapabilityTokensource ↗
type SheetRuntimeCapabilityToken = RuntimeCapability<T>

Typed extension capability exposed through the sheet runtime facade.

typeSheetScrollInputsource ↗
type SheetScrollInput = ScrollManagerState

Internal adapter input for one platform-originated scroll state update.

typeSheetSessionStatesource ↗
type SheetSessionState = SessionStateSnapshot

Opaque, in-memory contributor snapshot retained per sheet while a workbook editor is open.

variableApplyDocViewportScrollCommandsource ↗
ApplyDocViewportScrollCommand: DocCommandDefinition<ScrollManagerState, DocCommandResult>

Applies one platform-originated document scroll update.

variableApplyViewportScrollCommandsource ↗
ApplyViewportScrollCommand: SheetCommandDefinition<ScrollManagerState, SheetCommandResult>
variableCaptureDocSessionStateCommandsource ↗
CaptureDocSessionStateCommand: DocCommandDefinition<void, CaptureDocSessionStateCommandResult>

Captures every registered local document session contributor.

variableCaptureSheetSessionStateCommandsource ↗
CaptureSheetSessionStateCommand: SheetCommandDefinition<void, CaptureSheetSessionStateCommandResult>

Captures local state that must survive switching away from one workbook sheet.

variableDefaultDocFeaturePluginssource ↗
DefaultDocFeaturePlugins: readonly [typeof ParagraphPlugin, typeof CompositionPlugin, typeof TextInputPlugin, typeof SelectionPlugin, typeof CaretPlugin, typeof DocContentRenderPlugin, typeof RichTextLineBoxPlugin, typeof FontFamilyTextStylePlugin, typeof FontSizeTextStylePlugin, typeof BoldTextStylePlugin, typeof ItalicTextStylePlugin, typeof UnderlineTextStylePlugin, typeof StrikethroughTextStylePlugin, typeof TextColorStylePlugin, typeof TablePlugin, typeof HistoryPlugin]

Default feature plugins installed by createDocEditor unless overridden.

variableDocDocumentObservationsource ↗
DocDocumentObservation: StateObservationDefinition<DocEditorChange>

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

variableDocHistorySessionStateDefinitionsource ↗
DocHistorySessionStateDefinition: SessionStateDefinition<DocHistorySessionState>

Stable session-state identity owned by document history.

variableDocHistoryStatusObservationsource ↗
DocHistoryStatusObservation: StateObservationDefinition<DocHistoryStatus>

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

variableDocInlineStyleObservationsource ↗
DocInlineStyleObservation: StateObservationDefinition<Readonly<Record<string, DocInlineStyleStatus>>>

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

variableDocSelectionObservationsource ↗
DocSelectionObservation: StateObservationDefinition<DocSelection>

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

variableDocSelectionSessionStateDefinitionsource ↗
DocSelectionSessionStateDefinition: SessionStateDefinition<DocSelection>

Stable identity for local document selection retained during remounts.

variableDocViewportObservationsource ↗
DocViewportObservation: StateObservationDefinition<DocViewportSessionState>

Current document viewport position exposed to hosts and plugins.

variableDocViewportSessionStateDefinitionsource ↗
DocViewportSessionStateDefinition: SessionStateDefinition<DocViewportSessionState>

Stable session-state identity owned by the document viewport assembly.

variableExportDocStateCommandsource ↗
ExportDocStateCommand: DocCommandDefinition<void, ExportDocStateCommandResult>

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

variableExportSheetStateCommandsource ↗
ExportSheetStateCommand: SheetCommandDefinition<void, ExportSheetStateCommandResult>

Host command that exports a cloned state snapshot for the active SheetEditor.

variableRedoDocCommandsource ↗
RedoDocCommand: DocCommandDefinition<void, DocCommandResult>

Re-applies the most recently undone document mutation.

variableRenderDocViewportCommandsource ↗
RenderDocViewportCommand: DocCommandDefinition<void, DocCommandResult>

Renders the document viewport after the committed scroll state changes.

variableResizeDocViewportCommandsource ↗
ResizeDocViewportCommand: DocCommandDefinition<DocEditorViewport, DocCommandResult>

Resizes the standalone document viewport.

variableResizeSheetViewportCommandsource ↗
ResizeSheetViewportCommand: SheetCommandDefinition<{ height: number; width: number }, SheetCommandResult>
variableScrollDocViewportToCommandsource ↗
ScrollDocViewportToCommand: DocCommandDefinition<DocViewportSessionState, DocCommandResult>

Scrolls the standalone document viewport to an absolute world position.

variableScrollViewportToCommandsource ↗
ScrollViewportToCommand: SheetCommandDefinition<SheetScrollToInput, SheetCommandResult>
variableSheetRuntimeCapabilitysource ↗
SheetRuntimeCapability: { Cells: SheetRuntimeCapability<{ catalog: CellTypeCatalog }>; Collaboration: SheetRuntimeCapability<{ session: Pick<CollaborationSession, "getStatus"> }>; Commands: SheetRuntimeCapability<SheetCommandBus>; Config: SheetRuntimeCapability<ConfigEngine<any>>; Data: SheetRuntimeCapability<SheetDataEngine>; EmbeddedEditor: SheetRuntimeCapability<{ editor: SheetEmbeddedEditor }>; Events: SheetRuntimeCapability<{ engine: EventEngine<CellProperties>; registrar: EventRegistrar }>; Formula: SheetRuntimeCapability<{ externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; results: FormulaResultProviderRegistry; richResults: FormulaRichResultProviderRegistry; sources: FormulaSourceProviderRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }>; … }
variableSheetViewportSessionStateDefinitionsource ↗
SheetViewportSessionStateDefinition: SessionStateDefinition<SheetViewportSessionState>

Stable session-state identity owned by the Sheet viewport assembly.

variableUndoDocCommandsource ↗
UndoDocCommand: DocCommandDefinition<void, DocCommandResult>

Reverts the most recent committed document mutation.

variableUnregisterSheetInputValidatorCommandsource ↗
UnregisterSheetInputValidatorCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one editor-local input validator through the Sheet command bus.

variableUpdateDocDefaultConfigCommandsource ↗
UpdateDocDefaultConfigCommand: DocCommandDefinition<EditorDefaultConfigOverrides<DocConfig>, DocCommandResult>

Updates editor-local Doc defaults without changing document state.

variableUpdateSheetDefaultConfigCommandsource ↗
UpdateSheetDefaultConfigCommand: SheetCommandDefinition<EditorDefaultConfigOverrides<SheetConfig>, SheetCommandResult>

Updates editor-local Sheet defaults without changing document state.

functioncloneSheetDocumentStatesource ↗
cloneSheetDocumentState(state: SheetDocumentState): SheetDocumentState

Takes ownership of an input Sheet snapshot without retaining caller-owned mutable values.

state: SheetDocumentState
functioncreateDefaultSheetDocumentStateExportRegistrysource ↗
createDefaultSheetDocumentStateExportRegistry(): DocumentStateCodecRegistry<SheetDocumentState>

Creates the default registry for built-in Sheet document-state modules.

functioncreateDocEditorsource ↗
createDocEditor(options: DocEditorConfiguration): DocEditor

Assembles a standalone rich-document editor from platform-neutral adapters and document content.

The editor owns its DI container, selected document plugins, rendering
services, input adapters, and lifecycle. Product chrome remains a host
concern and communicates with the editor through its public facade.

ReturnsA fully initialized rich-document editor facade.

Example
const editor = createDocEditor({ adapters, documentState });
editor.focus();
editor.destroy();
options: DocEditorConfiguration
Platform adapters, initial document state, plugins, and viewport configuration.
functioncreateEmptySheetDocumentStatesource ↗
createEmptySheetDocumentState(rowCount: number, columnCount: number): SheetDocumentState

Creates an empty Sheet document with matching dimensions for import adapters.

rowCount: number
columnCount: number
functioncreateRichTextRunRectsource ↗
createRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>

Creates a world-space rectangle for one rich-text line/run.

x: number
baselineY: number
width: number
height: number
fontAscent: number
functioncreateSheetEditorsource ↗
createSheetEditor(options: SheetEditorConfiguration): SheetEditor

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 capabilities, and must call destroy() when the session is
no longer mounted.

ReturnsA fully initialized Sheet editor facade.

Example
const editor = createSheetEditor({ adapters, sheetState, plugins });
await editor.commands.run(command, input);
editor.destroy();
options: SheetEditorConfiguration
Platform adapters, initial Sheet state, plugins, and runtime configuration.
functiondefineSheetRuntimeCapabilitysource ↗
defineSheetRuntimeCapability<T>(id: string): SheetRuntimeCapability<T>

Defines a typed runtime capability token.

ReturnsImmutable capability descriptor.

id: string
Stable capability id.
functiondeserializeSheetDocumentStatesource ↗
deserializeSheetDocumentState<TSheetState>(payload: unknown, registry?: DocumentStateCodecRegistry<TSheetState>, path?: string): TSheetState

Deserializes one Sheet document state through registered state-owner codecs.

payload: unknown
registry: DocumentStateCodecRegistry<TSheetState>
path: string
functionregisterDefaultDependenciessource ↗
registerDefaultDependencies(container: Container): void

Registers the small common runtime set into an explicit host container.

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

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

container: Container
manager: PluginManager<SearCoreDoc, NodeProperties>
implementations: false | readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined
functionregisterDocBaseServicessource ↗
registerDocBaseServices(container: Container, adapters: DocEditorAdapters, _viewport: DocEditorViewport, defaultConfigOverrides?: EditorDefaultConfigOverrides<DocConfig>): DocBaseServices

Registers document editor base services into the DI container.

container: Container
adapters: DocEditorAdapters
_viewport: DocEditorViewport
defaultConfigOverrides: EditorDefaultConfigOverrides<DocConfig>
functionregisterDocConfigCommandssource ↗
registerDocConfigCommands(commands: DocCommandBus, config: ConfigEngine<DocConfig>): void

Registers Doc configuration changes on the owning command bus.

commands: DocCommandBus
config: ConfigEngine<DocConfig>
functionregisterDocDocumentObservationsource ↗
registerDocDocumentObservation(observations: ObservationRegistry, document: DocDocumentSessionCoordinator): void

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

observations: ObservationRegistry
document: DocDocumentSessionCoordinator
functionregisterDocFeaturePluginssource ↗
registerDocFeaturePlugins(container: Container, manager: PluginManager<SearCoreDoc, NodeProperties>, implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]

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

container: Container
manager: PluginManager<SearCoreDoc, NodeProperties>
implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined
functionregisterDocInlineStyleObservationsource ↗
registerDocInlineStyleObservation(observations: ObservationRegistry, input: DocInputPlugin, inlineStyles: RichTextInlineStyleRegistry): void

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

observations: ObservationRegistry
input: DocInputPlugin
inlineStyles: RichTextInlineStyleRegistry
functionregisterDocRuntimesource ↗
registerDocRuntime(container: Container, adapters: DocEditorAdapters, viewport: DocEditorViewport): DocRuntime

Registers render, input, scroll, command, and plugin runtime services for Doc.

container: Container
adapters: DocEditorAdapters
viewport: DocEditorViewport
functionregisterDocSessionStateCommandssource ↗
registerDocSessionStateCommands(commands: DocCommandBus, session: SessionStateRegistry): void

Registers the in-memory document session capture command.

commands: DocCommandBus
session: SessionStateRegistry
functionregisterDocStateSnapshotCommandssource ↗
registerDocStateSnapshotCommands(commands: DocCommandBus, document: DocDocumentSessionCoordinator): void

Registers the document-owned state snapshot command.

commands: DocCommandBus
document: DocDocumentSessionCoordinator
functionregisterDocViewportCommandssource ↗
registerDocViewportCommands(input: { commands: DocCommandBus; renderCoordinator: DocRenderCoordinator; scrollManager: ScrollManager; viewportEnvironment: DocViewportEnvironment }): void

Registers viewport-owned document commands on the editor command bus.

input: { commands: DocCommandBus; renderCoordinator: DocRenderCoordinator; scrollManager: ScrollManager; viewportEnvironment: DocViewportEnvironment }
functionregisterDocViewportStatesource ↗
registerDocViewportState(session: SessionStateRegistry, observations: ObservationRegistry, scrollManager: ScrollManager): void

Registers viewport remount state and its host-facing observation.

session: SessionStateRegistry
observations: ObservationRegistry
scrollManager: ScrollManager
functionregisterSheetConfigCommandssource ↗
registerSheetConfigCommands(commands: SheetCommandBus, config: ConfigEngine<SheetConfig>): void

Registers Sheet configuration changes on the owning command bus.

commands: SheetCommandBus
config: ConfigEngine<SheetConfig>
functionregisterSheetPluginCapabilitiessource ↗
registerSheetPluginCapabilities(plugins: readonly unknown[], registry: SheetRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by Sheet plugins.

plugins: readonly unknown[]
registry: SheetRuntimeExtensionRegistry
functionregisterSheetPluginCellVisualReaderssource ↗
registerSheetPluginCellVisualReaders(plugins: readonly unknown[], registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): void

Registers every plugin-owned Sheet cell visual reader.

plugins: readonly unknown[]
registry: SheetCellVisualReaderRegistry
context: SheetCellVisualReaderRegistrationContext
functionregisterSheetPluginCommandssource ↗
registerSheetPluginCommands(plugins: readonly unknown[], commands: SheetCommandBus): void

Runs the register sheet plugin commands helper.

plugins: readonly unknown[]
commands: SheetCommandBus
functionregisterSheetPluginObservationssource ↗
registerSheetPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void

Registers every typed observation source contributed by Sheet plugins.

plugins: readonly unknown[]
observations: ObservationRegistry
functionregisterSheetPluginQueriessource ↗
registerSheetPluginQueries(plugins: readonly unknown[], queries: SheetQueryRegistry): void
plugins: readonly unknown[]
queries: SheetQueryRegistry
functionregisterSheetPluginSessionStatessource ↗
registerSheetPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): void

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

plugins: readonly unknown[]
registry: SessionStateRegistry
functionregisterSheetSessionStateCommandssource ↗
registerSheetSessionStateCommands(commands: SheetCommandBus, session: SessionStateRegistry): void

Registers the in-memory Sheet session capture command.

commands: SheetCommandBus
session: SessionStateRegistry
functionregisterSheetStateSnapshotCommandssource ↗
registerSheetStateSnapshotCommands(commands: SheetCommandBus, pluginManager: PluginManager<SearCoreSheet, CellProperties>): void

Registers sheet state snapshot commands for the default sheet assembly.

commands: SheetCommandBus
pluginManager: PluginManager<SearCoreSheet, CellProperties>
functionregisterSheetViewportCommandssource ↗
registerSheetViewportCommands(commands: SheetCommandBus, scrollManager: ScrollManager, resizeController: SheetViewportResizeController): void

Registers viewport-owned commands on the editor command bus.

commands: SheetCommandBus
scrollManager: ScrollManager
resizeController: SheetViewportResizeController
functionregisterSheetViewportSessionStatesource ↗
registerSheetViewportSessionState(registry: SessionStateRegistry, scrollManager: ScrollManager): void

Registers viewport-owned local remount state with the editor-local registry.

registry: SessionStateRegistry
scrollManager: ScrollManager
functionserializeSheetDocumentStatesource ↗
serializeSheetDocumentState<TSheetState>(sheetState: TSheetState, registry?: DocumentStateCodecRegistry<TSheetState>): SearSheetDocumentFile

Serializes one Sheet document state through registered state-owner codecs.

sheetState: TSheetState
registry: DocumentStateCodecRegistry<TSheetState>
enumBoldTextStyleKeysource ↗
enum BoldTextStyleKey

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

enum memberBold
Bold: "bold"
classBoldTextStylePluginsource ↗
class BoldTextStylePlugin extends InlineTextStylePluginBase

Contributes bold rendering and bold document commands.

constructorconstructor
BoldTextStylePlugin(): BoldTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving BoldTextStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
variableClearDocCompositionCommandsource ↗
ClearDocCompositionCommand: DocCommandDefinition<void, DocCommandResult>

Clears the active IME composition preview text.

functiondefineDocRuntimeCapabilitysource ↗
defineDocRuntimeCapability<T>(id: string): DocRuntimeCapability<T>

Creates a typed document runtime capability token.

id: string
functiondefineSessionStatesource ↗
defineSessionState<State>(id: string): SessionStateDefinition<State>

Creates an immutable typed identity for one local session value.

id: string
variableDeleteDocBackwardCommandsource ↗
DeleteDocBackwardCommand: DocCommandDefinition<void, DocCommandResult>

Deletes content before the current document selection.

variableDocCaretPluginKeysource ↗
DocCaretPluginKey: PluginKey
variableDocCompositionPluginKeysource ↗
DocCompositionPluginKey: PluginKey
variableDocContentRenderPluginKeysource ↗
DocContentRenderPluginKey: PluginKey

Default document feature plugin keys used by command pipelines.

interfaceDocInteractionRuntimesource ↗
interface DocInteractionRuntime

View services exposed to document interaction plugins.

methodgetContentRect
getContentRect(): DocInteractionContentRect
methodgetRoot
getRoot(): unknown
methodgetViewport
getViewport(): DocInteractionViewport
methodreadRootViewOffset
readRootViewOffset(): { x: number; y: number }
methodresolveCursorFromPointer
resolveCursorFromPointer(input: DocPointerInput): DocCursorPos
input: DocPointerInput
methodsubscribePointerDrag
subscribePointerDrag(handlers: DocPointerDragHandlers): (): void
handlers: DocPointerDragHandlers
classDocPluginsource ↗
class DocPlugin<StateType> extends Plugin<SearCoreDoc, NodeProperties, StateType>, PluginExtension<DocCommandBus, ObservationRegistry, SessionStateRegistry, DocRuntimeExtensionRegistry>

Convenience base class for a Plugin targeting createDocEditor().

constructorconstructor
DocPlugin<StateType>(__namedParameters: PluginSpec<StateType>): DocPlugin<StateType>

Creates a plugin with its stable identity and initial state.

__namedParameters: PluginSpec<StateType>
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<StateType, object> | readonly PluginDocumentStateContribution<StateType, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

memberkeyinherited
key: unknown
methodapplyinherited
apply(pluginState: StateType, transaction: Transaction): StateType | null

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

pluginState: StateType
transaction: Transaction
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(searCore: SearCoreDoc): unknown

Returns this plugin's runtime configuration view for the current core.

searCore: SearCoreDoc
methodgetStateinherited
getState(): StateType

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: StateType): void

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

state: StateType
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(context: DocPluginRuntimeContext): void

Releases resources owned by this plugin before the Core is destroyed.

context: DocPluginRuntimeContext
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: StateType, 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.

state: StateType
transaction: Transaction
methodregisterBlockFlows
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilities
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderers
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStyles
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): PluginStateRegistration<unknown>[] | PluginStateRegistration<StateType>

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

methodrenderinherited
render(searCore: SearCoreDoc, offset?: { x: number; y: number }): Node<NodeProperties> | Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

searCore: SearCoreDoc
offset: { x: number; y: number }
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: StateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: StateType
commitToken: object
methodstart
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
interfaceDocPluginImplementationsource ↗
interface DocPluginImplementation<TPlugin>

Injectable DocPlugin class accepted by createDocEditor().

constructorconstructor
DocPluginImplementation(...args: never[]): TPlugin
args: never[]
propertysymbol
readonly symbol: symbol
methodregisterServices
registerServices(context: DocPluginServiceContext): void
context: DocPluginServiceContext
interfaceDocPluginRuntimesource ↗
interface DocPluginRuntime

Stable host capabilities supplied to a DocPlugin after editor assembly.

propertycommands
readonly commands: DocCommandBus

Command bus exposed by the document editor instance.

propertydocument
readonly document: { blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }

Rich-document domain services.

propertyevents
readonly events: { engine: EventEngine<NodeProperties>; registrar: EventRegistrar }

Event and hit-test services used by document interactions.

propertyextensions
readonly extensions: DocRuntimeExtensionRegistry

Extension capability registry for third-party document plugins.

propertyinput
readonly input: { keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }

Host input adapters used by document editing commands.

propertyobservations
readonly observations: ObservationRegistry

Typed state and event observations owned by this editor instance.

propertyplatform
readonly platform: Platform

Platform adapter for timers, resize observation, and diagnostics.

propertyplugins
readonly plugins: PluginManager<SearCoreDoc, NodeProperties>

Ordered document plugin registry for this editor.

propertyrender
readonly render: { context: RenderContext; engine: DocRenderEngineCapability }

Document render services and visible context.

propertyscroll
readonly scroll: { manager: ScrollManager }

Scroll state shared by document layout and rendering.

propertysession
readonly session: SessionStateRegistry

Local remount state contributed by built-in and third-party plugins.

propertytextShaper
readonly textShaper: TextShaper

Text shaper used by document layout and rendering.

variableDocPluginRuntimeCapabilitysource ↗
DocPluginRuntimeCapability: { CaretState: DocRuntimeCapability<DocCaretStateCapability>; Composition: DocRuntimeCapability<DocCompositionManager>; InputBindings: DocRuntimeCapability<DocInputBindingRegistryCapability>; Interaction: DocRuntimeCapability<DocInteractionRuntime> }

Runtime extension tokens owned by document plugins assembled by editor composition roots.

interfaceDocPluginRuntimeContextsource ↗
interface DocPluginRuntimeContext extends DocPluginSetupContext

Document setup capabilities plus the Core created by createDocEditor().

propertycontainerinherited
readonly container: Container

DI container used by the document assembly root.

propertycore
readonly core: SearCoreDoc

Core document runtime.

propertyruntimeinherited
readonly runtime: DocPluginRuntime

Runtime services available to document plugins.

interfaceDocPluginServiceContextsource ↗
interface DocPluginServiceContext

Services available while createDocEditor() registers document plugins.

propertycontainer
readonly container: Container

DI container used by the document assembly root.

interfaceDocPluginSetupContextsource ↗
interface DocPluginSetupContext

Typed public services available before createDocEditor() starts Core.

propertycontainer
readonly container: Container

DI container used by the document assembly root.

propertyruntime
readonly runtime: DocPluginRuntime

Runtime services available to document plugins.

variableDocRuntimeCapabilitysource ↗
DocRuntimeCapability: { BlockFlows: DocRuntimeCapability<RichTextBlockFlowRegistry>; Commands: DocRuntimeCapability<DocCommandBus>; Config: DocRuntimeCapability<ConfigEngine<any>>; Document: DocRuntimeCapability<{ blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }>; Events: DocRuntimeCapability<{ engine: EventEngine<NodeProperties>; registrar: EventRegistrar }>; InlineStyles: DocRuntimeCapability<RichTextInlineStyleRegistry>; Input: DocRuntimeCapability<{ keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }>; LayoutService: DocRuntimeCapability<DocRenderLayoutServiceCapability>; … }

Document runtime capabilities registered by the default assembly root.

typeDocRuntimeCapabilityReadersource ↗
type DocRuntimeCapabilityReader = RuntimeCapabilityReader

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

variableDocRuntimeCapabilityTokensource ↗
DocRuntimeCapabilityToken: { BlockFlows: DocRuntimeCapability<RichTextBlockFlowRegistry>; Commands: DocRuntimeCapability<DocCommandBus>; Config: DocRuntimeCapability<ConfigEngine<any>>; Document: DocRuntimeCapability<{ blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }>; Events: DocRuntimeCapability<{ engine: EventEngine<NodeProperties>; registrar: EventRegistrar }>; InlineStyles: DocRuntimeCapability<RichTextInlineStyleRegistry>; Input: DocRuntimeCapability<{ keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }>; LayoutService: DocRuntimeCapability<DocRenderLayoutServiceCapability>; … }

Document runtime capabilities registered by the default assembly root.

classDocRuntimeExtensionRegistrysource ↗
class DocRuntimeExtensionRegistry extends RuntimeCapabilityRegistry

Registry of extension capabilities available to document plugins.

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

DI token for resolving the document runtime extension registry.

methoddestroyinherited
destroy(): void

Permanently closes the registry and releases all published values.

methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for capability changes after assembly.

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

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

capability: RuntimeCapability<T>
value: T
methodrequireinherited
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
interfaceDocVirtualLayoutSummarysource ↗
interface DocVirtualLayoutSummary

Public virtual layout summary exposed through the Doc layout-service capability.

propertyblockRender
readonly blockRender?: DocBlockRenderDebugSnapshot
propertycacheHits
readonly cacheHits: number
propertycacheMisses
readonly cacheMisses: number
propertycursorBlock
readonly cursorBlock: number | null
propertydocumentHeight
readonly documentHeight: number
propertyheightIndexUpdated
readonly heightIndexUpdated: boolean
propertyinitialLoadMs
readonly initialLoadMs?: number
propertymaterializedBlocks
readonly materializedBlocks: number
propertymaterializedIndexes
readonly materializedIndexes: string
propertymodel
readonly model: "reused" | "rebuilt"
propertyrangeEnd
readonly rangeEnd: number
propertyrangeStart
readonly rangeStart: number
propertyrenderPhase
readonly renderPhase?: DocVirtualLayoutRenderPhase
propertytimings
readonly timings: DocVirtualLayoutTimingSummary
propertytotalBlocks
readonly totalBlocks: number
variableFocusDocCommandsource ↗
FocusDocCommand: DocCommandDefinition<void, DocCommandResult>

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

enumFontFamilyTextStyleKeysource ↗
enum FontFamilyTextStyleKey

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

enum memberFontFamily
FontFamily: "fontFamily"
classFontFamilyTextStylePluginsource ↗
class FontFamilyTextStylePlugin extends InlineTextStylePluginBase

Contributes font-family rendering and the set-font-family document command.

constructorconstructor
FontFamilyTextStylePlugin(): FontFamilyTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FontFamilyTextStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
enumFontSizeTextStyleKeysource ↗
enum FontSizeTextStyleKey

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

enum memberFontSize
FontSize: "fontSize"
classFontSizeTextStylePluginsource ↗
class FontSizeTextStylePlugin extends InlineTextStylePluginBase

Contributes font-size rendering and the set-font-size document command.

constructorconstructor
FontSizeTextStylePlugin(): FontSizeTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FontSizeTextStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
variableInsertDocTableCommandsource ↗
InsertDocTableCommand: DocCommandDefinition<InsertDocTableInput, DocCommandResult>

Inserts a table block at the current document position.

interfaceInsertDocTableInputsource ↗
interface InsertDocTableInput

Input accepted by InsertDocTableCommand.

propertycolumns
readonly columns: number

Number of columns in the inserted table.

propertyrows
readonly rows: number

Number of rows in the inserted table.

variableInsertDocTextCommandsource ↗
InsertDocTextCommand: DocCommandDefinition<InsertDocTextInput, DocCommandResult>

Inserts text at the current document selection.

interfaceInsertDocTextInputsource ↗
interface InsertDocTextInput

Input accepted by InsertDocTextCommand.

propertytext
readonly text: string

Text to insert at the current document selection.

enumItalicTextStyleKeysource ↗
enum ItalicTextStyleKey
enum memberItalic
Italic: "italic"
classItalicTextStylePluginsource ↗
class ItalicTextStylePlugin extends InlineTextStylePluginBase

Contributes italic rendering, mutation, and keyboard commands.

constructorconstructor
ItalicTextStylePlugin(): ItalicTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
variableLoadDocumentCommandsource ↗
LoadDocumentCommand: DocCommandDefinition<LoadDocumentInput, DocCommandResult>

Replaces the active document content.

interfaceLoadDocumentInputsource ↗
interface LoadDocumentInput

Input accepted by LoadDocumentCommand.

propertydocument
readonly document: RichDocNode[]

Rich-document content to load into the document editor.

variableMoveDocCursorCommandsource ↗
MoveDocCursorCommand: DocCommandDefinition<MoveDocCursorInput, DocCommandResult>

Moves the current document cursor.

interfaceMoveDocCursorInputsource ↗
interface MoveDocCursorInput

Input accepted by MoveDocCursorCommand.

propertydirection
readonly direction: DocCursorDirection

Direction for cursor movement.

propertyshiftKey
readonly shiftKey?: boolean

Whether the movement should extend the current selection.

classParagraphPluginsource ↗
class ParagraphPlugin extends DocPlugin<null>

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

constructorconstructor
ParagraphPlugin(): ParagraphPlugin

Creates a ParagraphPlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving ParagraphPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlows
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers paragraph node model support owned by this plugin.

context: DocPluginServiceContext
functionreadSessionStatesource ↗
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefined

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

snapshot: SessionStateSnapshot
definition: SessionStateDefinition<State>
functionregisterDocPluginCapabilitiessource ↗
registerDocPluginCapabilities(plugins: readonly unknown[], registry: DocRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by document plugins.

plugins: readonly unknown[]
registry: DocRuntimeExtensionRegistry
functionregisterDocPluginCommandssource ↗
registerDocPluginCommands(plugins: readonly unknown[], commands: DocCommandBus): (): void

Runs the register document plugin commands helper.

plugins: readonly unknown[]
commands: DocCommandBus
functionregisterDocPluginInlineStylessource ↗
registerDocPluginInlineStyles(plugins: readonly unknown[], registry: RichTextInlineStyleRegistry): (): void

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

plugins: readonly unknown[]
registry: RichTextInlineStyleRegistry
functionregisterDocPluginLineBoxessource ↗
registerDocPluginLineBoxes(plugins: readonly unknown[], registry: RichTextLineBoxRegistry): (): void

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

plugins: readonly unknown[]
registry: RichTextLineBoxRegistry
functionregisterDocPluginObservationssource ↗
registerDocPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void

Registers every typed observation source contributed by document plugins.

plugins: readonly unknown[]
observations: ObservationRegistry
functionregisterDocPluginSessionStatessource ↗
registerDocPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): void

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

plugins: readonly unknown[]
registry: SessionStateRegistry
variableRenderDocCommandsource ↗
RenderDocCommand: DocCommandDefinition<void, DocCommandResult>

Requests a document render without changing content.

typeRichTextInlineStylesource ↗
type RichTextInlineStyle = Readonly<Record<string, unknown>>

Domain-neutral inline style bag carried by measured rich-text chars.

classRichTextLineBoxPluginsource ↗
class RichTextLineBoxPlugin extends DocPlugin<null>

Registers rich-text line box resolution for document layout.

constructorconstructor
RichTextLineBoxPlugin(): RichTextLineBoxPlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving RichTextLineBoxPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(context: DocPluginRuntimeContext): void

Releases resources owned by this plugin before the Core is destroyed.

context: DocPluginRuntimeContext
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
variableSelectAllDocCommandsource ↗
SelectAllDocCommand: DocCommandDefinition<void, DocCommandResult>

Selects all document content.

interfaceSessionStateAdaptersource ↗
interface SessionStateAdapter<State>

Captures and restores one detached local session value.

propertyrestoreAfter
readonly restoreAfter?: readonly SessionStateDefinition<unknown>[]

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

propertyrestorePhase
readonly restorePhase: SessionStateRestorePhase

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

methodcapture
capture(): State | undefined

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

methodrestore
restore(state: State): void

Restores local state during the declared lifecycle phase.

state: State
interfaceSessionStateDefinitionsource ↗
interface SessionStateDefinition<State>

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

propertyid
readonly id: string

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

propertystateType
readonly stateType?: State

Compile-time state carrier; never populated at runtime.

classSessionStateErrorsource ↗
class SessionStateError extends SearError

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

constructorconstructor
SessionStateError(code: SessionStateErrorCode, message: string, details?: SearErrorDetails): SessionStateError

Creates a session-state contract error.

code: SessionStateErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: SessionStateErrorCode

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
variableSessionStateErrorCodesource ↗
SessionStateErrorCode: { invalidDefinition: "SEAR_SESSION_STATE_INVALID_DEFINITION"; invalidRestoreDependency: "SEAR_SESSION_STATE_INVALID_RESTORE_DEPENDENCY"; invalidRestoreOrder: "SEAR_SESSION_STATE_INVALID_RESTORE_ORDER"; invalidRestorePhase: "SEAR_SESSION_STATE_INVALID_RESTORE_PHASE"; registrationConflict: "SEAR_SESSION_STATE_REGISTRATION_CONFLICT"; restoreDependencyCycle: "SEAR_SESSION_STATE_RESTORE_DEPENDENCY_CYCLE"; restoreInProgress: "SEAR_SESSION_STATE_RESTORE_IN_PROGRESS"; restorePhaseClosed: "SEAR_SESSION_STATE_RESTORE_PHASE_CLOSED"; … }

Stable machine-readable errors raised by session-state contracts.

classSessionStateRegistrysource ↗
class SessionStateRegistry

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

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

DI token for resolving the editor-local registry.

methodassertRestorationOpen
assertRestorationOpen(): void

Rejects a retained contributor restore callback after editor initialization.

methodcapture
capture(): SessionStateSnapshot

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

methodclear
clear(lifecycleToken?: object): void

Clears contributors and retained state owned by this registry instance.

lifecycleToken: object
methodgetCompletedRestorePhases
getCompletedRestorePhases(): readonly SessionStateRestorePhase[]

Returns restore phases already completed by this editor lifecycle.

methodgetRegisteredStateIds
getRegisteredStateIds(): readonly string[]

Returns sorted ids for currently registered contributors.

methodloadSnapshot
loadSnapshot(snapshot: SessionStateSnapshot): void

Loads a complete snapshot before lifecycle restoration begins.

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

Registers one state owner and returns an idempotent disposer.

definition: SessionStateDefinition<State>
adapter: SessionStateAdapter<State>
methodrestorePhase
restorePhase(phase: SessionStateRestorePhase): void

Restores every registered contributor assigned to one ordered lifecycle phase.

phase: SessionStateRestorePhase
methodsealRestoration
sealRestoration(lifecycleToken: object): void

Closes initialization-only restore operations for an assembled editor.

lifecycleToken: object
variableSessionStateRestorePhasesource ↗
SessionStateRestorePhase: { AfterInitialize: "afterInitialize"; BeforeInitialize: "beforeInitialize" }

Ordered lifecycle phases in which local state may be restored.

typeSessionStateSnapshotsource ↗
type SessionStateSnapshot = Readonly<Record<string, unknown>>

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

variableSetDocBoldCommandsource ↗
SetDocBoldCommand: DocCommandDefinition<SetDocBoldInput, DocCommandResult>

Sets whether the selected document text is bold.

interfaceSetDocBoldInputsource ↗
interface SetDocBoldInput

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

propertybold
readonly bold: boolean | null
variableSetDocCompositionCommandsource ↗
SetDocCompositionCommand: DocCommandDefinition<SetDocCompositionInput, DocCommandResult>

Sets the active IME composition preview text.

interfaceSetDocCompositionInputsource ↗
interface SetDocCompositionInput

Input accepted by SetDocCompositionCommand.

propertycaretOffset
readonly caretOffset: number

Caret offset inside the composing text.

propertytext
readonly text: string

Current composing text emitted by the host input method.

variableSetDocFontFamilyCommandsource ↗
SetDocFontFamilyCommand: DocCommandDefinition<SetDocFontFamilyInput, DocCommandResult>

Sets the font family on the selected document text.

interfaceSetDocFontFamilyInputsource ↗
interface SetDocFontFamilyInput

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

propertyfontFamily
readonly fontFamily: string | null
variableSetDocFontSizeCommandsource ↗
SetDocFontSizeCommand: DocCommandDefinition<SetDocFontSizeInput, DocCommandResult>

Sets the font size in pixels on the selected document text.

interfaceSetDocFontSizeInputsource ↗
interface SetDocFontSizeInput

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

propertyfontSize
readonly fontSize: number | null
variableSetDocItalicCommandsource ↗
SetDocItalicCommand: DocCommandDefinition<SetDocItalicInput, DocCommandResult>
interfaceSetDocItalicInputsource ↗
interface SetDocItalicInput
propertyitalic
readonly italic: boolean | null
variableSetDocSelectionCommandsource ↗
SetDocSelectionCommand: DocCommandDefinition<SetDocSelectionInput, DocCommandResult>

Sets the active document selection without changing content.

interfaceSetDocSelectionInputsource ↗
interface SetDocSelectionInput

Input accepted by SetDocSelectionCommand.

propertyselection
readonly selection: DocSelection

Selection to make active in the document editor.

variableSetDocStrikethroughCommandsource ↗
SetDocStrikethroughCommand: DocCommandDefinition<SetDocStrikethroughInput, DocCommandResult>
interfaceSetDocStrikethroughInputsource ↗
interface SetDocStrikethroughInput
propertystrikethrough
readonly strikethrough: boolean | null
variableSetDocTextColorCommandsource ↗
SetDocTextColorCommand: DocCommandDefinition<SetDocTextColorInput, DocCommandResult>

Sets the text color on the selected document text.

interfaceSetDocTextColorInputsource ↗
interface SetDocTextColorInput

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

propertycolor
readonly color: string | null
variableSetDocUnderlineCommandsource ↗
SetDocUnderlineCommand: DocCommandDefinition<SetDocUnderlineInput, DocCommandResult>
interfaceSetDocUnderlineInputsource ↗
interface SetDocUnderlineInput
propertyunderline
readonly underline: boolean | null
variableSplitDocParagraphCommandsource ↗
SplitDocParagraphCommand: DocCommandDefinition<void, DocCommandResult>

Splits the current paragraph at the current document selection.

enumStrikethroughTextStyleKeysource ↗
enum StrikethroughTextStyleKey
enum memberStrikethrough
Strikethrough: "strikethrough"
classStrikethroughTextStylePluginsource ↗
class StrikethroughTextStylePlugin extends InlineTextStylePluginBase

Contributes strikethrough rendering, mutation, and keyboard commands.

constructorconstructor
StrikethroughTextStylePlugin(): StrikethroughTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
classTablePluginsource ↗
class TablePlugin extends DocPlugin<null>

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

constructorconstructor
TablePlugin(): TablePlugin

Creates a TablePlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving TablePlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigure
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

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

methodrender
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstatic
registerServices(context: DocPluginServiceContext): void

Registers table node model support owned by this plugin.

context: DocPluginServiceContext
enumTextColorStyleKeysource ↗
enum TextColorStyleKey

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

enum memberColor
Color: "color"
classTextColorStylePluginsource ↗
class TextColorStylePlugin extends InlineTextStylePluginBase

Contributes text-color rendering and mutation for text nodes.

constructorconstructor
TextColorStylePlugin(): TextColorStylePlugin

Creates a TextColorStylePlugin instance.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving TextColorStylePlugin.

memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext
variableToggleDocBoldCommandsource ↗
ToggleDocBoldCommand: DocCommandDefinition<void, DocCommandResult>

Toggles bold on the selected document text.

variableToggleDocItalicCommandsource ↗
ToggleDocItalicCommand: DocCommandDefinition<void, DocCommandResult>
variableToggleDocStrikethroughCommandsource ↗
ToggleDocStrikethroughCommand: DocCommandDefinition<void, DocCommandResult>
variableToggleDocUnderlineCommandsource ↗
ToggleDocUnderlineCommand: DocCommandDefinition<void, DocCommandResult>
enumUnderlineTextStyleKeysource ↗
enum UnderlineTextStyleKey
enum memberUnderline
Underline: "underline"
classUnderlineTextStylePluginsource ↗
class UnderlineTextStylePlugin extends InlineTextStylePluginBase

Contributes underline rendering, mutation, and keyboard commands.

constructorconstructor
UnderlineTextStylePlugin(): UnderlineTextStylePlugin
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapplyinherited
apply(_state: null, _transaction: unknown): null

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

_state: null
_transaction: unknown
methodconfigureinherited
configure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

context: DocPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreDoc
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfiginherited
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: DocPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before runtime effects.

context: DocPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: null): void

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

state: null
methodonClickinherited
onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited
onEditorDestroy(): void

Releases resources owned by this plugin before the Core is destroyed.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): void

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

searCore: SearCoreDoc
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreDoc): void

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

searCore: SearCoreDoc
methodonMouseDowninherited
onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreDoc
event: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterBlockFlowsinherited
registerBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited
registerCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

registry: DocRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

Registers default configuration values owned by this plugin.

methodregisterInlineStyleRenderersinherited
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited
registerInlineStyles(registry: RichTextInlineStyleRegistry): void

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

registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

Registers keyboard-to-command bindings owned by this document plugin.

__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited
registerLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

registry: RichTextLineBoxRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

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

registry: SessionStateRegistry
methodregisterStateinherited
registerState(): { key: PluginKey; state: null }

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

methodrenderinherited
render(): Node<NodeProperties>[] | null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstartinherited
start(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

context: DocPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: DocPluginServiceContext): void

Registers bindings required before this Doc plugin is instantiated.

context: DocPluginServiceContext

Package

@searsuite/sear-assembly-test

11 exports

Reusable test platforms, render contexts, and editor fixtures for package consumers.

classRecordingRenderContextsource ↗
class RecordingRenderContext extends RenderContext

RenderContext implementation that records drawing calls without Canvas pixels.

constructorconstructor
RecordingRenderContext(): RecordingRenderContext
propertycalls
readonly calls: RenderCall[]

Recorded render calls captured by RecordingRenderContext.

propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for the primary visible render layer.

methodaddClickEventListener
addClickEventListener(callBack: (event: EventWithOffset): void): void

Adds the click event listener.

callBack: (event: EventWithOffset): void
methodaddEventListener
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Adds the event listener.

type: string
callBack: (event: EventWithOffset): void
methodaddMouseDownEventListener
addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Adds the mouse down event listener.

callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Adds the mouse move event listener.

callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener
addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Adds the mouse up event listener.

callBack: (event: EventWithOffset): void
methodaddResizeListener
addResizeListener(_callBack: (): void): void

Adds the resize listener.

_callBack: (): void
methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPath
beginPath(): void

Begins a recorded vector path.

methodclearRect
clearRect(x: number, y: number, width: number, height: number): void

Records a rectangular clear operation.

x: number
y: number
width: number
height: number
methodclip
clip(): void

Clips subsequent recorded operations to the current path.

methodcloneNode
cloneNode(): RenderContext

Creates an independent copy of a recorded render node.

methodclosePath
closePath(): void

Closes the current recorded vector path.

methodcreateHitNode
createHitNode(): RenderContext

Creates the hit node.

methoddrawImage
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

Records an image draw operation using the supplied source and bounds.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfill
fill(): void

Fills the current path or exposes the node fill paint, depending on the render contract.

methodfillText
fillText(text: string, x: number, y: number, maxWidth?: number): void

Records text painting at the supplied position.

text: string
x: number
y: number
maxWidth: number
methodgetAttribute
getAttribute(name: string): string

Returns the attribute.

name: string
methodgetImageData
getImageData(_x: number, _y: number, _width: number, _height: number): { data: [number, number, number, number][]; height: number; width: number }

Returns the image data.

_x: number
_y: number
_width: number
_height: number
methodgetLineWidth
getLineWidth(): number

Returns the line width.

methodgetMaxLineWidth
getMaxLineWidth(): number

Returns the max line width.

methodgetRasterScale
getRasterScale(): number

Returns the raster scale.

methodgetRenderTarget
getRenderTarget(): object

Returns the render target.

methodgetRoot
getRoot(): EventTarget

Returns the root.

methodgetViewScale
getViewScale(): number

Returns the view scale.

methodinitialize
initialize(_scale?: number): void

Initializes the recording context for a render target.

_scale: number
methodlineTo
lineTo(x: number, y: number): void

Adds a line segment to the current recorded path.

x: number
y: number
methodmeasureText
measureText(text: string): { fontAscent?: number; fontDescent?: number; height: number; width: number }

Measures text with the recording context's configured metrics.

text: string
methodmoveTo
moveTo(x: number, y: number): void

Moves the current recorded path without drawing a segment.

x: number
y: number
methodputImageData
putImageData(imageData: RenderImageData, x: number, y: number): void

Records raw pixel data at the supplied position.

imageData: RenderImageData
x: number
y: number
methodrect
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the current recorded path.

x: number
y: number
width: number
height: number
methodremoveClickEventListener
removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes the click event listener.

callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes the mouse down event listener.

callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes the mouse move event listener.

callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes the mouse up event listener.

callBack: (event: EventWithOffset): void
methodremoveResizeListener
removeResizeListener(): void

Removes the resize listener.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransform
resetTransform(): void

Restores the recorded transform to the identity matrix.

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

Resizes the render target and invalidates dependent frame state.

width: number
height: number
scale: number
methodrestore
restore(): void

Restores the most recently saved render state.

methodsave
save(): void

Pushes the current render state onto the recording stack.

methodsetAttribute
setAttribute(name: string, value: string): void

Updates the attribute.

name: string
value: string
methodsetFillStyle
setFillStyle(fillStyle: RenderPaint): void

Updates the fill style.

fillStyle: RenderPaint
methodsetFont
setFont(font: string): void

Updates the font.

font: string
methodsetLineDash
setLineDash(segments: number[]): void

Updates the line dash.

segments: number[]
methodsetLineWidth
setLineWidth(width: number): void

Updates the line width.

width: number
methodsetStrokeStyle
setStrokeStyle(strokeStyle: RenderPaint): void

Updates the stroke style.

strokeStyle: RenderPaint
methodsetTransform
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Updates the transform.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScale
setViewScale(scale: number): void

Updates the view scale.

scale: number
methodstroke
stroke(): void

Strokes the current recorded path.

methodstrokeRect
strokeRect(x: number, y: number, width: number, height: number): void

Records a stroked rectangle operation.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslate
translate(x: number, y: number): void

Offsets subsequent recorded operations by the supplied vector.

x: number
y: number
classTestPlatformsource ↗
class TestPlatform extends Platform

Deterministic Platform implementation for harnesses and integration tests.

constructorconstructor
TestPlatform(): TestPlatform
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Platform.

methodaddEventListener
addEventListener(_target: unknown, _type: string, _listener: (event: unknown): void): (): void

Registers a host event listener and returns an idempotent disposer.

_target: unknown
_type: string
_listener: (event: unknown): void
methodcancelAnimationFrame
cancelAnimationFrame(handle: number): void

Cancels a previously scheduled host animation frame.

handle: number
methodclearInterval
clearInterval(handle: number): void

Cancels a repeating host timer.

handle: number
methodclearTimeout
clearTimeout(handle: number): void

Cancels a one-shot host timer.

handle: number
methodcreateId
createId(prefix?: string): string

Creates a deterministic test identifier.

prefix: string
methodcurrentDateTime
currentDateTime(): number

Returns the test host wall-clock time as Unix milliseconds.

methoddestroy
destroy(): void

Releases resources owned by TestPlatform.

methodflush
flush(): void

Runs all pending one-shot callbacks once, in creation order.

methodnow
now(): number

Returns the current test platform time.

methodobserveResize
observeResize(_target: unknown, _callback: (size: { height: number; width: number }): void): (): void

Observes host-view size changes and returns an idempotent disposer.

_target: unknown
_callback: (size: { height: number; width: number }): void
methodqueueMicrotask
queueMicrotask(callback: (): void): void

Queues a microtask in the test platform.

callback: (): void
methodreadViewOffset
readViewOffset(_target: unknown): PlatformViewOffset

Test targets have no host-space offset unless a fixture overrides it.

_target: unknown
methodrequestAnimationFrame
requestAnimationFrame(callback: PlatformFrameRequestCallback): number

Schedules a callback for the next host animation frame.

callback: PlatformFrameRequestCallback
methodsetInterval
setInterval(callback: (): void, _ms: number): number

Updates the interval.

callback: (): void
_ms: number
methodsetTimeout
setTimeout(callback: (): void, _ms: number): number

Updates the timeout.

callback: (): void
_ms: number
methodtoLowerCaseinherited
toLowerCase(value: string): string

Converts text to lowercase without consulting the host's locale.

value: string
methodwarn
warn(_message: string, ..._details: unknown[]): void

Records or emits a platform warning.

_message: string
_details: unknown[]
interfaceCreateTestSheetOptionssource ↗
interface CreateTestSheetOptions

Test support contract for CreateTestSheetOptions.

propertyevents
events?: string[]
propertyplugins
plugins?: TestPluginRegistration[]
propertyproviders
providers?: TestProviderOverride[]
propertysheet
sheet?: TestSheetDataOptions
propertyviewport
viewport?: { height: number; width: number }
interfaceRenderCallsource ↗
interface RenderCall

Test support contract for RenderCall.

propertyargs
args: unknown[]
propertyname
name: string
interfaceTestPluginRegistrationsource ↗
interface TestPluginRegistration

Test support contract for TestPluginRegistration.

propertyimplementation
implementation: (...args: never[]): Plugin<SearCoreSheet, CellProperties, unknown>
propertytoken
token: symbol
interfaceTestProviderOverridesource ↗
interface TestProviderOverride

Test support contract for TestProviderOverride.

methodregister
register(container: Container): void
container: Container
interfaceTestSheetCellsource ↗
interface TestSheetCell

Test support contract for TestSheetCell.

propertycol
col: number
propertyrow
row: number
propertyvalue
value: CellMatrixElement
interfaceTestSheetDataOptionssource ↗
interface TestSheetDataOptions

Test support contract for TestSheetDataOptions.

propertycells
cells?: TestSheetCell[]
propertycolCount
colCount?: number
propertycolWidth
colWidth?: number
propertyrowCount
rowCount?: number
propertyrowHeight
rowHeight?: number
interfaceTestSheetHarnesssource ↗
interface TestSheetHarness

Test support contract for TestSheetHarness.

propertycommands
readonly commands: SheetCommandBus
propertycontainer
readonly container: Container
propertycore
readonly core: SearCoreSheet
propertyhitRenderContext
readonly hitRenderContext: RecordingRenderContext
propertyoffScreenRenderContext
readonly offScreenRenderContext: RecordingRenderContext
propertyrenderContext
readonly renderContext: RecordingRenderContext
propertystage
readonly stage: SceneGraph<CellProperties>
methoddestroy
destroy(): void
methodexecuteTransaction
executeTransaction(transaction: Transaction): void
transaction: Transaction
methodflush
flush(): void
functioncreateTestSheetsource ↗
createTestSheet(options?: CreateTestSheetOptions): TestSheetHarness

Builds the smallest real Sheet runtime that includes the render pipeline.
Browser and scheduling boundaries are replaced with deterministic test implementations.

options: CreateTestSheetOptions
functionreplacesource ↗
replace<T>(token: symbol, instance: T): TestProviderOverride

Replaces a binding after default test registrations and before the core resolves.

token: symbol
instance: T

Package

@searsuite/sear-assembly-workbook

129 exports

Workbook structure, Sheet mounting, workbook commands, sessions, and shared runtime services.

classWorkbookCollaborationPluginsource ↗
class WorkbookCollaborationPlugin extends WorkbookPlugin, WorkbookCollaborationSession

Owns collaboration state beyond the lifetime of any temporary active SheetEditor.

constructorconstructor
WorkbookCollaborationPlugin(transports: WorkbookCollaborationTransportFactory, platform: Platform): WorkbookCollaborationPlugin
transports: WorkbookCollaborationTransportFactory
platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Closes plugin-owned runtime mutations after Workbook assembly.

assertWrite: (): void
methodgetConnectedSheetIds
getConnectedSheetIds(): readonly string[]
methodgetSheetPluginsinherited
getSheetPlugins(context: WorkbookCompanionSheetPluginContext): readonly SheetPluginImplementation<SheetPlugin<unknown>>[]
context: WorkbookCompanionSheetPluginContext
methodgetSheetServices
getSheetServices(context: WorkbookCompanionSheetPluginContext): { token: symbol; value: { channel: CollaborationChannel; owner: "host" } }[]

Contributes parent-owned services without exposing the child editor container.

context: WorkbookCompanionSheetPluginContext
methodgetSheetStatus
getSheetStatus(sheetId: string): CollaborationStatus | undefined
sheetId: string
methodinitialize
initialize(context: WorkbookPluginContext): (): void
context: WorkbookPluginContext
methodonBeforeSheetActivationinherited
onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): void

Runs inside the activation command before the source Sheet is captured.

input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited
onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): void

Restores plugin-local work if activation fails before commit.

input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted
onTransactionCommitted(event: WorkbookTransactionCommittedEvent): void
event: WorkbookTransactionCommittedEvent
methodonWorkbookDestroy
onWorkbookDestroy(): void
methodregisterCapabilities
registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): void

Registers every runtime capability owned by this plugin.

registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: WorkbookCommandBus): void

Registers every stable command id owned by this plugin.

commands: WorkbookCommandBus
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
methodregisterServicesstaticinherited
registerServices(context: WorkbookPluginServiceContext): void
context: WorkbookPluginServiceContext
classWorkbookCommandBussource ↗
class WorkbookCommandBus

Editor-scoped command bus for workbook-level sheet-list actions.

constructorconstructor
WorkbookCommandBus(options?: WorkbookCommandBusOptions): WorkbookCommandBus

Creates an empty workbook command bus.

options: WorkbookCommandBusOptions
propertysymbolstatic
readonly symbol: typeof symbol

DI token for the command bus owned by one WorkbookEditor.

methoddestroy
destroy(): void

Clears listeners and command registrations during teardown.

methodenforceRegistrationBoundary
enforceRegistrationBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodgetRegisteredCommandIds
getRegisteredCommandIds(): readonly string[]

Returns a stable snapshot of all workbook command ids exposed by this editor.

methodgetRegisteredCommands
getRegisteredCommands(): readonly WorkbookCommandDefinition<unknown, unknown>[]

Returns the typed definitions registered on this workbook editor instance.

methodhas
has(definition: string | WorkbookCommandDefinition<unknown, unknown>): boolean

Returns whether this workbook editor currently exposes a command id.

definition: string | WorkbookCommandDefinition<unknown, unknown>
methodisExecuting
isExecuting(): boolean

Whether this WorkbookEditor is currently dispatching a command.

methodregister
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.

definition: Definition
handler: WorkbookCommandHandler<Definition>
methodrun
run<Definition>(definition: Definition, input: WorkbookCommandInput<Definition>): WorkbookCommandDefinitionResult<Definition>

Executes a registered workbook command through its typed definition.

definition: Definition
input: WorkbookCommandInput<Definition>
methodrunWithoutMutationAuthority
runWithoutMutationAuthority<Value>(callback: (): Value): Value

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

callback: (): Value
methodsubscribe
subscribe(listener: WorkbookCommandListener): (): void

Subscribes to command lifecycle events and returns an unsubscribe function.

listener: WorkbookCommandListener
classWorkbookFormulaDependencyGraphsource ↗
class WorkbookFormulaDependencyGraph

Workbook-qualified dependency graph owned by WorkbookFormulaPlugin.

constructorconstructor
WorkbookFormulaDependencyGraph(): WorkbookFormulaDependencyGraph
memberdirtySize
dirtySize: unknown
memberresultSize
resultSize: unknown
membersize
size: unknown
methodclear
clear(): void

Removes every formula and dependency edge.

methodgetBrokenReferences
getBrokenReferences(formulaCell: WorkbookCellReference): readonly WorkbookFormulaBrokenReference[]

Returns broken references owned by one formula cell.

formulaCell: WorkbookCellReference
methodgetDependencies
getDependencies(formulaCell: WorkbookCellReference): readonly WorkbookFormulaGraphReference[]

Returns workbook-qualified dependencies owned by one formula cell.

formulaCell: WorkbookCellReference
methodgetDependents
getDependents(cell: WorkbookCellReference): readonly WorkbookCellReference[]

Returns formula cells that currently depend on the given workbook cell.

cell: WorkbookCellReference
methodgetDirtyFormulaCells
getDirtyFormulaCells(): readonly WorkbookCellReference[]

Returns every workbook-qualified formula cell currently marked dirty.

methodgetFormulaCells
getFormulaCells(): readonly WorkbookCellReference[]

Returns every workbook-qualified formula cell currently registered.

methodgetFormulaResult
getFormulaResult(formulaCell: WorkbookCellReference): FormulaValue | undefined

Returns a derived workbook formula result, or #REF! when references are broken.

formulaCell: WorkbookCellReference
methodhasBrokenReferences
hasBrokenReferences(formulaCell: WorkbookCellReference): boolean

Reports whether one formula cell currently contains broken references.

formulaCell: WorkbookCellReference
methodhasFormulaCell
hasFormulaCell(formulaCell: WorkbookCellReference): boolean

Reports whether one workbook-qualified cell is registered as a formula cell.

formulaCell: WorkbookCellReference
methodisDirty
isDirty(formulaCell: WorkbookCellReference): boolean

Reports whether one workbook formula cell needs recalculation.

formulaCell: WorkbookCellReference
methodmarkDirty
markDirty(changedCells: readonly WorkbookCellReference[]): readonly WorkbookCellReference[]

Marks formulas that depend on changed workbook cells as dirty, including transitive formula chains.

changedCells: readonly WorkbookCellReference[]
methodmarkFormulaCellsDirty
markFormulaCellsDirty(formulaCells: readonly WorkbookCellReference[]): void

Marks formula cells themselves dirty after an external evaluation service changes.

formulaCells: readonly WorkbookCellReference[]
methodremoveFormulaCell
removeFormulaCell(formulaCell: WorkbookCellReference): void

Removes one formula cell and every reverse edge it owns.

formulaCell: WorkbookCellReference
methodremoveSheet
removeSheet(sheetId: string): void

Removes formulas on a deleted sheet and marks references to that sheet as broken.

sheetId: string
methodsetFormulaResult
setFormulaResult(formulaCell: WorkbookCellReference, result: FormulaValue): void

Stores a derived workbook formula result and marks the formula clean.

formulaCell: WorkbookCellReference
result: FormulaValue
methodupdateFormulaCell
updateFormulaCell(formulaCell: WorkbookCellReference, dependencies: readonly WorkbookFormulaReference[]): void

Registers dependencies for one workbook-qualified formula cell.

formulaCell: WorkbookCellReference
dependencies: readonly WorkbookFormulaReference[]
methodupdateFormulaCellReferences
updateFormulaCellReferences(formulaCell: WorkbookCellReference, dependencies: readonly WorkbookFormulaGraphReference[]): void

Registers graph references for one formula cell, including broken references.

formulaCell: WorkbookCellReference
dependencies: readonly WorkbookFormulaGraphReference[]
classWorkbookFormulaEvaluationRuntimesource ↗
class WorkbookFormulaEvaluationRuntime

Runtime adapter that evaluates workbook formulas through the shared formula engine.

constructorconstructor
WorkbookFormulaEvaluationRuntime(input?: { contextServices?: (): { dateTimeLocale?: FormulaDateTimeLocale; externalServices?: FormulaExternalServiceReader; languageService?: FormulaLanguageService; phoneticReader?: FormulaPhoneticReader; textLocale?: FormulaTextLocale; xmlXPath?: XmlXPathEvaluator }; evaluator?: IFormulaEvaluator; parser?: IFormulaParser }): WorkbookFormulaEvaluationRuntime

Creates a workbook formula evaluation runtime.

input: { contextServices?: (): { dateTimeLocale?: FormulaDateTimeLocale; externalServices?: FormulaExternalServiceReader; languageService?: FormulaLanguageService; phoneticReader?: FormulaPhoneticReader; textLocale?: FormulaTextLocale; xmlXPath?: XmlXPathEvaluator }; evaluator?: IFormulaEvaluator; parser?: IFormulaParser }
methodcompileFormula
compileFormula(formulaCell: WorkbookCellReference, source: string, workbookState: WorkbookDocumentState<SheetDocumentState>): CompiledWorkbookFormula

Compiles formula text into native AST plus stable workbook dependencies.

formulaCell: WorkbookCellReference
source: string
workbookState: WorkbookDocumentState<SheetDocumentState>
methodformatFormulaSource
formatFormulaSource(compiled: CompiledWorkbookFormula, workbookState: WorkbookDocumentState<SheetDocumentState>): string

Formats workbook formula source with current sheet names while keeping stable sheet-id bindings.

compiled: CompiledWorkbookFormula
workbookState: WorkbookDocumentState<SheetDocumentState>
methodrecalculateDirty
recalculateDirty(input: { formulas: ReadonlyMap<string, CompiledWorkbookFormula>; graph: WorkbookFormulaDependencyGraph; runtime: WorkbookPluginRuntime }): WorkbookFormulaRecalculationResult

Recalculates dirty formula cells whose dependencies are currently clean.

input: { formulas: ReadonlyMap<string, CompiledWorkbookFormula>; graph: WorkbookFormulaDependencyGraph; runtime: WorkbookPluginRuntime }
methodshiftCompiledFormulaReferences
shiftCompiledFormulaReferences(input: { changedSheetId: string; changes: readonly StructureChange[]; compiled: CompiledWorkbookFormula; formulaCell: WorkbookCellReference }): WorkbookFormulaCompiledReferenceShiftResult

Shifts compiled formula references after a row or column structure change.

input: { changedSheetId: string; changes: readonly StructureChange[]; compiled: CompiledWorkbookFormula; formulaCell: WorkbookCellReference }
classWorkbookFormulaObjectsPluginsource ↗
class WorkbookFormulaObjectsPlugin extends WorkbookPlugin

Workbook-owned editing surface for named formulas and table references.

constructorconstructor
WorkbookFormulaObjectsPlugin(): WorkbookFormulaObjectsPlugin
propertysymbolstatic
readonly symbol: typeof symbol
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Closes plugin-owned runtime mutations after Workbook assembly.

assertWrite: (): void
methodgetSheetPluginsinherited
getSheetPlugins(context: WorkbookCompanionSheetPluginContext): readonly SheetPluginImplementation<SheetPlugin<unknown>>[]
context: WorkbookCompanionSheetPluginContext
methodgetSheetServicesinherited
getSheetServices(context: WorkbookCompanionSheetPluginContext): readonly WorkbookCompanionSheetService<unknown>[]

Contributes parent-owned services without exposing the child editor container.

context: WorkbookCompanionSheetPluginContext
methodinitialize
initialize(context: WorkbookPluginContext): void
context: WorkbookPluginContext
methodonBeforeSheetActivationinherited
onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): void

Runs inside the activation command before the source Sheet is captured.

input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited
onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): void

Restores plugin-local work if activation fails before commit.

input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted
onTransactionCommitted(): void
methodonWorkbookDestroy
onWorkbookDestroy(): void
methodregisterCapabilitiesinherited
registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): void

Registers every runtime capability owned by this plugin.

registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: WorkbookCommandBus): void

Registers every stable command id owned by this plugin.

commands: WorkbookCommandBus
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
methodregisterServicesstaticinherited
registerServices(context: WorkbookPluginServiceContext): void
context: WorkbookPluginServiceContext
classWorkbookFormulaPluginsource ↗
class WorkbookFormulaPlugin extends WorkbookPlugin

Workbook-level formula coordinator and cross-sheet dependency owner.

constructorconstructor
WorkbookFormulaPlugin(): WorkbookFormulaPlugin
propertysymbolstatic
readonly symbol: typeof symbol
methodassertSheetRangeMoveSupported
assertSheetRangeMoveSupported(sheetId: string, context: SheetRangeMoveContext): void

Rejects moves requiring reference edits outside the current Sheet transaction boundary.

sheetId: string
context: SheetRangeMoveContext
methodassertSheetStructureMoveSupported
assertSheetStructureMoveSupported(sheetId: string, context: SheetStructureMoveContext): void

Rejects qualified reference rewrites that cannot be persisted by a single Sheet transaction.

sheetId: string
context: SheetStructureMoveContext
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Closes plugin-owned runtime mutations after Workbook assembly.

assertWrite: (): void
methodformatReference
formatReference(reference: ParsedWorkbookFormulaReference): string

Formats a stable workbook reference with the latest workbook sheet name.

reference: ParsedWorkbookFormulaReference
methodgetDependencyGraph
getDependencyGraph(): WorkbookFormulaDependencyGraphReader

Returns the workbook-qualified dependency graph owned by this plugin instance.

methodgetFormulaResult
getFormulaResult(formulaCell: ParsedWorkbookFormulaReference): FormulaValue | undefined

Returns a workbook-level formula result when the skeleton can determine one.

formulaCell: ParsedWorkbookFormulaReference
methodgetSheetFormulaResult
getSheetFormulaResult(sheetId: string, row: number, col: number): FormulaValue | undefined

Returns a result only for formula cells that contain workbook-qualified references.

sheetId: string
row: number
col: number
methodgetSheetFormulaSource
getSheetFormulaSource(sheetId: string, row: number, col: number): string | undefined

Returns display-ready formula source for workbook formulas on one mounted sheet.

sheetId: string
row: number
col: number
methodgetSheetPlugins
getSheetPlugins(context: WorkbookCompanionSheetPluginContext): readonly SheetPluginImplementation<SheetPlugin<unknown>>[]

Contributes the active-sheet companion that forwards committed Sheet transactions.

context: WorkbookCompanionSheetPluginContext
methodgetSheetServices
getSheetServices(context: WorkbookCompanionSheetPluginContext): readonly { token: symbol; value: unknown }[]

Shares the workbook function registry with each mounted Sheet editor.

context: WorkbookCompanionSheetPluginContext
methodinitialize
initialize(context: WorkbookPluginContext): (): void

Starts observing workbook state for this WorkbookEditor instance.

context: WorkbookPluginContext
methodobserveSheetTransaction
observeSheetTransaction(sheetId: string, transaction: Transaction): void

Receives a committed Sheet transaction from the active SheetEditor companion.

sheetId: string
transaction: Transaction
methodonBeforeSheetActivationinherited
onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): void

Runs inside the activation command before the source Sheet is captured.

input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited
onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): void

Restores plugin-local work if activation fails before commit.

input: ActivateWorkbookSheetCommandInput
methodonTransactionCommittedinherited
onTransactionCommitted(event: WorkbookTransactionCommittedEvent): void
event: WorkbookTransactionCommittedEvent
methodonWorkbookDestroyinherited
onWorkbookDestroy(context: WorkbookPluginContext): void
context: WorkbookPluginContext
methodparseReference
parseReference(reference: string): ParsedWorkbookFormulaReference

Parses a displayed cross-sheet reference against the latest workbook sheet names.

reference: string
methodrecalculateDirtyFormulas
recalculateDirtyFormulas(): RecalculateWorkbookFormulasCommandResult

Recalculates workbook formulas currently marked dirty.

methodregisterCapabilitiesinherited
registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): void

Registers every runtime capability owned by this plugin.

registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: WorkbookCommandBus): void

Registers workbook formula commands.

commands: WorkbookCommandBus
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers workbook formula diagnostic observations.

observations: ObservationRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
methodremoveFormulaCell
removeFormulaCell(formulaCell: WorkbookCellReference): void

Removes workbook formula bookkeeping for one formula cell.

formulaCell: WorkbookCellReference
methodsetFormulaCellFormula
setFormulaCellFormula(formulaCell: ParsedWorkbookFormulaReference, formulaSource: string): void

Registers and compiles one workbook formula source.

formulaCell: ParsedWorkbookFormulaReference
formulaSource: string
methodsetFormulaResult
setFormulaResult(formulaCell: ParsedWorkbookFormulaReference, result: FormulaValue): void

Stores a derived workbook formula result and marks the formula clean.

formulaCell: ParsedWorkbookFormulaReference
result: FormulaValue
methodupdateFormulaCell
updateFormulaCell(formulaCell: ParsedWorkbookFormulaReference, dependencies: readonly WorkbookFormulaReference[]): void

Registers workbook-qualified dependencies for one formula cell.

formulaCell: ParsedWorkbookFormulaReference
dependencies: readonly WorkbookFormulaReference[]
methodregisterServicesstatic
registerServices(__namedParameters: WorkbookPluginServiceContext): void

Registers one workbook-owned formula runtime shared by mounted Sheet editors.

__namedParameters: WorkbookPluginServiceContext
classWorkbookFormulaReferenceShiftersource ↗
class WorkbookFormulaReferenceShifter

Shifts workbook-qualified AST references for one structurally changed sheet.

constructorconstructor
WorkbookFormulaReferenceShifter(): WorkbookFormulaReferenceShifter
methodshiftReferences
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.

input: { ast: FormulaAST; changedSheetId: string; changes: readonly StructureChange[]; sheetBindings: ReadonlyMap<string, string> }
classWorkbookHistoryPluginsource ↗
class WorkbookHistoryPlugin extends WorkbookPlugin

Built-in contributor for workbook structure history.

constructorconstructor
WorkbookHistoryPlugin(): WorkbookHistoryPlugin
propertysymbolstatic
readonly symbol: typeof symbol
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Closes plugin-owned runtime mutations after Workbook assembly.

assertWrite: (): void
methodgetSheetPluginsinherited
getSheetPlugins(context: WorkbookCompanionSheetPluginContext): readonly SheetPluginImplementation<SheetPlugin<unknown>>[]
context: WorkbookCompanionSheetPluginContext
methodgetSheetServicesinherited
getSheetServices(context: WorkbookCompanionSheetPluginContext): readonly WorkbookCompanionSheetService<unknown>[]

Contributes parent-owned services without exposing the child editor container.

context: WorkbookCompanionSheetPluginContext
methodgetStatus
getStatus(): WorkbookHistoryStatus
methodinitialize
initialize(context: WorkbookPluginContext): void
context: WorkbookPluginContext
methodonBeforeSheetActivationinherited
onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): void

Runs inside the activation command before the source Sheet is captured.

input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited
onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): void

Restores plugin-local work if activation fails before commit.

input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted
onTransactionCommitted(event: WorkbookTransactionCommittedEvent): void
event: WorkbookTransactionCommittedEvent
methodonWorkbookDestroy
onWorkbookDestroy(): void
methodregisterCapabilitiesinherited
registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): void

Registers every runtime capability owned by this plugin.

registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: WorkbookCommandBus): void

Registers every stable command id owned by this plugin.

commands: WorkbookCommandBus
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
methodregisterServicesstaticinherited
registerServices(context: WorkbookPluginServiceContext): void
context: WorkbookPluginServiceContext
classWorkbookPluginsource ↗
class WorkbookPlugin extends PluginExtension<WorkbookCommandBus, ObservationRegistry, SessionStateRegistry, WorkbookRuntimeExtensionRegistry>

Base contract for plugins owned by createWorkbookEditor().

constructorconstructor
WorkbookPlugin(): WorkbookPlugin
methodenforceRuntimeWriteBoundary
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Closes plugin-owned runtime mutations after Workbook assembly.

assertWrite: (): void
methodgetSheetPlugins
getSheetPlugins(context: WorkbookCompanionSheetPluginContext): readonly SheetPluginImplementation<SheetPlugin<unknown>>[]
context: WorkbookCompanionSheetPluginContext
methodgetSheetServices
getSheetServices(context: WorkbookCompanionSheetPluginContext): readonly WorkbookCompanionSheetService<unknown>[]

Contributes parent-owned services without exposing the child editor container.

context: WorkbookCompanionSheetPluginContext
methodinitialize
initialize(context: WorkbookPluginContext): void | WorkbookPluginDisposer
context: WorkbookPluginContext
methodonBeforeSheetActivation
onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): void

Runs inside the activation command before the source Sheet is captured.

input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailed
onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): void

Restores plugin-local work if activation fails before commit.

input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted
onTransactionCommitted(event: WorkbookTransactionCommittedEvent): void
event: WorkbookTransactionCommittedEvent
methodonWorkbookDestroy
onWorkbookDestroy(context: WorkbookPluginContext): void
context: WorkbookPluginContext
methodregisterCapabilities
registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): void

Registers every runtime capability owned by this plugin.

registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands
registerCommands(commands: WorkbookCommandBus): void

Registers every stable command id owned by this plugin.

commands: WorkbookCommandBus
methodregisterObservations
registerObservations(observations: ObservationRegistry): void

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

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
methodregisterServicesstatic
registerServices(context: WorkbookPluginServiceContext): void
context: WorkbookPluginServiceContext
classWorkbookRangeMoveErrorsource ↗
class WorkbookRangeMoveError extends SearError

Prevents a same-sheet move from leaving workbook-qualified references stale.

constructorconstructor
WorkbookRangeMoveError(sheetId: string): WorkbookRangeMoveError
sheetId: string
propertycauseinherited
cause?: unknown
propertycode
readonly code: "WORKBOOK_RANGE_MOVE_QUALIFIED_REFERENCE"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classWorkbookRuntimeExtensionRegistrysource ↗
class WorkbookRuntimeExtensionRegistry extends RuntimeCapabilityRegistry

Editor-local capability registry exposed through WorkbookEditor.capabilities.

constructorconstructor
WorkbookRuntimeExtensionRegistry(): WorkbookRuntimeExtensionRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroyinherited
destroy(): void

Permanently closes the registry and releases all published values.

methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for capability changes after assembly.

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

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

capability: RuntimeCapability<T>
value: T
methodrequireinherited
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
classWorkbookSessionStoresource ↗
class WorkbookSessionStore

Owns built-in workbook session values without exposing their shape to aggregate capture.

constructorconstructor
WorkbookSessionStore(documentState: WorkbookDocumentState): WorkbookSessionStore
documentState: WorkbookDocumentState
propertysymbolstatic
readonly symbol: typeof symbol
methodbindActiveSheetCapture
bindActiveSheetCapture(capture: (): { sheetId: string; state?: Readonly<Record<string, unknown>> }): void
capture: (): { sheetId: string; state?: Readonly<Record<string, unknown>> }
methodclear
clear(lifecycleToken?: object): void
lifecycleToken: object
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, lifecycleToken: object): void

Restricts runtime session changes to this editor's command dispatch.

isExecuting: (): boolean
lifecycleToken: object
methodgetActiveSheetId
getActiveSheetId(): string
methodgetSheetSessionState
getSheetSessionState(sheetId: string): Readonly<Record<string, unknown>> | undefined
sheetId: string
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers the built-in contributors beside third-party workbook contributors.

registry: SessionStateRegistry
methodremoveMissingSheets
removeMissingSheets(liveSheetIds: ReadonlySet<string>, ownerToken?: object): void
liveSheetIds: ReadonlySet<string>
ownerToken: object
methodsetActiveSheetId
setActiveSheetId(sheetId: string, ownerToken?: object): void
sheetId: string
ownerToken: object
methodsetSheetSessionState
setSheetSessionState(sheetId: string, state: Readonly<Record<string, unknown>> | undefined, ownerToken?: object): void
sheetId: string
state: Readonly<Record<string, unknown>> | undefined
ownerToken: object
methodvalidate
validate(documentState: WorkbookDocumentState): void
documentState: WorkbookDocumentState
classWorkbookStructureMoveErrorsource ↗
class WorkbookStructureMoveError extends SearError

Prevents an axis move from leaving qualified reference sources outside its transaction stale.

constructorconstructor
WorkbookStructureMoveError(sheetId: string): WorkbookStructureMoveError
sheetId: string
propertycauseinherited
cause?: unknown
propertycode
readonly code: "WORKBOOK_STRUCTURE_MOVE_QUALIFIED_REFERENCE"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classWorkbookTransactionsource ↗
class WorkbookTransaction

Ordered, atomic workbook mutation assembled inside a typed command handler.
Reducers stage state only; the WorkbookEditor owns validation and commit.

constructorconstructor
WorkbookTransaction(id: string, historyAction?: WorkbookHistoryAction): WorkbookTransaction
id: string
historyAction: WorkbookHistoryAction
propertyhistoryAction
readonly historyAction: WorkbookHistoryAction
propertyid
readonly id: string
methodaddStep
addStep(name: string, reduce: WorkbookTransactionReducer): this

Adds one pure reducer to the staged transaction.

name: string
reduce: WorkbookTransactionReducer
methodgetStepNames
getStepNames(): readonly string[]

Returns stable step names for diagnostics and tests.

interfaceActivateWorkbookSheetCommandInputsource ↗
interface ActivateWorkbookSheetCommandInput

Input for activating a workbook sheet.

propertysheetId
readonly sheetId: string

Sheet id to make active.

interfaceCaptureWorkbookSessionStateCommandResultsource ↗
interface CaptureWorkbookSessionStateCommandResult

Captured local state for remounting one WorkbookEditor runtime.

propertysessionState
readonly sessionState: WorkbookSessionState
interfaceCompiledWorkbookFormulasource ↗
interface CompiledWorkbookFormula

Compiled workbook formula with native workbook-reference AST nodes.

propertyast
readonly ast: FormulaAST

Parsed AST consumed by the configured formula evaluator.

propertybrokenReferences
readonly brokenReferences: readonly WorkbookFormulaBrokenReference[]

References that are already known to be invalid.

propertydependencies
readonly dependencies: readonly WorkbookFormulaReference[]

Stable workbook dependencies extracted from the AST.

propertyhasExpandedObjects
readonly hasExpandedObjects?: boolean
propertyhasWorkbookReferences
readonly hasWorkbookReferences: boolean

Whether the formula contains at least one workbook-qualified reference.

propertysheetBindings
readonly sheetBindings: ReadonlyMap<string, string>

Formula-text sheet names bound to stable sheet ids at compile time.

propertysource
readonly source: string

Original user-authored formula source.

interfaceExportWorkbookStateCommandResultsource ↗
interface ExportWorkbookStateCommandResult

Current workbook-owned document snapshot.

propertydocumentState
readonly documentState: WorkbookDocumentState<SheetDocumentState>
interfaceHideWorkbookSheetCommandInputsource ↗
interface HideWorkbookSheetCommandInput

Input for hiding a workbook sheet.

propertynextActiveSheetId
readonly nextActiveSheetId?: string

Optional active sheet to select when hiding the current active sheet.

propertysheetId
readonly sheetId: string

Sheet id to hide.

interfaceRecalculateWorkbookFormulasCommandResultsource ↗
interface RecalculateWorkbookFormulasCommandResult

Result returned after recalculating workbook-level dirty formulas.

propertyrecalculatedCells
readonly recalculatedCells: readonly WorkbookCellReference[]

Formula cells recalculated by this command.

propertyremainingDirtyCells
readonly remainingDirtyCells: readonly WorkbookCellReference[]

Formula cells still dirty after the command completes.

interfaceSetWorkbookDefinedNameInputsource ↗
interface SetWorkbookDefinedNameInput
propertyformula
readonly formula: string
propertyname
readonly name: string
interfaceUnhideWorkbookSheetCommandInputsource ↗
interface UnhideWorkbookSheetCommandInput

Input for unhiding a workbook sheet.

propertysheetId
readonly sheetId: string

Sheet id to reveal.

interfaceWorkbookActiveSheetEditorSnapshotsource ↗
interface WorkbookActiveSheetEditorSnapshot

Current live SheetEditor mounted by one WorkbookEditor instance.

propertyeditor
readonly editor: SheetEditor

Live editor owned by the workbook assembly.

propertysheetId
readonly sheetId: string

Stable id of the sheet mounted by the live editor.

interfaceWorkbookCollaborationSessionsource ↗
interface WorkbookCollaborationSession

Read-only host facade for Workbook-owned collaboration channels.

methodgetConnectedSheetIds
getConnectedSheetIds(): readonly string[]
methodgetSheetStatus
getSheetStatus(sheetId: string): CollaborationStatus | undefined
sheetId: string
interfaceWorkbookCollaborationTransportFactorysource ↗
interface WorkbookCollaborationTransportFactory

Creates one transport per Workbook-owned Sheet collaboration channel.

methodcreate
create(): CollabTransport
interfaceWorkbookCommandBusOptionssource ↗
interface WorkbookCommandBusOptions

Optional diagnostics hooks used by the workbook command bus.

propertywarn
readonly warn?: (message: string, ...details: unknown[]): void

Receives non-fatal command-boundary diagnostics.

interfaceWorkbookCommandControllersource ↗
interface WorkbookCommandController

Internal controller API implemented by the workbook editor facade.

methodactivateSheet
activateSheet(input: ActivateWorkbookSheetCommandInput): WorkbookCommandResult
input: ActivateWorkbookSheetCommandInput
methodaddSheet
addSheet(input: AddWorkbookSheetCommandInput): WorkbookCommandResult
input: AddWorkbookSheetCommandInput
methodhideSheet
hideSheet(input: HideWorkbookSheetCommandInput): WorkbookCommandResult
input: HideWorkbookSheetCommandInput
methodmoveSheet
moveSheet(input: MoveWorkbookSheetInput): WorkbookCommandResult
input: MoveWorkbookSheetInput
methodremoveSheet
removeSheet(input: RemoveWorkbookSheetCommandInput): WorkbookCommandResult
input: RemoveWorkbookSheetCommandInput
methodrenameSheet
renameSheet(input: RenameWorkbookSheetInput): WorkbookCommandResult
input: RenameWorkbookSheetInput
methodunhideSheet
unhideSheet(input: UnhideWorkbookSheetCommandInput): WorkbookCommandResult
input: UnhideWorkbookSheetCommandInput
interfaceWorkbookCommandDefinitionsource ↗
interface WorkbookCommandDefinition<Input, Result>

Stable workbook command identifier carrying its input and result contract.

property[workbookCommandInputType]
readonly [workbookCommandInputType]: Input

Phantom field that preserves the command input type for callers.

property[workbookCommandResultType]
readonly [workbookCommandResultType]: Result

Phantom field that preserves the command result type for callers.

propertyid
readonly id: string

Globally stable command id owned by the workbook assembly package.

interfaceWorkbookCommandEventsource ↗
interface WorkbookCommandEvent

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

propertyerror
readonly error?: unknown

Original thrown value when the command failed.

propertyid
readonly id: string

Stable command id being executed.

propertyphase
readonly phase: CommandExecutionPhase

Execution phase represented by this event.

interfaceWorkbookCommandResultsource ↗
interface WorkbookCommandResult

Result returned by workbook-level sheet-list commands.

propertyactiveSheetEditorChanged
readonly activeSheetEditorChanged: boolean

Whether the live active SheetEditor instance was replaced.

propertydocumentState
readonly documentState: WorkbookDocumentState<SheetDocumentState>

Latest workbook state after the command.

interfaceWorkbookCompanionSheetPluginContextsource ↗
interface WorkbookCompanionSheetPluginContext extends WorkbookPluginContext

Context used when a Workbook plugin contributes plugins to a mounted SheetEditor.

propertycontainerinherited
readonly container: Container
propertyruntimeinherited
readonly runtime: WorkbookPluginRuntime
propertysheetId
readonly sheetId: string
propertysheetState
readonly sheetState: SheetDocumentState
interfaceWorkbookCompanionSheetServicesource ↗
interface WorkbookCompanionSheetService<Value>

One typed service value contributed to a temporary child SheetEditor container.

propertytoken
readonly token: symbol
propertyvalue
readonly value: Value
interfaceWorkbookDocumentApisource ↗
interface WorkbookDocumentApi

Read-only access to the document-owned state of one WorkbookEditor.

methodgetState
getState(): WorkbookDocumentState<SheetDocumentState>

Returns the current in-memory workbook document state.

interfaceWorkbookDocumentStateSerializationOptionssource ↗
interface WorkbookDocumentStateSerializationOptions<TSheetState>

Options for workbook document-state serialization.

propertysheetRegistry
readonly sheetRegistry?: DocumentStateCodecRegistry<TSheetState>

Registry that owns Sheet document-state module serialization.

interfaceWorkbookEditorsource ↗
interface WorkbookEditor

Public workbook facade returned by createWorkbookEditor().

propertycapabilities
readonly capabilities: RuntimeCapabilityReader

Read-only access to typed services owned by this editor's isolated runtime.

propertycommands
readonly commands: WorkbookCommandBus

The supported command entry point for workbook user and program actions.

propertydocument
readonly document: WorkbookDocumentApi

Read-only access to document-owned workbook state.

propertyobservations
readonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

propertysheets
readonly sheets: WorkbookSheetsApi

Read-only access to the active and mounted SheetEditor.

methoddestroy
destroy(): void

Releases the active SheetEditor, plugins, observations, commands, and editor-local services.

interfaceWorkbookEditorConfigurationsource ↗
interface WorkbookEditorConfiguration

Public configuration accepted by createWorkbookEditor().

propertyadapters
readonly adapters: SheetEditorAdapters
propertycaptureSheetSessionState
readonly captureSheetSessionState?: WorkbookSheetSessionStateCapture
propertycaptureSheetState
readonly captureSheetState?: WorkbookSheetStateCapture
propertydocumentState
readonly documentState: WorkbookDocumentState<SheetDocumentState>
propertyonCreated
readonly onCreated?: (editor: WorkbookEditor): void

One-time assembly callback for registering host-owned commands.

propertyplugins
readonly plugins?: readonly WorkbookPluginImplementation<WorkbookPlugin>[]
propertysessionState
readonly sessionState?: Readonly<Record<string, unknown>>
propertysheetEditorFactory
readonly sheetEditorFactory?: WorkbookSheetEditorFactory
propertysheetPlugins
readonly sheetPlugins?: readonly SheetPluginImplementation<SheetPlugin<unknown>>[]
propertyviewport
readonly viewport?: { height: number; width: number }
propertywarn
readonly warn?: (message: string, ...details: unknown[]): void
interfaceWorkbookFormulaBrokenReferencesource ↗
interface WorkbookFormulaBrokenReference

Dependency entry retained after a workbook formula reference becomes invalid.

propertykind
readonly kind: "broken"
propertyreason
readonly reason: WorkbookFormulaBrokenReferenceReason
propertyreference
readonly reference: WorkbookFormulaReference
propertysheetId
readonly sheetId: string
interfaceWorkbookFormulaCompiledReferenceShiftResultsource ↗
interface WorkbookFormulaCompiledReferenceShiftResult

Result of applying row/column structure edits to one compiled workbook formula.

propertychanged
readonly changed: boolean

Whether formula position, AST, dependencies, or broken-reference metadata changed.

propertycompiled
readonly compiled: CompiledWorkbookFormula

Updated compiled formula.

interfaceWorkbookFormulaObjectssource ↗
interface WorkbookFormulaObjects
propertynames
readonly names?: Readonly<Record<string, string>>
propertytables
readonly tables?: readonly WorkbookFormulaTable[]
interfaceWorkbookFormulaRecalculationResultsource ↗
interface WorkbookFormulaRecalculationResult

Result returned after recalculating dirty workbook formulas.

propertyrecalculatedCells
readonly recalculatedCells: readonly WorkbookCellReference[]

Formula cells that were evaluated and stored in the workbook result cache.

propertyremainingDirtyCells
readonly remainingDirtyCells: readonly WorkbookCellReference[]

Dirty formula cells that could not be evaluated in this pass.

interfaceWorkbookFormulaReferenceShiftResultsource ↗
interface WorkbookFormulaReferenceShiftResult

Result of shifting workbook-qualified formula references in one AST.

propertyast
readonly ast: FormulaAST

Shifted AST, or the original AST when no workbook reference changed.

propertybrokenReferences
readonly brokenReferences: readonly WorkbookFormulaReference[]

References that became invalid because the target row or column was deleted.

propertychanged
readonly changed: boolean

Whether the AST identity changed.

interfaceWorkbookFormulaSheetTransactionEventsource ↗
interface WorkbookFormulaSheetTransactionEvent

Local event emitted when a companion Sheet plugin observes a committed transaction.

propertysheetId
readonly sheetId: string

Workbook sheet id that owned the active SheetEditor when the transaction committed.

propertytransaction
readonly transaction: Transaction

Committed Sheet transaction observed from the active SheetEditor.

interfaceWorkbookFormulaStateSnapshotsource ↗
interface WorkbookFormulaStateSnapshot

State snapshot for the workbook-scoped formula runtime.

propertyactiveSheetId
readonly activeSheetId: string | null

Active sheet id in the observed workbook state.

propertycachedFormulaResultCount
readonly cachedFormulaResultCount: number

Number of derived workbook formula results currently cached.

propertydirtyFormulaCellCount
readonly dirtyFormulaCellCount: number

Number of workbook formula cells waiting for recalculation.

propertyformulaCellCount
readonly formulaCellCount: number

Number of formula cells currently indexed in the workbook dependency graph.

propertyobservedSheetTransactionCount
readonly observedSheetTransactionCount: number

Number of active-sheet transactions observed by companion Sheet plugins.

propertysheetIds
readonly sheetIds: readonly string[]

Sheet ids currently present in the observed workbook state.

propertyworkbookId
readonly workbookId: string | null

Workbook id currently observed by WorkbookFormulaPlugin.

interfaceWorkbookFormulaTablesource ↗
interface WorkbookFormulaTable
propertyheaders
readonly headers: boolean
propertyname
readonly name: string
propertyrange
readonly range: string
propertysheet
readonly sheet: string
interfaceWorkbookHistoryEntrysource ↗
interface WorkbookHistoryEntry

Structural before/after snapshots retained independently from SheetEditor history.

propertyafter
readonly after: WorkbookTransactionState
propertybefore
readonly before: WorkbookTransactionState
interfaceWorkbookHistorySessionStatesource ↗
interface WorkbookHistorySessionState

Workbook-local structural undo and redo stacks.

propertyredoStack
readonly redoStack: readonly WorkbookHistoryEntry[]
propertyundoStack
readonly undoStack: readonly WorkbookHistoryEntry[]
interfaceWorkbookHistoryStatussource ↗
interface WorkbookHistoryStatus

Current workbook structure undo/redo availability.

propertycanRedo
readonly canRedo: boolean
propertycanUndo
readonly canUndo: boolean
interfaceWorkbookPluginContextsource ↗
interface WorkbookPluginContext

Context passed to Workbook plugin lifecycle hooks.

propertycontainer
readonly container: Container
propertyruntime
readonly runtime: WorkbookPluginRuntime
interfaceWorkbookPluginImplementationsource ↗
interface WorkbookPluginImplementation<TPlugin>

Injectable Workbook plugin class accepted by createWorkbookEditor().

constructorconstructor
WorkbookPluginImplementation(...args: never[]): TPlugin
args: never[]
propertysymbol
readonly symbol: symbol
methodregisterServices
registerServices(context: WorkbookPluginServiceContext): void
context: WorkbookPluginServiceContext
interfaceWorkbookPluginRuntimesource ↗
interface WorkbookPluginRuntime

Runtime services exposed to Workbook plugins for one WorkbookEditor instance.

propertycommands
readonly commands: WorkbookCommandBus
propertydocument
readonly document: WorkbookDocumentApi
propertyextensions
readonly extensions: WorkbookRuntimeExtensionRegistry
propertyformula
readonly formula: { externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }
propertyobservations
readonly observations: ObservationRegistry
propertysession
readonly session: SessionStateRegistry
propertysheets
readonly sheets: WorkbookSheetsApi
methodcreateCommandResult
createCommandResult(activeSheetEditorChanged: boolean): WorkbookCommandResult

Returns the current result shape for a command that performs no mutation.

activeSheetEditorChanged: boolean
methodexecuteTransaction
executeTransaction(transaction: WorkbookTransaction): WorkbookCommandResult

Commits a transaction assembled inside a typed Workbook command.

transaction: WorkbookTransaction
interfaceWorkbookPluginServiceContextsource ↗
interface WorkbookPluginServiceContext

Services available before a Workbook plugin is registered in its editor-local container.

propertycontainer
readonly container: Container
interfaceWorkbookSheetEditorFactoryInputsource ↗
interface WorkbookSheetEditorFactoryInput

Input passed when the workbook assembly creates one active SheetEditor.

propertyconfiguration
readonly configuration: SheetEditorConfiguration
propertysheetId
readonly sheetId: string
interfaceWorkbookSheetsApisource ↗
interface WorkbookSheetsApi

Read-only access to SheetEditor instances owned by one WorkbookEditor.

methodgetActiveEditor
getActiveEditor(): SheetEditor

Returns the SheetEditor mounted for the active sheet.

methodgetActiveId
getActiveId(): string

Returns the stable id of the active sheet.

methodgetEditor
getEditor(sheetId: string): SheetEditor | null

Returns the mounted SheetEditor when sheetId is active; detached sheets return null.

sheetId: string
interfaceWorkbookSheetSessionStateCaptureInputsource ↗
interface WorkbookSheetSessionStateCaptureInput

Read-only active SheetEditor session capture hook.

propertyeditor
readonly editor: SheetEditor
propertysessionState
readonly sessionState: Readonly<Record<string, unknown>> | undefined
propertysheetId
readonly sheetId: string
interfaceWorkbookSheetStateCaptureInputsource ↗
interface WorkbookSheetStateCaptureInput

Read-only active SheetEditor capture hook used by custom hosts and focused tests.

propertydocumentState
readonly documentState: WorkbookDocumentState<SheetDocumentState>
propertyeditor
readonly editor: SheetEditor
propertysheetId
readonly sheetId: string
propertysheetState
readonly sheetState: SheetDocumentState
interfaceWorkbookTransactionCommittedEventsource ↗
interface WorkbookTransactionCommittedEvent

Immutable event delivered after a complete workbook transaction commits.

propertyafter
readonly after: WorkbookTransactionState
propertybefore
readonly before: WorkbookTransactionState
propertytransaction
readonly transaction: WorkbookTransaction
interfaceWorkbookTransactionStatesource ↗
interface WorkbookTransactionState

Detached state staged by workbook transaction reducers.

propertyactiveSheetId
readonly activeSheetId: string
propertydocumentState
readonly documentState: WorkbookDocumentState<SheetDocumentState>
typeAddWorkbookSheetCommandInputsource ↗
type AddWorkbookSheetCommandInput = AddWorkbookSheetInput<SheetDocumentState> & { activate?: boolean }

Input for adding a sheet to the workbook.

typeMoveWorkbookSheetCommandInputsource ↗
type MoveWorkbookSheetCommandInput = MoveWorkbookSheetInput

Input for moving a sheet tab.

typeRemoveWorkbookSheetCommandInputsource ↗
type RemoveWorkbookSheetCommandInput = RemoveWorkbookSheetInput & { nextActiveSheetId?: WorkbookSheetId }

Input for removing a sheet from the workbook.

typeRenameWorkbookSheetCommandInputsource ↗
type RenameWorkbookSheetCommandInput = RenameWorkbookSheetInput

Input for renaming a workbook sheet.

typeWorkbookCommandDefinitionResultsource ↗
type WorkbookCommandDefinitionResult = conditional

Extracts the result contract from a typed workbook command definition.

typeWorkbookCommandHandlersource ↗
type WorkbookCommandHandler = (input: WorkbookCommandInput<Definition>): WorkbookCommandDefinitionResult<Definition>

Factory installed by the workbook assembly to run one typed command.

typeWorkbookCommandInputsource ↗
type WorkbookCommandInput = conditional

Extracts the input contract from a typed workbook command definition.

typeWorkbookCommandListenersource ↗
type WorkbookCommandListener = (event: WorkbookCommandEvent): void

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

typeWorkbookFormulaBrokenReferenceReasonsource ↗
type WorkbookFormulaBrokenReferenceReason = typeof WorkbookFormulaBrokenReferenceReason[keyof typeof WorkbookFormulaBrokenReferenceReason]

Reason a workbook formula reference can no longer resolve.

typeWorkbookFormulaGraphReferencesource ↗
type WorkbookFormulaGraphReference = WorkbookFormulaReference | WorkbookFormulaBrokenReference

Dependency entry stored by the workbook formula graph.

typeWorkbookFormulaGraphReferenceKindsource ↗
type WorkbookFormulaGraphReferenceKind = typeof WorkbookFormulaGraphReferenceKind[keyof typeof WorkbookFormulaGraphReferenceKind]

Dependency graph reference entry kind value.

typeWorkbookHistoryActionsource ↗
type WorkbookHistoryAction = typeof WorkbookHistoryAction[keyof typeof WorkbookHistoryAction]

History behavior attached to one workbook transaction.

typeWorkbookPluginDisposersource ↗
type WorkbookPluginDisposer = (): void

Resource disposer returned by Workbook plugin lifecycle hooks.

typeWorkbookRuntimeCapabilityReadersource ↗
type WorkbookRuntimeCapabilityReader = RuntimeCapabilityReader
typeWorkbookRuntimeCapabilityTokensource ↗
type WorkbookRuntimeCapabilityToken = RuntimeCapability<T>
typeWorkbookSessionStatesource ↗
type WorkbookSessionState = SessionStateSnapshot

Opaque editor-local workbook state keyed by contributor-owned definitions.

typeWorkbookSheetEditorFactorysource ↗
type WorkbookSheetEditorFactory = (input: WorkbookSheetEditorFactoryInput): SheetEditor
typeWorkbookSheetSessionStateCapturesource ↗
type WorkbookSheetSessionStateCapture = (input: WorkbookSheetSessionStateCaptureInput): SheetSessionState | undefined
typeWorkbookSheetStateCapturesource ↗
type WorkbookSheetStateCapture = (input: WorkbookSheetStateCaptureInput): SheetDocumentState
typeWorkbookTransactionReducersource ↗
type WorkbookTransactionReducer = (state: WorkbookTransactionState): WorkbookTransactionState

One pure staged workbook mutation.

variableActivateWorkbookSheetCommandsource ↗
ActivateWorkbookSheetCommand: WorkbookCommandDefinition<ActivateWorkbookSheetCommandInput, WorkbookCommandResult>

Official command for activating a workbook sheet.

variableAddWorkbookSheetCommandsource ↗
AddWorkbookSheetCommand: WorkbookCommandDefinition<AddWorkbookSheetCommandInput, WorkbookCommandResult>

Official command for adding a sheet descriptor and sheet state payload.

variableCancelWorkbookFormulaReferencePickCommandsource ↗
CancelWorkbookFormulaReferencePickCommand: WorkbookCommandDefinition<void, void>

Cancels a pending cross-sheet reference pick.

variableCaptureWorkbookFormulaDraftCommandsource ↗
CaptureWorkbookFormulaDraftCommand: WorkbookCommandDefinition<void, void>

Retains the source formula draft before activating another sheet.

variableCaptureWorkbookSessionStateCommandsource ↗
CaptureWorkbookSessionStateCommand: WorkbookCommandDefinition<void, CaptureWorkbookSessionStateCommandResult>
variableConnectWorkbookCollaborationCommandsource ↗
ConnectWorkbookCollaborationCommand: WorkbookCommandDefinition<{ options: CollaborationConnectOptions; sheetId: string }, Promise<void>>

Connects the long-lived collaboration channel for one Workbook sheet.

variableDisconnectWorkbookCollaborationCommandsource ↗
DisconnectWorkbookCollaborationCommand: WorkbookCommandDefinition<{ sheetId: string }, void>

Disconnects one Workbook-owned collaboration channel.

variableExportWorkbookStateCommandsource ↗
ExportWorkbookStateCommand: WorkbookCommandDefinition<void, ExportWorkbookStateCommandResult>
variableHideWorkbookSheetCommandsource ↗
HideWorkbookSheetCommand: WorkbookCommandDefinition<HideWorkbookSheetCommandInput, WorkbookCommandResult>

Official command for hiding a workbook sheet.

variableMoveWorkbookSheetCommandsource ↗
MoveWorkbookSheetCommand: WorkbookCommandDefinition<MoveWorkbookSheetInput, WorkbookCommandResult>

Official command for moving a workbook sheet tab.

variablePickWorkbookFormulaReferenceCommandsource ↗
PickWorkbookFormulaReferenceCommand: WorkbookCommandDefinition<{ end: Point; start: Point }, void>

Applies a picked range to the retained formula draft.

variableRecalculateWorkbookFormulasCommandsource ↗
RecalculateWorkbookFormulasCommand: WorkbookCommandDefinition<void, RecalculateWorkbookFormulasCommandResult>

Recalculates workbook-level formulas marked dirty by cross-sheet changes.

variableRedoWorkbookCommandsource ↗
RedoWorkbookCommand: WorkbookCommandDefinition<void, void>

Re-applies the most recently reverted workbook structure mutation.

variableRemoveWorkbookDefinedNameCommandsource ↗
RemoveWorkbookDefinedNameCommand: WorkbookCommandDefinition<{ name: string }, void>
variableRemoveWorkbookFormulaTableCommandsource ↗
RemoveWorkbookFormulaTableCommand: WorkbookCommandDefinition<{ name: string }, void>
variableRemoveWorkbookSheetCommandsource ↗
RemoveWorkbookSheetCommand: WorkbookCommandDefinition<RemoveWorkbookSheetCommandInput, WorkbookCommandResult>

Official command for removing a sheet descriptor and sheet state payload.

variableRenameWorkbookSheetCommandsource ↗
RenameWorkbookSheetCommand: WorkbookCommandDefinition<RenameWorkbookSheetInput, WorkbookCommandResult>

Official command for renaming a workbook sheet.

variableRestoreWorkbookFormulaDraftCommandsource ↗
RestoreWorkbookFormulaDraftCommand: WorkbookCommandDefinition<void, void>

Restores the retained draft when the source sheet becomes active again.

variableSetWorkbookDefinedNameCommandsource ↗
SetWorkbookDefinedNameCommand: WorkbookCommandDefinition<SetWorkbookDefinedNameInput, void>
variableSetWorkbookFormulaTableCommandsource ↗
SetWorkbookFormulaTableCommand: WorkbookCommandDefinition<WorkbookFormulaTable, void>
variableUndoWorkbookCommandsource ↗
UndoWorkbookCommand: WorkbookCommandDefinition<void, void>

Reverts the most recent committed workbook structure mutation.

variableUnhideWorkbookSheetCommandsource ↗
UnhideWorkbookSheetCommand: WorkbookCommandDefinition<UnhideWorkbookSheetCommandInput, WorkbookCommandResult>

Official command for unhiding a workbook sheet.

variableWorkbookActiveSheetEditorObservationsource ↗
WorkbookActiveSheetEditorObservation: StateObservationDefinition<WorkbookActiveSheetEditorSnapshot>

Current live active SheetEditor, updated only when the mounted editor changes.

variableWorkbookActiveSheetSessionStateDefinitionsource ↗
WorkbookActiveSheetSessionStateDefinition: SessionStateDefinition<string>

Stable session identity for the locally active workbook sheet.

variableWorkbookCollaborationCapabilitysource ↗
WorkbookCollaborationCapability: WorkbookRuntimeCapabilityToken<WorkbookCollaborationSession>
variableWorkbookCollaborationTransportFactorysource ↗
WorkbookCollaborationTransportFactory: { symbol: symbol }
variableWorkbookDocumentStateObservationsource ↗
WorkbookDocumentStateObservation: StateObservationDefinition<WorkbookDocumentState<SheetDocumentState>>

Current workbook-owned metadata and per-sheet document payloads.

variableWorkbookFormulaBindingsMetadataKeysource ↗
WorkbookFormulaBindingsMetadataKey: "searsuite.workbook.formulaBindings"

Runtime metadata holding bindings restored from a durable workbook file.

variableWorkbookFormulaBrokenReferenceReasonsource ↗
WorkbookFormulaBrokenReferenceReason: { ReferenceDeleted: "referenceDeleted"; SheetDeleted: "sheetDeleted" }

Reason a workbook formula reference can no longer resolve.

variableWorkbookFormulaGraphReferenceKindsource ↗
WorkbookFormulaGraphReferenceKind: { Broken: "broken" }

Dependency graph reference entry kinds that are not normal workbook formula references.

variableWorkbookFormulaObjectsMetadataKeysource ↗
WorkbookFormulaObjectsMetadataKey: "searsuite.workbook.formulaObjects"

Metadata key owned by workbook formula evaluation.

variableWorkbookFormulaObjectsObservationsource ↗
WorkbookFormulaObjectsObservation: StateObservationDefinition<WorkbookFormulaObjects>
variableWorkbookFormulaSheetTransactionObservationsource ↗
WorkbookFormulaSheetTransactionObservation: EventObservationDefinition<WorkbookFormulaSheetTransactionEvent>

WorkbookFormulaPlugin event stream for committed active-sheet transactions.

variableWorkbookFormulaStateObservationsource ↗
WorkbookFormulaStateObservation: StateObservationDefinition<WorkbookFormulaStateSnapshot>

WorkbookFormulaPlugin state exposed to diagnostic hosts.

variableWorkbookHistoryActionsource ↗
WorkbookHistoryAction: { Ignore: "ignore"; Record: "record"; Redo: "redo"; Undo: "undo" }

Controls whether a committed workbook transaction participates in structural history.

variableWorkbookHistorySessionStateDefinitionsource ↗
WorkbookHistorySessionStateDefinition: SessionStateDefinition<WorkbookHistorySessionState>

Session identity owned by workbook structural history.

variableWorkbookHistoryStatusObservationsource ↗
WorkbookHistoryStatusObservation: StateObservationDefinition<WorkbookHistoryStatus>

Typed workbook structural history status.

variableWorkbookRuntimeCapabilitysource ↗
WorkbookRuntimeCapability: { Commands: WorkbookRuntimeCapabilityToken<WorkbookCommandBus>; Formula: WorkbookRuntimeCapabilityToken<{ externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }>; Observations: WorkbookRuntimeCapabilityToken<ObservationRegistry>; Platform: WorkbookRuntimeCapabilityToken<Platform>; Runtime: WorkbookRuntimeCapabilityToken<WorkbookPluginRuntime>; Session: WorkbookRuntimeCapabilityToken<SessionStateRegistry> }

Workbook capabilities registered by the default assembly root.

variableWorkbookSheetSessionsStateDefinitionsource ↗
WorkbookSheetSessionsStateDefinition: SessionStateDefinition<Readonly<Record<string, Readonly<Record<string, unknown>>>>>

Stable session identity for detached SheetEditor snapshots keyed by sheet id.

functioncreateWorkbookEditorsource ↗
createWorkbookEditor(configuration: WorkbookEditorConfiguration): WorkbookEditor

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 = createWorkbookEditor(configuration);
await workbook.commands.run(ActivateWorkbookSheetCommand, { sheetId });
workbook.destroy();
configuration: WorkbookEditorConfiguration
Workbook document state, host adapters, and Workbook and Sheet plugins.
functiondefineWorkbookCommandsource ↗
defineWorkbookCommand<Input, Result>(id: string): WorkbookCommandDefinition<Input, Result>

Creates an immutable workbook-owned command contract.

id: string
functiondefineWorkbookRuntimeCapabilitysource ↗
defineWorkbookRuntimeCapability<T>(id: string): WorkbookRuntimeCapabilityToken<T>

Creates a typed capability published by a Workbook plugin.

id: string
functiondeserializeWorkbookDocumentStatesource ↗
deserializeWorkbookDocumentState<TSheetState>(payload: unknown, options?: WorkbookDocumentStateSerializationOptions<TSheetState>): WorkbookDocumentState<TSheetState>

Deserializes a stable SearSuite JSON workbook file into runtime document state.

payload: unknown
options: WorkbookDocumentStateSerializationOptions<TSheetState>
functionisWorkbookFormulaBrokenReferencesource ↗
isWorkbookFormulaBrokenReference(reference: WorkbookFormulaGraphReference): reference

Reports whether one workbook formula graph reference is a retained broken reference.

reference: WorkbookFormulaGraphReference
functionregisterDefaultWorkbookCommandssource ↗
registerDefaultWorkbookCommands(commands: WorkbookCommandBus, controller: WorkbookCommandController): void

Registers the built-in workbook commands on one workbook command bus.

commands: WorkbookCommandBus
controller: WorkbookCommandController
functionregisterWorkbookPluginCapabilitiessource ↗
registerWorkbookPluginCapabilities(plugins: readonly unknown[], registry: WorkbookRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by Workbook plugins.

plugins: readonly unknown[]
registry: WorkbookRuntimeExtensionRegistry
functionregisterWorkbookPluginCommandssource ↗
registerWorkbookPluginCommands(plugins: readonly unknown[], commands: WorkbookCommandBus): void
plugins: readonly unknown[]
commands: WorkbookCommandBus
functionregisterWorkbookPluginObservationssource ↗
registerWorkbookPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void
plugins: readonly unknown[]
observations: ObservationRegistry
functionregisterWorkbookPluginSessionStatessource ↗
registerWorkbookPluginSessionStates(plugins: readonly unknown[], session: SessionStateRegistry): void
plugins: readonly unknown[]
session: SessionStateRegistry
functionresolveWorkbookPluginssource ↗
resolveWorkbookPlugins(container: Container, implementations: readonly WorkbookPluginImplementation<WorkbookPlugin>[]): WorkbookPlugin[]

Resolves isolated Workbook plugin singletons from one editor-local container.

container: Container
implementations: readonly WorkbookPluginImplementation<WorkbookPlugin>[]
functionserializeWorkbookDocumentStatesource ↗
serializeWorkbookDocumentState<TSheetState>(documentState: WorkbookDocumentState<TSheetState>, options?: WorkbookDocumentStateSerializationOptions<TSheetState>): SearWorkbookFile<WorkbookSheetDescriptor>

Serializes a workbook document state into the stable SearSuite JSON format.

documentState: WorkbookDocumentState<TSheetState>
options: WorkbookDocumentStateSerializationOptions<TSheetState>
variableCommandExecutionPhasesource ↗
CommandExecutionPhase: { Completed: "completed"; Failed: "failed"; Started: "started" }

Stable lifecycle phases emitted by Sheet, Doc, and Workbook command buses.

Package

@searsuite/sear-domain-cell-types

50 exports

Built-in cell identities and commit strategies for text, numbers, formulas, and rich text.

namespaceICellFormatLocaleProvidersource ↗
ICellFormatLocaleProvider: unknown

DI token for resolving the current sheet's cell-format locale provider.

variablesymbol
symbol: typeof symbol
enumSheetHorizontalAlignmentsource ↗
enum SheetHorizontalAlignment

Horizontal alignment values supported by the built-in Sheet alignment feature.

enum memberCenter
Center: "center"
enum memberLeft
Left: "left"
enum memberRight
Right: "right"
enumSheetVerticalAlignmentsource ↗
enum SheetVerticalAlignment

Vertical alignment values supported by the built-in Sheet alignment feature.

enum memberBottom
Bottom: "bottom"
enum memberCenter
Center: "center"
enum memberTop
Top: "top"
classBooleanCellCommitStrategysource ↗
class BooleanCellCommitStrategy extends CellCommitStrategy

Recognizes directly entered spreadsheet logical literals.

constructorconstructor
BooleanCellCommitStrategy(): BooleanCellCommitStrategy
propertykey
readonly key: "boolean"

Stable identifier for this commit strategy.

propertypriority
readonly priority: 20

Ordering priority used when more than one strategy matches.

methodcommit
commit(context: CellCommitContext): CellMatrixElement

Converts matching edit input into a persisted cell value.

context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether this strategy can commit the supplied input.

context: CellCommitContext
classCellClipboardCodecRegistrysource ↗
class CellClipboardCodecRegistry

Editor-local registry for cell-type-owned clipboard behavior.

constructorconstructor
CellClipboardCodecRegistry(): CellClipboardCodecRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddecode
decode(payload: CellClipboardCellPayload, context: CellClipboardDecodeContext): CellMatrixElement | null
payload: CellClipboardCellPayload
context: CellClipboardDecodeContext
methoddecodePlainText
decodePlainText(text: string): CellMatrixElement | null
text: string
methodencode
encode(cell: CellMatrixElement): CellClipboardCellPayload
cell: CellMatrixElement
methodget
get(cellType: string): CellClipboardCodecDefinition | undefined
cellType: string
methodregister
register(codec: CellClipboardCodecDefinition): (): void
codec: CellClipboardCodecDefinition
methodtoPlainText
toPlainText(cell: CellMatrixElement): string
cell: CellMatrixElement
classCellCommitStrategysource ↗
class CellCommitStrategy extends CellCommitStrategyDefinition

Base class for reusable strategies; plain definitions can also be registered.

constructorconstructor
CellCommitStrategy(): CellCommitStrategy
propertykey
readonly key: string

Stable identifier for this commit strategy.

propertypriority
readonly priority: number

Ordering priority used when more than one strategy matches.

methodcommit
commit(context: CellCommitContext): CellMatrixElement | null

Converts matching edit input into a persisted cell value.

context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether this strategy can commit the supplied input.

context: CellCommitContext
classCellCommitStrategyRegistrysource ↗
class CellCommitStrategyRegistry

Extensible value-type registry. Hosts and plugins can add or replace input
classifiers without coupling their domain types to the cell editor.

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

DI token for resolving CellCommitStrategyRegistry.

methodcommit
commit(context: CellCommitContext): CellMatrixElement | null

Selects a matching strategy and commits the supplied edit input.

context: CellCommitContext
methodcommitWithFormat
commitWithFormat(context: CellCommitContext): { cell: CellMatrixElement | null; format: CellFormat | null }

Commits a value and returns any format inferred by its owning strategy.

context: CellCommitContext
methodget
get(key: string): CellCommitStrategyDefinition | undefined

Returns the value.

key: string
methodgetAll
getAll(): readonly CellCommitStrategyDefinition[]

Returns the all.

methodregister
register(strategy: CellCommitStrategyDefinition): (): void

Registers or replaces a strategy. The returned disposer restores the
replaced strategy when this registration remains active.

strategy: CellCommitStrategyDefinition
methodunregister
unregister(key: string): boolean

Unregisters the value.

key: string
classCellFormatTransferRegistrysource ↗
class CellFormatTransferRegistry

Editor-local cell-format codecs; unregistered types preserve their payload verbatim.

constructorconstructor
CellFormatTransferRegistry(): CellFormatTransferRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodapply
apply(cell: CellMatrixElement | null, format: Readonly<Record<string, unknown>>): CellMatrixElement | null
cell: CellMatrixElement | null
format: Readonly<Record<string, unknown>>
methodcapture
capture(cell: CellMatrixElement | null): Readonly<Record<string, unknown>>
cell: CellMatrixElement | null
methoddestroy
destroy(): void
methodregister
register(codec: CellFormatTransferCodec): (): void
codec: CellFormatTransferCodec
classDefaultStringCellCommitStrategysource ↗
class DefaultStringCellCommitStrategy extends CellCommitStrategy

Final fallback: persist otherwise-unclassified input as plain text.

constructorconstructor
DefaultStringCellCommitStrategy(): DefaultStringCellCommitStrategy
propertykey
readonly key: "fallback-string"

Stable identifier for the default string strategy.

propertypriority
readonly priority: 0

Ordering priority for the default string fallback.

methodcommit
commit(context: CellCommitContext): CellMatrixElement

Persists unmatched input as a string cell.

context: CellCommitContext
methodmatches
matches(): boolean

Matches input not claimed by a more specific strategy.

classEmptyCellCommitStrategysource ↗
class EmptyCellCommitStrategy extends CellCommitStrategy

Removes a cell when its editor document has no semantic text.

constructorconstructor
EmptyCellCommitStrategy(): EmptyCellCommitStrategy
propertykey
readonly key: "empty"

Stable identifier for the empty-cell strategy.

propertypriority
readonly priority: 100

Ordering priority for empty input.

methodcommit
commit(): null

Converts empty input into an absent cell value.

methodmatches
matches(context: CellCommitContext): boolean

Reports whether the input should clear the cell.

context: CellCommitContext
classFormulaCellCommitStrategysource ↗
class FormulaCellCommitStrategy extends CellCommitStrategy

Recognizes formula source and normalizes it before persistence.

constructorconstructor
FormulaCellCommitStrategy(): FormulaCellCommitStrategy
propertykey
readonly key: "formula"

Stable identifier for the formula strategy.

propertypriority
readonly priority: 90

Ordering priority for formula input.

methodcommit
commit(context: CellCommitContext): CellMatrixElement

Persists formula source without evaluating it.

context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether the input is formula source.

context: CellCommitContext
classNumberCellCommitStrategysource ↗
class NumberCellCommitStrategy extends CellCommitStrategy

Infers numeric values after more-specific domain types have had a chance to match.

constructorconstructor
NumberCellCommitStrategy(): NumberCellCommitStrategy
propertykey
readonly key: "number"

Stable identifier for the number strategy.

propertypriority
readonly priority: 10

Ordering priority for numeric input.

methodcommit
commit(context: CellCommitContext): CellMatrixElement

Persists input as a numeric cell.

context: CellCommitContext
methodinferFormat
inferFormat(context: CellCommitContext): CellFormat | null
context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether the input is a valid numeric value.

context: CellCommitContext
classRichTextCellCommitStrategysource ↗
class RichTextCellCommitStrategy extends CellCommitStrategy

Persists the document tree only when it contains durable inline/block semantics.

constructorconstructor
RichTextCellCommitStrategy(): RichTextCellCommitStrategy
propertykey
readonly key: "richtext"

Stable identifier for the rich-text strategy.

propertypriority
readonly priority: 110

Ordering priority for rich-text input.

methodcommit
commit(context: CellCommitContext): CellMatrixElement

Persists a cloned rich-document snapshot.

context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether the input is a rich-document snapshot.

context: CellCommitContext
classSheetCellInputValidationRegistrysource ↗
class SheetCellInputValidationRegistry

Editor-local validation contributions, evaluated before a cell edit commits.

constructorconstructor
SheetCellInputValidationRegistry(): SheetCellInputValidationRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodbeginTeardown
beginTeardown(token: object): void

Allows owner-controlled cleanup after command dispatch has ended.

token: object
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void, teardownToken: object): void

Closes direct writes once the editor finishes starting.

isExecuting: (): boolean
dispatchRemoval: (id: number): void
teardownToken: object
methodregister
register(id: string, validator: SheetCellInputValidator): (): void
id: string
validator: SheetCellInputValidator
methodunregister
unregister(registrationId: number): void

Removes one registration, dispatching through its command after assembly.

registrationId: number
methodvalidate
validate(row: number, column: number, text: string): SheetCellInputValidationResult
row: number
column: number
text: string
classSheetDisplayedValueChangessource ↗
class SheetDisplayedValueChanges

Editor-local fanout for changes to displayed cell values.

constructorconstructor
SheetDisplayedValueChanges(warn: (error: unknown): void): SheetDisplayedValueChanges
warn: (error: unknown): void
propertysymbolstatic
readonly symbol: typeof symbol
methoddispose
dispose(): void
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, runWithoutMutationAuthority: <Value>(callback: (): Value): Value): void

Seals publishing after startup while keeping host listeners outside command authority.

isExecuting: (): boolean
runWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodpublish
publish(cells: readonly SheetDisplayedValueCoordinate[]): void
cells: readonly SheetDisplayedValueCoordinate[]
methodsubscribe
subscribe(listener: SheetDisplayedValueChangeListener): (): void
listener: SheetDisplayedValueChangeListener
classTextCellCommitStrategysource ↗
class TextCellCommitStrategy extends CellCommitStrategy

Handles explicit text input: Text-format cells and apostrophe-prefixed values.

constructorconstructor
TextCellCommitStrategy(): TextCellCommitStrategy
propertykey
readonly key: "string"

Stable identifier for the explicit text strategy.

propertypriority
readonly priority: 80

Ordering priority for explicit text input.

methodcommit
commit(context: CellCommitContext): CellMatrixElement

Persists input as an explicit text cell.

context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether the input is explicitly typed as text.

context: CellCommitContext
interfaceCellClipboardCellPayloadsource ↗
interface CellClipboardCellPayload

JSON-safe representation owned by the cell type that produced it.

propertydata
readonly data: unknown
propertytype
readonly type: string
interfaceCellClipboardCodecDefinitionsource ↗
interface CellClipboardCodecDefinition

Clipboard behavior contributed by one persisted cell type.

propertycellType
readonly cellType: string
methoddecode
decode(data: unknown, context: CellClipboardDecodeContext): CellMatrixElement | null
data: unknown
context: CellClipboardDecodeContext
methoddecodePlainText
decodePlainText(text: string): CellMatrixElement | null
text: string
methodencode
encode(cell: CellMatrixElement): unknown
cell: CellMatrixElement
methodrebase
rebase(cell: CellMatrixElement, context: CellClipboardDecodeContext): CellMatrixElement
cell: CellMatrixElement
context: CellClipboardDecodeContext
methodtoPlainText
toPlainText(cell: CellMatrixElement): string
cell: CellMatrixElement
interfaceCellClipboardDecodeContextsource ↗
interface CellClipboardDecodeContext

Context used by a cell type when a native clipboard cell is pasted elsewhere.

propertycolumnDelta
readonly columnDelta: number
propertyrowDelta
readonly rowDelta: number
interfaceCellCommitContextsource ↗
interface CellCommitContext

Input available when the cell editor commits one edited cell.

propertycol
col: number
propertyformat
format?: CellFormat | null

Explicit format read from the Sheet cell-format state owner.

propertyformatLocale
formatLocale?: CellFormatLocale

Locale used to interpret the formatted editor text.

propertyplainText
plainText: string
propertyprevious
previous: CellMatrixElement | null
propertyrichText
richText: RichDocNode[]
propertyrow
row: number
interfaceCellCommitStrategyDefinitionsource ↗
interface CellCommitStrategyDefinition

Contract for deciding how editor input becomes persisted cell data.

propertykey
readonly key: string
propertypriority
readonly priority: number
methodcommit
commit(context: CellCommitContext): CellMatrixElement | null
context: CellCommitContext
methodinferFormat
inferFormat(context: CellCommitContext): CellFormat | null
context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean
context: CellCommitContext
interfaceCellFormatLocalesource ↗
interface CellFormatLocale

Locale defaults used when a cell format does not declare explicit display settings.

propertydatePattern
readonly datePattern: string
propertydateTimePattern
readonly dateTimePattern: string
propertydecimalSeparator
readonly decimalSeparator?: string
propertygroupSeparator
readonly groupSeparator?: string
propertylocale
readonly locale: string
propertytimePattern
readonly timePattern: string
interfaceCellFormatTransferCodecsource ↗
interface CellFormatTransferCodec

Type-owned format projection that never substitutes source values for target values.

propertycellType
readonly cellType: string
methodapply
apply(cell: CellMatrixElement, format: Readonly<Record<string, unknown>>): CellMatrixElement
cell: CellMatrixElement
format: Readonly<Record<string, unknown>>
methodcapture
capture(cell: CellMatrixElement): Readonly<Record<string, unknown>>
cell: CellMatrixElement
interfaceICellFormatLocaleProvidersource ↗
interface ICellFormatLocaleProvider

Provides sheet-local defaults for number and date/time display formatting.

methodgetCellFormatLocale
getCellFormatLocale(): CellFormatLocale
interfaceSheetCellInputValidationResultsource ↗
interface SheetCellInputValidationResult

Result of validating a proposed cell edit.

propertymessage
readonly message?: string
propertyreject
readonly reject: boolean
propertyruleId
readonly ruleId?: string
propertyvalid
readonly valid: boolean
interfaceSheetDisplayedValueCoordinatesource ↗
interface SheetDisplayedValueCoordinate

A cell whose displayed value changed after a derived value update.

propertycolumn
readonly column: number
propertyrow
readonly row: number
typeCellFormatsource ↗
type CellFormat = { kind: "general" } | { kind: "text" } | { code: string; kind: "excelCode" } | { kind: "number"; locale?: string; maximumFractionDigits?: number; minimumFractionDigits?: number; useGrouping?: boolean } | { kind: "percent"; locale?: string; maximumFractionDigits?: number; minimumFractionDigits?: number } | { currency: string; kind: "currency"; locale?: string; maximumFractionDigits?: number; minimumFractionDigits?: number } | { kind: "date"; pattern?: string } | { kind: "time"; pattern?: string } | { kind: "dateTime"; pattern?: string }

Cell formatting changes input interpretation and display only, never the raw value for display purposes.

typeCellTypesource ↗
type CellType = typeof CellType[keyof typeof CellType]

Type contract for CellType.

typeSheetCellInputValidatorsource ↗
type SheetCellInputValidator = (row: number, column: number, text: string): SheetCellInputValidationResult
typeSheetDisplayedValueChangeListenersource ↗
type SheetDisplayedValueChangeListener = (cells: readonly SheetDisplayedValueCoordinate[]): void
variableCellFormatssource ↗
CellFormats: { date: { kind: "date" }; dateTime: { kind: "dateTime" }; general: { kind: "general" }; number: { kind: "number" }; percent: { kind: "percent" }; text: { kind: "text" }; time: { kind: "time" }; currency: unknown; … }
variableCellTypesource ↗
CellType: { Boolean: "boolean"; Empty: "empty"; Formula: "formula"; Number: "number"; RichText: "richtext"; String: "string" }

Built-in persisted cell type identifiers.

Consumers may use arbitrary strings for their own types; these constants
keep the built-in values consistent across editing, rendering and formulas.

variableDefaultCellFormatLocalesource ↗
DefaultCellFormatLocale: CellFormatLocale

Excel-compatible formatting defaults used when no i18n plugin is installed.

functionadjustCellFormatDecimalPlacessource ↗
adjustCellFormatDecimalPlaces(format: unknown, delta: number): CellFormat

Adjusts the visible decimal-place count of numeric built-in formats.

format: unknown
delta: number
functionassertCellExtensionWritesource ↗
assertCellExtensionWrite(owner: object): void

Checks registration changes only; cell reads and rendering stay on their existing hot paths.

owner: object
functionassertSheetHorizontalAlignmentsource ↗
assertSheetHorizontalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet horizontal alignments.

value: unknown
functionassertSheetVerticalAlignmentsource ↗
assertSheetVerticalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet vertical alignments.

value: unknown
functioncellFormatToExcelCodesource ↗
cellFormatToExcelCode(format: unknown): string | undefined

Converts an explicit cell format into the Excel-style code exposed to formula metadata readers.

format: unknown
functioncreateDefaultCellFormatLocaleProvidersource ↗
createDefaultCellFormatLocaleProvider(): ICellFormatLocaleProvider

Creates the default cell-format locale provider.

functioncreateGeneralNumberDisplayCandidatessource ↗
createGeneralNumberDisplayCandidates(value: number): readonly string[]

Returns General-format candidates from most informative to most compact.

value: number
functionformatCellNumbersource ↗
formatCellNumber(value: number, format: unknown, locale?: CellFormatLocale): string

Runs the format cell number helper.

value: number
format: unknown
locale: CellFormatLocale
functionformatCellNumberDisplaysource ↗
formatCellNumberDisplay(value: number, format: unknown, locale?: CellFormatLocale): SpreadsheetFormatDisplay

Formats one numeric cell and preserves format-section visual metadata.

value: number
format: unknown
locale: CellFormatLocale
functionformatCellTextsource ↗
formatCellText(value: string, format: unknown, locale?: CellFormatLocale): string

Applies the fourth custom-format section to a text cell.

value: string
format: unknown
locale: CellFormatLocale
functioninterpretNumberInputsource ↗
interpretNumberInput(source: string, currentFormat: CellFormat | null | undefined, locale?: CellFormatLocale): { format?: CellFormat; value: number } | null

Parses direct numeric/date input and suggests a display format for General cells.

source: string
currentFormat: CellFormat | null | undefined
locale: CellFormatLocale
functionisSheetHorizontalAlignmentsource ↗
isSheetHorizontalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet horizontal alignment.

value: unknown
functionisSheetVerticalAlignmentsource ↗
isSheetVerticalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet vertical alignment.

value: unknown
functionnormalizeCellFormatsource ↗
normalizeCellFormat(value: unknown): CellFormat

Normalizes a public CellFormat object, falling back to General for invalid input.

value: unknown
functionparseFormattedNumbersource ↗
parseFormattedNumber(text: string, format: unknown, locale?: CellFormatLocale): number | undefined

Runs the parse formatted number helper.

text: string
format: unknown
locale: CellFormatLocale
functionsealCellExtensionWritessource ↗
sealCellExtensionWrites(owner: object, assertWrite: (): void): void

Seals an editor-local cell extension owner after setup contributions are registered.

owner: object
assertWrite: (): void
interfaceCellMatrixElementsource ↗
interface CellMatrixElement

Persisted cell payload stored in the sheet matrix.

propertyformula
formula?: string

Formula source text for formula cells; calculated results live in formula plugin state.

propertyformulaEvaluationMode
formulaEvaluationMode?: "dynamic" | "legacy"

Array evaluation mode used when the formula was entered.

propertytype
type: string

Cell type identifier owned by the cell type catalog.

propertyvalue
value?: unknown

Raw value whose shape is owned by the cell type.

Package

@searsuite/sear-domain-cell

13 exports

Cell catalogs that compose commit, display, render, and clipboard behavior.

classCellDisplayTextRegistrysource ↗
class CellDisplayTextRegistry

Maps persisted cell types to their display-text semantics without creating render Cells.

constructorconstructor
CellDisplayTextRegistry(platform: Platform): CellDisplayTextRegistry

Creates a CellDisplayTextRegistry instance.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving CellDisplayTextRegistry.

methodgetDisplayText
getDisplayText(cell: CellDisplayData, context: CellDisplayContext): string

Returns the display text.

cell: CellDisplayData
context: CellDisplayContext
methodregister
register(provider: CellDisplayTextProvider): (): void

Registers the value.

provider: CellDisplayTextProvider
classCellRenderDefinitionsource ↗
class CellRenderDefinition

A rendering-only sheet cell definition, such as an editor overlay or header affix.

constructorconstructor
CellRenderDefinition(): CellRenderDefinition
propertytype
readonly type: string | symbol

Stable type key for CellRenderDefinition.

methodcreateRenderer
createRenderer(): CellRendererDefinition

Creates the renderer.

classCellTypeCatalogsource ↗
class CellTypeCatalog

Workbook catalog of available persisted cell types and render-only cell roles.

Registering a definition installs all of its capabilities atomically into
the specialised registries; disposing it restores the definition it replaced.

constructorconstructor
CellTypeCatalog(commitStrategies: CellCommitStrategyRegistry, displayTexts: CellDisplayTextRegistry, renderCoordinator: SheetRenderCoordinatorManager, clipboardCodecs: CellClipboardCodecRegistry, formatCodecs?: CellFormatTransferRegistry): CellTypeCatalog

Creates a catalog over the specialised commit, display-text and renderer registries.

commitStrategies: CellCommitStrategyRegistry
displayTexts: CellDisplayTextRegistry
renderCoordinator: SheetRenderCoordinatorManager
clipboardCodecs: CellClipboardCodecRegistry
formatCodecs: CellFormatTransferRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the workbook cell type catalog.

methodget
get(type: string | symbol): CellRenderDefinition | undefined

Returns the registered definition for a type key.

type: string | symbol
methodgetAll
getAll(): readonly CellRenderDefinition[]

Returns all registered definitions in insertion order.

methodgetDisplayText
getDisplayText(cell: CellDisplayData, context: CellDisplayContext): string

Resolves display text through the registered provider for a persisted cell type.

cell: CellDisplayData
context: CellDisplayContext
methodregister
register(definition: CellRenderDefinition): (): void

Registers a definition atomically and returns a disposer that restores the previous definition.

definition: CellRenderDefinition
methodunregister
unregister(type: string | symbol): boolean

Unregisters a definition by type key.

type: string | symbol
methodinstallstatic
install(container: Container): void

Registers implementation registries without exposing them from the package entry point.

container: Container
classCellTypeDefinitionsource ↗
class CellTypeDefinition extends CellRenderDefinition

A persisted spreadsheet cell type and all behaviours associated with it.

constructorconstructor
CellTypeDefinition(): CellTypeDefinition
propertytype
readonly type: string

Persisted cell type identifier stored on sheet cell data.

methodcreateClipboardCodec
createClipboardCodec(): CellClipboardCodecDefinition | undefined

Creates clipboard behavior owned by this persisted cell type.

methodcreateCommitStrategies
createCommitStrategies(): readonly CellCommitStrategyDefinition[]

Creates commit strategies associated with this cell type.

methodcreateDisplayTextProvider
createDisplayTextProvider(): CellDisplayTextProvider | undefined

Creates the display-text provider associated with this cell type.

methodcreateFormatTransferCodec
createFormatTransferCodec(): CellFormatTransferCodec | undefined

Optional format-transfer behavior owned by this cell type.

methodcreateRenderer
createRenderer(): CellRendererDefinition

Creates the renderer definition associated with this cell type.

methodisStoredValue
isStoredValue(_cell: { formula?: unknown; value?: unknown }): boolean

Validates persisted data before it reaches a renderer-specific Cell.

_cell: { formula?: unknown; value?: unknown }
interfaceCellDisplayContextsource ↗
interface CellDisplayContext

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.

propertycellFormatLocale
cellFormatLocale?: CellFormatLocale
propertycol
col?: number
propertyformulaResultProvider
formulaResultProvider?: FormulaResultReader
propertyrow
row?: number
interfaceCellDisplayDatasource ↗
interface CellDisplayData

Persisted data required to derive a cell's plain-text representation.

propertyformat
format?: unknown
propertyformula
formula?: string
propertytype
type: string | symbol
propertyvalue
value?: unknown
interfaceCellDocumentFormattingsource ↗
interface CellDocumentFormatting

Pure document formatting supplied by an embedded editor implementation.

methodapply
apply(document: readonly Schema[], format: Readonly<Record<string, unknown>>): Schema[]
document: readonly Schema[]
format: Readonly<Record<string, unknown>>
methodcapture
capture(document: readonly Schema[]): Readonly<Record<string, unknown>>
document: readonly Schema[]
interfaceCellRendererDefinitionsource ↗
interface CellRendererDefinition

Render contribution belonging to one spreadsheet cell definition.

propertycellType
readonly cellType: string | symbol
methodregister
register(renderCoordinator: SheetRenderCoordinatorManager): (): void
renderCoordinator: SheetRenderCoordinatorManager
interfaceFormulaResultReadersource ↗
interface FormulaResultReader

Minimal formula-result capability required by formula display text.

methodgetFormulaResult
getFormulaResult(row: number, col: number): unknown
row: number
col: number
functioncreateFormulaCellClipboardCodecsource ↗
createFormulaCellClipboardCodec(): CellClipboardCodecDefinition

Clipboard behavior for formula source text and relative references.

functiondefineCellRenderersource ↗
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.

cellType: string | symbol
cell: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<DataType>
functionregisterBuiltinCellDefinitionssource ↗
registerBuiltinCellDefinitions(catalog: CellTypeCatalog): (): void

Registers built-in cell definitions and returns a disposer in reverse order.

catalog: CellTypeCatalog
functionregisterTextFormatTransferCodecssource ↗
registerTextFormatTransferCodecs(registry: CellFormatTransferRegistry, readFormatting: (): CellDocumentFormatting | undefined): (): void

Text cell type composition; numeric and formula values remain with their own codecs.

registry: CellFormatTransferRegistry
readFormatting: (): CellDocumentFormatting | undefined

Package

@searsuite/sear-domain-collaboration

17 exports

Host-neutral revision, pending-operation, acknowledgement, catch-up, and rebase algorithms.

classCollaborationAuthoritysource ↗
class CollaborationAuthority

In-memory authority that validates, rebases, orders, and deduplicates collaboration batches.

constructorconstructor
CollaborationAuthority(contributors: CollaborationContributorRegistry): CollaborationAuthority
contributors: CollaborationContributorRegistry
methodaccept
accept(submission: CollaborationSubmission): CollaborationAcceptedBatch

Accepts one client submission into the canonical resource order.

submission: CollaborationSubmission
methodsync
sync(resourceId: string, fromRevision: number): CollaborationSyncMessage

Returns ordered canonical batches after a known revision.

resourceId: string
fromRevision: number
classCollaborationContributorRegistrysource ↗
class CollaborationContributorRegistry

Owner-to-OT mapping used by clients, authorities, and editor bridges.

constructorconstructor
CollaborationContributorRegistry(operations: TransactionOTRegistry): CollaborationContributorRegistry
operations: TransactionOTRegistry
propertyoperations
readonly operations: TransactionOTRegistry
methoddestroy
destroy(): void
methodgetRegisteredOwnerIds
getRegisteredOwnerIds(): readonly string[]
methodhas
has(ownerId: string): boolean
ownerId: string
methodregister
register<OperationType>(ownerId: string, definition: TransactionOTDefinition<OperationType>, relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]): (): void

Registers one collaborative state owner and returns an idempotent disposer.

ownerId: string
definition: TransactionOTDefinition<OperationType>
relations: readonly OTTransformRelation<OTOperation, OTOperation>[]
methodrequire
require(ownerId: string, operationType?: CollaborationOperationType): TransactionOTDefinition

Resolves one registered owner and optionally validates its wire operation type.

ownerId: string
operationType: CollaborationOperationType
classCollaborationEnginesource ↗
class CollaborationEngine

Single client-side collaboration algorithm shared by all editor bridges.

constructorconstructor
CollaborationEngine(contributors: CollaborationContributorRegistry): CollaborationEngine
contributors: CollaborationContributorRegistry
methodconnect
connect(resourceId: string, clientId: string, revision?: number): void

Starts one resource session from a host-supplied document revision.

resourceId: string
clientId: string
revision: number
methoddisconnect
disconnect(): void

Ends the current session and releases transient pending state.

methodgetPendingCount
getPendingCount(): number
methodgetRevision
getRevision(): number
methodreceive
receive(message: CollaborationServerMessage): readonly CollaborationEngineEffect[]

Applies one authority message and returns host/transport effects in deterministic order.

message: CollaborationServerMessage
methodsubmitLocal
submitLocal<OperationType>(ownerId: string, operations: readonly OperationType[]): readonly CollaborationEngineEffect[]

Queues one already-committed local transaction and emits at most one in-flight submission.

ownerId: string
operations: readonly OperationType[]
classCollaborationErrorsource ↗
class CollaborationError extends SearError

Public collaboration failure with stable diagnostics.

constructorconstructor
CollaborationError(code: CollaborationErrorCode, message: string, details?: SearErrorDetails): CollaborationError
code: CollaborationErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: CollaborationErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
interfaceCollaborationAcceptedBatchsource ↗
interface CollaborationAcceptedBatch

Canonical operation batch accepted and ordered by the authority.

propertybaseRevision
readonly baseRevision: number
propertyclientId
readonly clientId: string
propertykind
readonly kind: "accepted"
propertyoperationId
readonly operationId: string
propertyoperationType
readonly operationType: CollaborationOperationType
propertyownerId
readonly ownerId: string
propertypayload
readonly payload: OTEncodedValue
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
propertyserverRevision
readonly serverRevision: number
interfaceCollaborationContributionsource ↗
interface CollaborationContribution<OperationType>

Open collaboration contribution shared by editor clients and authorities.

propertydefinition
readonly definition: TransactionOTDefinition<OperationType>
propertyownerId
readonly ownerId: string
propertyrelations
readonly relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]
interfaceCollaborationOperationTypesource ↗
interface CollaborationOperationType

Versioned OT family identity carried on the wire.

propertyid
readonly id: string
propertyversion
readonly version: number
interfaceCollaborationRejectedMessagesource ↗
interface CollaborationRejectedMessage

Explicit authority rejection; clients must not infer recovery from dropped frames.

propertycode
readonly code: string
propertykind
readonly kind: "rejected"
propertymessage
readonly message: string
propertyoperationId
readonly operationId?: string
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
interfaceCollaborationSubmissionsource ↗
interface CollaborationSubmission

Client submission before the authority assigns a canonical revision.

propertybaseRevision
readonly baseRevision: number
propertyclientId
readonly clientId: string
propertykind
readonly kind: "submit"
propertyoperationId
readonly operationId: string
propertyoperationType
readonly operationType: CollaborationOperationType
propertyownerId
readonly ownerId: string
propertypayload
readonly payload: OTEncodedValue
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
interfaceCollaborationSyncMessagesource ↗
interface CollaborationSyncMessage

Ordered catch-up response sent when a transport joins a resource.

propertybatches
readonly batches: readonly CollaborationAcceptedBatch[]
propertyfromRevision
readonly fromRevision: number
propertykind
readonly kind: "sync"
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
propertyserverRevision
readonly serverRevision: number
typeCollaborationClientMessagesource ↗
type CollaborationClientMessage = CollaborationSubmission
typeCollaborationEngineEffectsource ↗
type CollaborationEngineEffect = { kind: "send"; submission: CollaborationSubmission } | { kind: "applyRemote"; operations: readonly OTOperation[]; ownerId: string; serverRevision: number }

Effects emitted by the pure collaboration client state machine.

typeCollaborationErrorCodesource ↗
type CollaborationErrorCode = typeof CollaborationErrorCode[keyof typeof CollaborationErrorCode]

Stable collaboration protocol and state-machine errors.

typeCollaborationServerMessagesource ↗
type CollaborationServerMessage = CollaborationAcceptedBatch | CollaborationSyncMessage | CollaborationRejectedMessage
variableCollaborationErrorCodesource ↗
CollaborationErrorCode: { AcknowledgementMismatch: "SEAR_COLLABORATION_ACKNOWLEDGEMENT_MISMATCH"; EngineDisconnected: "SEAR_COLLABORATION_ENGINE_DISCONNECTED"; InvalidIdentity: "SEAR_COLLABORATION_INVALID_IDENTITY"; InvalidProtocol: "SEAR_COLLABORATION_INVALID_PROTOCOL"; InvalidRevision: "SEAR_COLLABORATION_INVALID_REVISION"; OperationRejected: "SEAR_COLLABORATION_OPERATION_REJECTED"; OwnerConflict: "SEAR_COLLABORATION_OWNER_CONFLICT"; OwnerNotRegistered: "SEAR_COLLABORATION_OWNER_NOT_REGISTERED"; … }

Stable collaboration protocol and state-machine errors.

variableCollaborationProtocolVersionsource ↗
CollaborationProtocolVersion: 1

Current collaboration wire protocol version.

variableCollaborationErrorCodeTypesource ↗
CollaborationErrorCodeType: { AcknowledgementMismatch: "SEAR_COLLABORATION_ACKNOWLEDGEMENT_MISMATCH"; EngineDisconnected: "SEAR_COLLABORATION_ENGINE_DISCONNECTED"; InvalidIdentity: "SEAR_COLLABORATION_INVALID_IDENTITY"; InvalidProtocol: "SEAR_COLLABORATION_INVALID_PROTOCOL"; InvalidRevision: "SEAR_COLLABORATION_INVALID_REVISION"; OperationRejected: "SEAR_COLLABORATION_OPERATION_REJECTED"; OwnerConflict: "SEAR_COLLABORATION_OWNER_CONFLICT"; OwnerNotRegistered: "SEAR_COLLABORATION_OWNER_NOT_REGISTERED"; … }

Stable collaboration protocol and state-machine errors.

Package

@searsuite/sear-domain-commands

14 exports

Typed command definitions and the editor-local command bus contract.

enumDocTransactionRenderOperationTypesource ↗
enum DocTransactionRenderOperationType

Render pipeline effect declared by a document command transaction.

enum memberReflow
Reflow: "reflow"
enum memberRepaint
Repaint: "repaint"
classDocTransactionsource ↗
class DocTransaction

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.

constructorconstructor
DocTransaction(): DocTransaction
propertymeta
readonly meta: Record<string, unknown>

Command metadata consumed by the document editor host.

propertyrenderOperationType
readonly renderOperationType: DocTransactionRenderOperationType

Render pipeline effect produced by this document transaction.

propertysteps
readonly steps: DocStep[]

Ordered steps produced by the command.

methodaddStep
addStep(step: DocStep): this

Appends a prepared document step.

ReturnsThe current transaction for chaining.

step: DocStep
Step to run during transaction application.
methoddeleteNode
deleteNode(path: number[], nodeSnapshot: NodeSchema): this

Appends a node deletion step.

ReturnsThe current transaction for chaining.

path: number[]
Path of the node to delete.
nodeSnapshot: NodeSchema
Deleted node payload used for OT inversion.
methoddeleteText
deleteText(path: number[], offset: number, text: string): this

Appends a text deletion step.

ReturnsThe current transaction for chaining.

path: number[]
Path to the text node.
offset: number
String offset where deletion starts.
text: string
Exact text expected to be deleted.
methodgetMeta
getMeta<T>(key: string): T | undefined

Reads command metadata by key.

ReturnsThe stored value when present.

key: string
Metadata key.
methodinsertNode
insertNode(path: number[], node: NodeSchema): this

Appends a node insertion step.

ReturnsThe current transaction for chaining.

path: number[]
Target insertion path.
node: NodeSchema
Node payload to insert.
methodinsertText
insertText(path: number[], offset: number, text: string): this

Appends a text insertion step.

ReturnsThe current transaction for chaining.

path: number[]
Path to the text node.
offset: number
String offset where text is inserted.
text: string
Text to insert.
methodsetInlineTextStyle
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.

doc: RichDocNode[]
selection: DocSelection
property: string
value: unknown
patchAttrs: InlineTextRangeAttrsPatcher
methodsetMeta
setMeta(key: string, value: unknown): this

Stores command metadata.

ReturnsThe current transaction for chaining.

key: string
Metadata key.
value: unknown
Metadata value.
methodsetSelection
setSelection(sel: DocSelection): this

Appends a selection-only step.

ReturnsThe current transaction for chaining.

sel: DocSelection
Selection that should be active after this transaction.
methodupdateAttrs
updateAttrs(path: number[], key: string, value: unknown, prev: unknown): this

Appends one attribute update operation and retains its previous value for inversion.

path: number[]
key: string
value: unknown
prev: unknown
classReflowDocTransactionsource ↗
class ReflowDocTransaction extends DocTransaction

Document transaction whose RichDoc OT operations may change layout measurement.

constructorconstructor
ReflowDocTransaction(): ReflowDocTransaction
propertymetainherited
readonly meta: Record<string, unknown>

Command metadata consumed by the document editor host.

propertyrenderOperationType
readonly renderOperationType: Reflow

Render pipeline effect produced by this document transaction.

propertystepsinherited
readonly steps: DocStep[]

Ordered steps produced by the command.

methodaddStepinherited
addStep(step: DocStep): this

Appends a prepared document step.

ReturnsThe current transaction for chaining.

step: DocStep
Step to run during transaction application.
methoddeleteNodeinherited
deleteNode(path: number[], nodeSnapshot: NodeSchema): this

Appends a node deletion step.

ReturnsThe current transaction for chaining.

path: number[]
Path of the node to delete.
nodeSnapshot: NodeSchema
Deleted node payload used for OT inversion.
methoddeleteTextinherited
deleteText(path: number[], offset: number, text: string): this

Appends a text deletion step.

ReturnsThe current transaction for chaining.

path: number[]
Path to the text node.
offset: number
String offset where deletion starts.
text: string
Exact text expected to be deleted.
methodgetMetainherited
getMeta<T>(key: string): T | undefined

Reads command metadata by key.

ReturnsThe stored value when present.

key: string
Metadata key.
methodinsertNodeinherited
insertNode(path: number[], node: NodeSchema): this

Appends a node insertion step.

ReturnsThe current transaction for chaining.

path: number[]
Target insertion path.
node: NodeSchema
Node payload to insert.
methodinsertTextinherited
insertText(path: number[], offset: number, text: string): this

Appends a text insertion step.

ReturnsThe current transaction for chaining.

path: number[]
Path to the text node.
offset: number
String offset where text is inserted.
text: string
Text to insert.
methodsetInlineTextStyleinherited
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.

doc: RichDocNode[]
selection: DocSelection
property: string
value: unknown
patchAttrs: InlineTextRangeAttrsPatcher
methodsetMetainherited
setMeta(key: string, value: unknown): this

Stores command metadata.

ReturnsThe current transaction for chaining.

key: string
Metadata key.
value: unknown
Metadata value.
methodsetSelectioninherited
setSelection(sel: DocSelection): this

Appends a selection-only step.

ReturnsThe current transaction for chaining.

sel: DocSelection
Selection that should be active after this transaction.
methodupdateAttrsinherited
updateAttrs(path: number[], key: string, value: unknown, prev: unknown): this

Appends one attribute update operation and retains its previous value for inversion.

path: number[]
key: string
value: unknown
prev: unknown
classRepaintDocTransactionsource ↗
class RepaintDocTransaction extends DocTransaction

Document transaction whose RichDoc OT operations only require repainting existing layout.

constructorconstructor
RepaintDocTransaction(): RepaintDocTransaction
propertymetainherited
readonly meta: Record<string, unknown>

Command metadata consumed by the document editor host.

propertyrenderOperationType
readonly renderOperationType: Repaint

Render pipeline effect produced by this document transaction.

propertystepsinherited
readonly steps: DocStep[]

Ordered steps produced by the command.

methodaddStepinherited
addStep(step: DocStep): this

Appends a prepared document step.

ReturnsThe current transaction for chaining.

step: DocStep
Step to run during transaction application.
methoddeleteNodeinherited
deleteNode(path: number[], nodeSnapshot: NodeSchema): this

Appends a node deletion step.

ReturnsThe current transaction for chaining.

path: number[]
Path of the node to delete.
nodeSnapshot: NodeSchema
Deleted node payload used for OT inversion.
methoddeleteTextinherited
deleteText(path: number[], offset: number, text: string): this

Appends a text deletion step.

ReturnsThe current transaction for chaining.

path: number[]
Path to the text node.
offset: number
String offset where deletion starts.
text: string
Exact text expected to be deleted.
methodgetMetainherited
getMeta<T>(key: string): T | undefined

Reads command metadata by key.

ReturnsThe stored value when present.

key: string
Metadata key.
methodinsertNodeinherited
insertNode(path: number[], node: NodeSchema): this

Appends a node insertion step.

ReturnsThe current transaction for chaining.

path: number[]
Target insertion path.
node: NodeSchema
Node payload to insert.
methodinsertTextinherited
insertText(path: number[], offset: number, text: string): this

Appends a text insertion step.

ReturnsThe current transaction for chaining.

path: number[]
Path to the text node.
offset: number
String offset where text is inserted.
text: string
Text to insert.
methodsetInlineTextStyleinherited
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.

doc: RichDocNode[]
selection: DocSelection
property: string
value: unknown
patchAttrs: InlineTextRangeAttrsPatcher
methodsetMetainherited
setMeta(key: string, value: unknown): this

Stores command metadata.

ReturnsThe current transaction for chaining.

key: string
Metadata key.
value: unknown
Metadata value.
methodsetSelectioninherited
setSelection(sel: DocSelection): this

Appends a selection-only step.

ReturnsThe current transaction for chaining.

sel: DocSelection
Selection that should be active after this transaction.
methodupdateAttrsinherited
updateAttrs(path: number[], key: string, value: unknown, prev: unknown): this

Appends one attribute update operation and retains its previous value for inversion.

path: number[]
key: string
value: unknown
prev: unknown
interfaceDocCommandContextsource ↗
interface DocCommandContext

Runtime state available while a rich-document command builds a transaction.

propertydocSelection
docSelection: DocSelection

Current document selection before the command applies.

propertylastSnapshot
lastSnapshot: LayoutSnapshot | null

Last measured layout snapshot, required for vertical cursor movement.

propertypendingDoc
pendingDoc: RichDocNode[]

Pending document tree used for reads before the transaction is committed.

propertypreferredX
preferredX: number | null

Preferred horizontal position used by repeated vertical cursor navigation.

interfaceDocStepsource ↗
interface DocStep

One atomic document transaction step with its selection mapping logic.

propertyops
ops: RichDocOTOperation[]

Rich-document OT operations produced by this step.

methodmapSelection
mapSelection(sel: DocSelection, newDoc: RichDocNode[]): DocSelection

Maps an existing selection through the step.

ReturnsSelection rebased onto newDoc.

sel: DocSelection
Selection before this step.
newDoc: RichDocNode[]
Document state after this step.
typeDocCommandsource ↗
type DocCommand = (tr: DocTransaction, state: DocCommandContext): DocTransaction

Rich-document command that appends steps to a transaction.

typeDocCursorDirectionsource ↗
type DocCursorDirection = typeof DocCursorDirection[keyof typeof DocCursorDirection]

Union of cursor directions accepted by rich-document navigation.

variableDocCursorDirectionsource ↗
DocCursorDirection: { Down: "down"; Left: "left"; Right: "right"; Up: "up" }

Cardinal directions accepted by rich-document cursor navigation commands.

functiondeleteBackwardCommandsource ↗
deleteBackwardCommand(): DocCommand

Creates a command for Backspace behavior.

ReturnsCommand that deletes a selection, deletes the previous character, or merges with the previous paragraph.

functioninputCommandsource ↗
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: string
Text to insert into the rich document.
functionmoveCursorCommandsource ↗
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: DocCursorDirection
Navigation direction.
shiftKey: boolean
Whether the movement should extend selection.
layoutEngine: DocLayoutEngine
Layout engine used for vertical line navigation.
functionselectAllCommandsource ↗
selectAllCommand(): DocCommand

Creates a command that selects the complete rich document.

ReturnsSelection-only command spanning the first text node to the last text node.

functionsplitParagraphCommandsource ↗
splitParagraphCommand(): DocCommand

Creates a command that splits the current paragraph at the cursor.

ReturnsCommand that moves trailing text and nodes into a newly inserted paragraph.

Package

@searsuite/sear-domain-doc-schema

3 exports

The dependency-free JSON protocol shared by standalone and embedded rich documents.

interfaceNodeSchemasource ↗
interface NodeSchema

Persisted rich-document node schema shared by document runtime, commands, and OT.

propertyattrs
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

propertycontent
content?: Schema[]

Child rich-document nodes.

propertyid
id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytext
text?: string

Optional text content for leaf text nodes.

propertytype
type: string

Domain node type identifier.

interfaceTextSchemasource ↗
interface TextSchema extends NodeSchema

Persisted text-bearing rich-document node schema.

propertyattrsinherited
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

propertycontentinherited
content?: Schema[]

Child rich-document nodes.

propertyidinherited
id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytext
text: string

Optional text content for leaf text nodes.

propertytypeinherited
type: string

Domain node type identifier.

typeSchemasource ↗
type Schema = NodeSchema | TextSchema

Persisted rich-document schema node.

Package

@searsuite/sear-domain-doc

86 exports

Rich-document nodes, selections, schema helpers, inline styles, and layout contracts.

classDocNodeRegistrysource ↗
class DocNodeRegistry

Registry that maps persisted rich-document node types to constructors.

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

DI token for resolving the document node registry.

methodcreate
create(schema: Schema): RichDocNode

Instance method: delegates to the static registry; used by DI-injected consumers.

schema: Schema
methodisBlockType
isBlockType(type: string): boolean

Instance method: returns whether the persisted type has been registered as a block container.

type: string
methodisTextType
isTextType(type: string): boolean

Instance method: returns whether the persisted type has been registered as text-like.

type: string
methodregister
register(definition: DocNodeDefinition): void

Registers a node factory on this registry instance.

definition: DocNodeDefinition
methodrequireDefaultBlockType
requireDefaultBlockType(): string

Instance method: returns the registered default block type for generic text editing.

methodrequireDefaultTextType
requireDefaultTextType(): string

Instance method: returns the registered default text type for generic text editing.

methodcreatestatic
create(schema: Schema): RichDocNode

Creates a rich-document node from persisted schema.

schema: Schema
methodisBlockTypestatic
isBlockType(type: string): boolean

Returns whether the persisted type has been registered as a block container.

type: string
methodisTextTypestatic
isTextType(type: string): boolean

Returns whether the persisted type has been registered as text-like.

type: string
methodregisterstatic
register(type: string, creator: (schema: Schema): RichDocNode): void register(definition: DocNodeDefinition): void

Registers a node factory for a persisted node type.

type: string
creator: (schema: Schema): RichDocNode
definition: DocNodeDefinition
methodrequireDefaultBlockTypestatic
requireDefaultBlockType(): string

Returns the registered default block type for generic text editing.

methodrequireDefaultTextTypestatic
requireDefaultTextType(): string

Returns the registered default text type for generic text editing.

classParagraphNodesource ↗
class ParagraphNode extends RichDocNode

Built-in paragraph node.

constructorconstructor
ParagraphNode(schema: NodeSchema): ParagraphNode

Creates a paragraph node from persisted schema.

schema: NodeSchema
propertyattrsinherited
attrs: Record<string, any>

Node attributes such as text styles or block metadata.

propertycontentinherited
content: RichDocNode[] | TextNode[]

Child rich-document nodes.

propertyidinherited
id: string | undefined

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytypeinherited
type: string

Domain node type identifier.

propertynodeTypestatic
readonly nodeType: "paragraph"

Persisted schema type owned by the paragraph document feature.

methodcreatestaticinherited
create(_schema: Schema): RichDocNode

Creates a concrete rich-document node from persisted schema.

_schema: Schema
classRichDocNodesource ↗
class RichDocNode

Base class for rich-document nodes used by the document layout engine.

propertyattrs
attrs: Record<string, any>

Node attributes such as text styles or block metadata.

propertycontent
content: RichDocNode[] | TextNode[]

Child rich-document nodes.

propertyid
id: string | undefined

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytype
type: string

Domain node type identifier.

methodcreatestatic
create(_schema: Schema): RichDocNode

Creates a concrete rich-document node from persisted schema.

_schema: Schema
classRichTextBlockFlowRegistrysource ↗
class RichTextBlockFlowRegistry

Ordered registry for plugin-owned top-level block flow resolution.

constructorconstructor
RichTextBlockFlowRegistry(defaultSpacingAfter?: number): RichTextBlockFlowRegistry
defaultSpacingAfter: number
propertysymbolstatic
readonly symbol: typeof symbol
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void
assertWrite: (): void
methodregister
register(contribution: RichTextBlockFlowContribution): (): void
contribution: RichTextBlockFlowContribution
methodresolve
resolve(input: { blockCount: number; index: number; node: RichDocNode }): number
input: { blockCount: number; index: number; node: RichDocNode }
classRichTextInlineStyleRegistrysource ↗
class RichTextInlineStyleRegistry

Ordered registry for plugin-owned rich-text inline style readers and mutations.

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

DI token for resolving the inline style registry.

methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void
assertWrite: (): void
methodgetMutation
getMutation(styleKey: string): RichTextInlineStyleMutation | undefined

Resolves a plugin-owned persisted inline style mutation by style key when registered.

styleKey: string
methodgetMutationKeys
getMutationKeys(): readonly string[]

Returns all registered persisted inline-style mutation keys in registration order.

methodreadTextNodeStyle
readTextNodeStyle(node: TextNode): Readonly<Record<string, unknown>> | undefined

Reads all registered style slices from a text node.

node: TextNode
methodregister
register(contribution: RichTextInlineStyleContribution): (): void

Registers one plugin-owned inline style contribution.

contribution: RichTextInlineStyleContribution
methodrequireMutation
requireMutation(styleKey: string): RichTextInlineStyleMutation

Resolves a plugin-owned persisted inline style mutation by style key.

styleKey: string
methodsameStyle
sameStyle(styleA: Readonly<Record<string, unknown>> | undefined, styleB: Readonly<Record<string, unknown>> | undefined): boolean

Compares two style bags using stable key/value serialization.

styleA: Readonly<Record<string, unknown>> | undefined
styleB: Readonly<Record<string, unknown>> | undefined
classRichTextLineBoxRegistrysource ↗
class RichTextLineBoxRegistry

Ordered registry for plugin-owned rich-text line box resolution.

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

DI token for resolving the rich-text line box registry.

methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void
assertWrite: (): void
methodregister
register(contribution: RichTextLineBoxContribution): (): void

Registers one plugin-owned line box contribution.

contribution: RichTextLineBoxContribution
methodresolve
resolve(input: { chars: readonly RichTextChar[]; lineSpacing?: RichTextLineSpacing }): RichTextLineBox

Resolves the final line box for one measured line.

input: { chars: readonly RichTextChar[]; lineSpacing?: RichTextLineSpacing }
classTableCellNodesource ↗
class TableCellNode extends RichDocNode

Built-in table cell node.

constructorconstructor
TableCellNode(schema: NodeSchema): TableCellNode

Creates a table cell node from persisted schema.

schema: NodeSchema
propertyattrsinherited
attrs: Record<string, any>

Node attributes such as text styles or block metadata.

propertycontentinherited
content: RichDocNode[] | TextNode[]

Child rich-document nodes.

propertyidinherited
id: string | undefined

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytypeinherited
type: string

Domain node type identifier.

propertynodeTypestatic
readonly nodeType: "tableCell"

Persisted schema type owned by the table document feature.

methodcreatestaticinherited
create(_schema: Schema): RichDocNode

Creates a concrete rich-document node from persisted schema.

_schema: Schema
classTableNodesource ↗
class TableNode extends RichDocNode

Built-in table block node.

constructorconstructor
TableNode(schema: NodeSchema): TableNode

Creates a table node from persisted schema.

schema: NodeSchema
propertyattrsinherited
attrs: Record<string, any>

Node attributes such as text styles or block metadata.

propertycontentinherited
content: RichDocNode[] | TextNode[]

Child rich-document nodes.

propertyidinherited
id: string | undefined

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytypeinherited
type: string

Domain node type identifier.

propertynodeTypestatic
readonly nodeType: "table"

Persisted schema type owned by the table document feature.

methodcreatestaticinherited
create(_schema: Schema): RichDocNode

Creates a concrete rich-document node from persisted schema.

_schema: Schema
classTableRowNodesource ↗
class TableRowNode extends RichDocNode

Built-in table row node.

constructorconstructor
TableRowNode(schema: NodeSchema): TableRowNode

Creates a table row node from persisted schema.

schema: NodeSchema
propertyattrsinherited
attrs: Record<string, any>

Node attributes such as text styles or block metadata.

propertycontentinherited
content: RichDocNode[] | TextNode[]

Child rich-document nodes.

propertyidinherited
id: string | undefined

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytypeinherited
type: string

Domain node type identifier.

propertynodeTypestatic
readonly nodeType: "tableRow"

Persisted schema type owned by the table document feature.

methodcreatestaticinherited
create(_schema: Schema): RichDocNode

Creates a concrete rich-document node from persisted schema.

_schema: Schema
classTextNodesource ↗
class TextNode extends RichDocNode

Built-in text leaf node.

constructorconstructor
TextNode(schema: NodeSchema): TextNode TextNode(schema: TextSchema): TextNode

Creates a text node from persisted schema.

schema: NodeSchema
propertyattrsinherited
attrs: Record<string, any>

Node attributes such as text styles or block metadata.

propertycontentinherited
content: RichDocNode[] | TextNode[]

Child rich-document nodes.

propertyidinherited
id: string | undefined

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytext
text?: string

Text content carried by this leaf node.

propertytypeinherited
type: string

Domain node type identifier.

propertynodeTypestatic
readonly nodeType: "text"

Persisted schema type owned by the text input document feature.

methodcreatestaticinherited
create(_schema: Schema): RichDocNode

Creates a concrete rich-document node from persisted schema.

_schema: Schema
interfaceDocCursorPossource ↗
interface DocCursorPos

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: 'doc', 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")

propertyoffset
offset: number

Character offset within the leaf text node.

propertypath
path: number[]

Path from root content[] to the leaf text node.

interfaceDocNodeDefinitionsource ↗
interface DocNodeDefinition

Registration contract for one persisted rich-document node type.

propertycreate
readonly create: (schema: Schema): RichDocNode

Factory that creates the runtime node instance for this persisted schema.

propertydefaultBlock
readonly defaultBlock?: boolean

Whether this block is the default container for plain text editing.

propertydefaultText
readonly defaultText?: boolean

Whether this text-like node is the default leaf for plain text editing.

propertyrole
readonly role?: DocNodeRole

Generic role consumed by core editing/layout helpers.

propertytype
readonly type: string

Persisted schema type owned by a document feature plugin.

interfaceDocSelectionsource ↗
interface DocSelection

Anchor + head selection model.
Collapsed selection (cursor only): anchor === head.
head moves freely; anchor is fixed until a non-Shift action resets it.

propertyanchor
anchor: DocCursorPos
propertyhead
head: DocCursorPos
interfaceInlineTextRangePatchsource ↗
interface InlineTextRangePatch

One text-node replacement produced by an inline text range edit.

propertybeforeLength
readonly beforeLength: number
propertyblockIndex
readonly blockIndex: number
propertychildIndex
readonly childIndex: number
propertyendOffset
readonly endOffset: number
propertyoldNode
readonly oldNode: TextNode
propertyreplacement
readonly replacement: readonly RichDocNode[]
propertyreplacementCount
readonly replacementCount: number
propertyselectedLength
readonly selectedLength: number
propertystartOffset
readonly startOffset: number
propertywholeNode
readonly wholeNode: boolean
interfaceInlineTextRangePatchContextsource ↗
interface InlineTextRangePatchContext

Context supplied when patching one selected text-node segment.

propertyblockIndex
readonly blockIndex: number
propertychildIndex
readonly childIndex: number
propertyendOffset
readonly endOffset: number
propertynode
readonly node: TextNode
propertystartOffset
readonly startOffset: number
interfaceRichNodeFactorysource ↗
interface RichNodeFactory

Minimal factory interface for creating document nodes.
Implemented by DocNodeRegistry (static or injected).

methodcreate
create(schema: { attrs?: Record<string, unknown>; content?: unknown[]; id?: string; text?: string; type: string }): RichDocNode
schema: { attrs?: Record<string, unknown>; content?: unknown[]; id?: string; text?: string; type: string }
interfaceRichTextBlockFlowContributionsource ↗
interface RichTextBlockFlowContribution

Plugin-owned contribution that can refine block flow metrics.

propertykey
readonly key: string
methodresolve
resolve(input: RichTextBlockFlowResolveInput): number
input: RichTextBlockFlowResolveInput
interfaceRichTextBlockFlowResolveInputsource ↗
interface RichTextBlockFlowResolveInput

Input used to resolve the flow spacing after one top-level document block.

propertyblockCount
readonly blockCount: number
propertyindex
readonly index: number
propertynode
readonly node: RichDocNode
propertyspacingAfter
readonly spacingAfter: number
interfaceRichTextBlockLayoutProvidersource ↗
interface RichTextBlockLayoutProvider

Domain-side contract for services that provide measured rich-text block layout.

methodcalculateLayoutPerParagraph
calculateLayoutPerParagraph(width: number): RichTextLine[][]
width: number
methodsetBaseFont
setBaseFont(font: string): void

Updates the transient font used when measuring unstyled text.

font: string
interfaceRichTextInlineStyleContributionsource ↗
interface RichTextInlineStyleContribution

Plugin-owned contribution for one inline text style concern.

propertykey
readonly key: string

Stable contribution key used for duplicate detection and unregister.

propertymutations
mutations?: readonly RichTextInlineStyleMutation[]

Persisted inline text-style mutations owned by this contribution.

methodread
read(input: RichTextInlineStyleReadInput): Readonly<Record<string, unknown>> | undefined

Reads this contribution's style slice from a text node.

input: RichTextInlineStyleReadInput
interfaceRichTextInlineStyleMutationsource ↗
interface RichTextInlineStyleMutation

Plugin-owned mutation for one persisted inline text-style concern.

propertystyleKey
readonly styleKey: string

Stable style key used by commands to resolve this mutation.

methodapply
apply(input: RichTextInlineStyleMutationInput): Record<string, unknown>

Applies the normalized style value to a text node's persisted attrs.

input: RichTextInlineStyleMutationInput
interfaceRichTextInlineStyleMutationInputsource ↗
interface RichTextInlineStyleMutationInput

Input supplied when an inline-style contribution mutates persisted text-node attrs.

propertyattrs
readonly attrs: Record<string, unknown>
propertyvalue
readonly value: unknown
interfaceRichTextInlineStyleReadInputsource ↗
interface RichTextInlineStyleReadInput

Input supplied when an inline-style contribution reads document attrs.

propertyattrs
readonly attrs: Record<string, unknown>
propertynode
readonly node: TextNode
interfaceRichTextLineBoxsource ↗
interface RichTextLineBox

Flow metrics for one rich-text line.

propertyascent
readonly ascent: number
propertycontentHeight
readonly contentHeight: number
propertydescent
readonly descent: number
propertyleadingBottom
readonly leadingBottom: number
propertyleadingTop
readonly leadingTop: number
propertylineGap
readonly lineGap: number
propertylineHeight
readonly lineHeight: number
interfaceRichTextLineBoxContributionsource ↗
interface RichTextLineBoxContribution

Plugin-owned contribution that can refine rich-text line flow metrics.

propertykey
readonly key: string

Stable contribution key used for duplicate detection and unregister.

methodresolve
resolve(input: RichTextLineBoxResolveInput): RichTextLineBox

Resolves the next line box from the current accumulated line box.

input: RichTextLineBoxResolveInput
interfaceRichTextLineBoxResolveInputsource ↗
interface RichTextLineBoxResolveInput

Input used to resolve the flow box for one measured rich-text line.

propertychars
readonly chars: readonly RichTextChar[]
propertylineBox
readonly lineBox: RichTextLineBox
propertylineSpacing
readonly lineSpacing?: RichTextLineSpacing
interfaceRichTextLineSpacingsource ↗
interface RichTextLineSpacing

Persisted or default line-spacing policy resolved by paragraph layout.

propertymode
readonly mode: RichTextLineSpacingMode
propertyvalue
readonly value?: number
interfaceRichTextParagraphLayoutsource ↗
interface RichTextParagraphLayout

Resolved paragraph layout values consumed by line and block flow.

propertylineSpacing
readonly lineSpacing: RichTextLineSpacing
propertyspacingAfter
readonly spacingAfter: number
interfaceRichTextParagraphLayoutDefaultssource ↗
interface RichTextParagraphLayoutDefaults

Default paragraph layout values supplied by the owning document runtime.

propertylineSpacing
readonly lineSpacing: RichTextLineSpacing
propertyspacingAfter
readonly spacingAfter: number
interfaceTextAttributeRangesource ↗
interface TextAttributeRange<TAttributes>

A generic text attribute range in document-relative character offsets.

propertyattrs
attrs: TAttributes
propertyend
end: number
propertystart
start: number
interfaceTextGraphemeRangesource ↗
interface TextGraphemeRange

One grapheme range expressed in UTF-16 source offsets.

propertyend
readonly end: number
propertystart
readonly start: number
interfaceTextSelectionsource ↗
interface TextSelection

Public contract for TextSelection.

propertyanchor
anchor: string | number[]
propertyhead
head: string | number[]
typeDocNodeIdsource ↗
type DocNodeId = string & { [docNodeIdBrand]: true }

Stable identity used by document layout and retained render nodes.

typeDocNodeRolesource ↗
type DocNodeRole = typeof DocNodeRole[keyof typeof DocNodeRole]

Type contract for DocNodeRole.

typeInlineTextRangeAttrsPatchersource ↗
type InlineTextRangeAttrsPatcher = (attrs: Record<string, unknown>, context: InlineTextRangePatchContext): Record<string, unknown>

Patches the attrs for the selected segment of one text node.

typeRichTextCharsource ↗
type RichTextChar = unknown

Measured inline character/token used by rich-text line wrapping.

propertychar
char: string
propertyfontAscent
fontAscent: number
propertyfontDescent
fontDescent?: number
propertyfontLineGap
fontLineGap?: number
propertyheight
height: number
propertystyle
style?: RichTextInlineStyle
propertytextNodeIndex
textNodeIndex?: number

Direct child index of the source text node within its paragraph.

propertytextNodeOffset
textNodeOffset?: number

Character offset within the source text node.

propertywidth
width: number
typeRichTextInlineStylesource ↗
type RichTextInlineStyle = Readonly<Record<string, unknown>>

Domain-neutral inline style bag carried by measured rich-text chars.

typeRichTextLinesource ↗
type RichTextLine = unknown

One laid-out rich-text line with aggregate dimensions.

propertychars
chars: RichTextChar[]
propertyfontAscent
fontAscent: number

Max measured font ascent across all chars on this line; used for stable vertical centering.

propertyfontDescent
fontDescent?: number

Max measured font descent across all chars on this line.

propertyheight
height: number
propertylineBox
lineBox?: RichTextLineBox

Plugin-resolved line box used for flow and baseline placement.

propertywidth
width: number
typeRichTextLineSpacingModesource ↗
type RichTextLineSpacingMode = "auto" | "multiple" | "atLeast" | "exact"

Supported paragraph line-spacing semantics.

typeTextAttributePatchsource ↗
type TextAttributePatch = Readonly<Record<string, unknown>>

Attributes merged into a text node for one presentation range.

variabledefaultRichTextParagraphLayoutDefaultssource ↗
defaultRichTextParagraphLayoutDefaults: RichTextParagraphLayoutDefaults

Neutral defaults for runtimes that do not configure document paragraph spacing.

variableDocNodeRolesource ↗
DocNodeRole: { Block: "block"; Text: "text" }

Node roles used by generic rich-document editing and layout helpers.

variableRichTextParagraphAttributesource ↗
RichTextParagraphAttribute: { LineSpacing: "lineSpacing"; SpacingAfter: "spacingAfter" }

Persisted paragraph attribute keys owned by the paragraph feature.

functionapplyInlineTextRangePatchPlansource ↗
applyInlineTextRangePatchPlan(doc: readonly RichDocNode[], patches: readonly InlineTextRangePatch[]): RichDocNode[]

Applies an inline text range patch plan to an immutable document snapshot.

doc: readonly RichDocNode[]
patches: readonly InlineTextRangePatch[]
functionapplyInlineTextStylePropertyMutationsource ↗
applyInlineTextStylePropertyMutation(attrs: Readonly<Record<string, unknown>>, property: string, value: unknown): Record<string, unknown>

Applies or removes one persisted inline-text style property.

attrs: Readonly<Record<string, unknown>>
property: string
value: unknown
functionapplyRichTextFormatsource ↗
applyRichTextFormat(document: readonly Schema[], format: Readonly<Record<string, unknown>>, registry: RichTextInlineStyleRegistry): Schema[]

Replaces registered styles while retaining text, structure and unrelated attributes.

document: readonly Schema[]
format: Readonly<Record<string, unknown>>
registry: RichTextInlineStyleRegistry
functionapplyTextAttributeRangessource ↗
applyTextAttributeRanges(doc: RichDocNode[], ranges: readonly TextAttributeRange<Readonly<Record<string, unknown>>>[]): RichDocNode[]

Applies presentation attributes to text ranges without owning their meaning.
Plugins decide how to interpret the resulting text-node attrs.

doc: RichDocNode[]
ranges: readonly TextAttributeRange<Readonly<Record<string, unknown>>>[]
functionbuildInlineTextRangePatchPlansource ↗
buildInlineTextRangePatchPlan(doc: readonly RichDocNode[], selection: DocSelection, patchAttrs: InlineTextRangeAttrsPatcher): InlineTextRangePatch[]

Builds reusable text-node split/replacement patches for a document selection.

doc: readonly RichDocNode[]
selection: DocSelection
patchAttrs: InlineTextRangeAttrsPatcher
functioncaptureRichTextFormatsource ↗
captureRichTextFormat(document: readonly Schema[], registry: RichTextInlineStyleRegistry): Readonly<Record<string, unknown>>

Captures the leading text run's explicit registered styles, excluding host defaults.

document: readonly Schema[]
registry: RichTextInlineStyleRegistry
functioncloneRichDocumentsource ↗
cloneRichDocument(document: readonly RichDocNode[]): RichDocNode[]

Returns a detached mutable snapshot of a rich document.

document: readonly RichDocNode[]
functioncompareCursorsource ↗
compareCursor(a: DocCursorPos, b: DocCursorPos): -1 | 0 | 1

Lexicographic comparison of two cursor positions.
Compares path element-by-element, then offset. Returns -1 | 0 | 1.

a: DocCursorPos
b: DocCursorPos
functioncomputeFirstBaselineYsource ↗
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: number
Total pixel height of the containing box (e.g. cell height).
cellPadding: number
Padding on each side of the box.
fontAscent: number
Measured font ascent of the first line (stable across all glyphs in the font).
lineHeight: number
Total line height (fontAscent + fontDescent) of the first line.
offsetY: number
Absolute Y offset of the box top-left (default 0 for relative coordinates).
functioncreateDefaultRichTextBlockFlowContributionsource ↗
createDefaultRichTextBlockFlowContribution(): RichTextBlockFlowContribution

Creates the paragraph-owned default after-spacing contribution.

functioncreateDefaultRichTextLineBoxContributionsource ↗
createDefaultRichTextLineBoxContribution(): RichTextLineBoxContribution

Creates the default line box contribution used by document composition roots.

functioncreateDocNodeIdsource ↗
createDocNodeId(value: string): DocNodeId

Creates a typed document node id from a non-empty string value.

value: string
functioncreateDocNodeIdFromPathsource ↗
createDocNodeIdFromPath(path: readonly string | number[]): DocNodeId

Creates a fallback document node id from a rich-document path.

path: readonly string | number[]
functioncreateEmptyParagraphsource ↗
createEmptyParagraph(): RichDocNode

Create a single empty paragraph containing one empty text node.

functioncreateInlineTextStyleAttrsPatchersource ↗
createInlineTextStyleAttrsPatcher(property: string, value: unknown): InlineTextRangeAttrsPatcher

Creates the compatibility inline text-style attrs patcher for property/value callers.

property: string
value: unknown
functioncreateRichTextLineSpacingContributionsource ↗
createRichTextLineSpacingContribution(): RichTextLineBoxContribution

Creates the paragraph-owned line-spacing contribution.

functiongetDocumentOffsetsource ↗
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.

doc: RichDocNode[]
position: DocCursorPos
functiongetTextNodeLengthsource ↗
getTextNodeLength(doc: RichDocNode[], path: number[]): number

Character length of the text node at path. Returns 0 for missing / non-text nodes.

doc: RichDocNode[]
path: number[]
functionisCollapsedsource ↗
isCollapsed(sel: DocSelection): boolean

Runs the is collapsed helper.

sel: DocSelection
functionisDocSemanticallyEmptysource ↗
isDocSemanticallyEmpty(doc: RichDocNode[]): boolean

Returns true if every paragraph in doc contains no meaningful text.

doc: RichDocNode[]
functionisTextNodesource ↗
isTextNode(node: TextNode | RichDocNode): node

Returns true when a rich-document node is a text leaf.

node: TextNode | RichDocNode
functionmapInlineTextRangePatchCursorsource ↗
mapInlineTextRangePatchCursor(cursor: DocCursorPos, patches: readonly InlineTextRangePatch[]): DocCursorPos

Repositions a cursor after an inline text range patch plan has been applied.

cursor: DocCursorPos
patches: readonly InlineTextRangePatch[]
functionnormalizeDocForEditsource ↗
normalizeDocForEdit(doc: RichDocNode[]): RichDocNode[]

Ensure doc has at least one paragraph.
Returns the same array if already valid; otherwise [createEmptyParagraph()].

doc: RichDocNode[]
functionnormalizeSelectionsource ↗
normalizeSelection(sel: DocSelection): { end: DocCursorPos; start: DocCursorPos }

Normalize selection so start ≤ end regardless of direction.

sel: DocSelection
functionparaTextsource ↗
paraText(para: RichDocNode): string

Extract the concatenated plain text of a paragraph node.

para: RichDocNode
functionparaTextLengthsource ↗
paraTextLength(para: RichDocNode): number

Total plain-text length of a paragraph node (sums all direct text children).

para: RichDocNode
functionparseRichTextLineSpacingsource ↗
parseRichTextLineSpacing(value: unknown): RichTextLineSpacing | null

Parses a persisted line-spacing override, returning null when invalid.

value: unknown
functionparseRichTextParagraphSpacingsource ↗
parseRichTextParagraphSpacing(value: unknown): number | null

Parses a persisted paragraph-spacing override, returning null when invalid.

value: unknown
functionreadTextStyleAttrssource ↗
readTextStyleAttrs(attrs: Record<string, unknown>): Record<string, unknown>

Reads the inline text-style attribute bag from a node's attributes.

attrs: Record<string, unknown>
functionregisterParagraphDocNodesource ↗
registerParagraphDocNode(registry: DocNodeRegistrar): void

Registers the paragraph node type owned by paragraph-oriented document features.

registry: DocNodeRegistrar
functionregisterTableDocNodessource ↗
registerTableDocNodes(registry: DocNodeRegistrar): void

Registers the table node types owned by table-oriented document features.

registry: DocNodeRegistrar
functionregisterTextDocNodesource ↗
registerTextDocNode(registry: DocNodeRegistrar): void

Registers the text node type owned by text-input document features.

registry: DocNodeRegistrar
functionreplaceInlineTextStylesource ↗
replaceInlineTextStyle(doc: RichDocNode[], selection: DocSelection, property: string, value: unknown, patchAttrs?: InlineTextRangeAttrsPatcher): RichDocNode[]

Replaces one inline text-style property on the selected document range.

doc: RichDocNode[]
selection: DocSelection
property: string
value: unknown
patchAttrs: InlineTextRangeAttrsPatcher
functionresolveDocNodeIdsource ↗
resolveDocNodeId(node: { id?: string } | undefined, path: readonly string | number[]): DocNodeId

Resolves a block-level document id, preferring persisted node identity over path fallback.

node: { id?: string } | undefined
path: readonly string | number[]
functionresolveNodesource ↗
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.

doc: RichDocNode[]
path: number[]
functionresolveRichTextParagraphLayoutsource ↗
resolveRichTextParagraphLayout(node: RichDocNode | undefined, defaults?: RichTextParagraphLayoutDefaults): RichTextParagraphLayout

Resolves paragraph-owned overrides over the runtime defaults.

node: RichDocNode | undefined
defaults: RichTextParagraphLayoutDefaults
functionresolveTextContentsource ↗
resolveTextContent(doc: RichDocNode[], path: number[]): string

Get the plain-text string of the node at path.
Convenience wrapper around resolveNode.

doc: RichDocNode[]
path: number[]
functionsegmentTextGraphemessource ↗
segmentTextGraphemes(text: string): readonly TextGraphemeRange[]

Segments text into grapheme ranges, with a code-point fallback for older hosts.

text: string
functionstringToRichDocsource ↗
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.

text: string
functionupdateInlineTextStyleAttrssource ↗
updateInlineTextStyleAttrs(current: unknown, property: string, value: unknown): Record<string, unknown>

Updates one entry in a text node's style attrs bag.

current: unknown
property: string
value: unknown
interfaceNodeSchemasource ↗
interface NodeSchema

Persisted rich-document node schema shared by document runtime, commands, and OT.

propertyattrs
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

propertycontent
content?: Schema[]

Child rich-document nodes.

propertyid
id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytext
text?: string

Optional text content for leaf text nodes.

propertytype
type: string

Domain node type identifier.

typeSchemasource ↗
type Schema = NodeSchema | TextSchema

Persisted rich-document schema node.

interfaceTextSchemasource ↗
interface TextSchema extends NodeSchema

Persisted text-bearing rich-document node schema.

propertyattrsinherited
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

propertycontentinherited
content?: Schema[]

Child rich-document nodes.

propertyidinherited
id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytext
text: string

Optional text content for leaf text nodes.

propertytypeinherited
type: string

Domain node type identifier.

Package

@searsuite/sear-domain-editor

28 exports

Editor-local query, observation, capability, and lifecycle contracts shared by facades.

classArrayIndexedSnapshotsource ↗
class ArrayIndexedSnapshot<TSnapshot, TItem, TKey> extends IndexedSnapshot<TSnapshot, TItem, TKey>

Array and Map backed implementation of IndexedSnapshot.

constructorconstructor
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.

snapshot: TSnapshot
items: readonly TItem[]
getKey: (item: TItem): TKey
getIndex: (item: TItem): number
propertyitemsinherited
readonly items: readonly TItem[]

Items in their canonical order.

propertysnapshotinherited
readonly snapshot: TSnapshot
methodgetByIndex
getByIndex(index: number): TItem | null

Returns one item by its numeric index.

index: number
methodgetByKey
getByKey(key: TKey): TItem | null

Returns one item by its stable key.

key: TKey
methodgetKeysByIndexes
getKeysByIndexes(indexes: readonly number[]): readonly TKey[]

Returns keys for the supplied numeric indexes, preserving input order.

indexes: readonly number[]
classDocBlockLayoutDiffsource ↗
class DocBlockLayoutDiff

Compares two block-layout snapshots and exposes render-neutral reuse facts.

constructorconstructor
DocBlockLayoutDiff(entries: readonly DocBlockLayoutDiffEntry[]): DocBlockLayoutDiff
entries: readonly DocBlockLayoutDiffEntry[]
propertyentries
readonly entries: readonly DocBlockLayoutDiffEntry[]
methodgetChangedEntries
getChangedEntries(): readonly DocBlockLayoutDiffEntry[]
methodgetEntry
getEntry(id: DocNodeId): DocBlockLayoutDiffEntry | null
id: DocNodeId
methodgetReusableRasterCopies
getReusableRasterCopies(): readonly DocBlockRasterReuse[]
methodgetShiftedEntries
getShiftedEntries(): readonly DocBlockLayoutDiffEntry[]
methodhasChanges
hasChanges(): boolean
methodcomparestatic
compare(previous: DocLayoutCache | null, current: DocLayoutCache, options?: DocBlockLayoutDiffOptions): DocBlockLayoutDiff
previous: DocLayoutCache | null
current: DocLayoutCache
options: DocBlockLayoutDiffOptions
classDocLayoutCachesource ↗
class DocLayoutCache

Immutable snapshot of block-level document layout used by viewport and SceneGraph projection.

constructorconstructor
DocLayoutCache(snapshot: LayoutSnapshot, blocksOrIndex: IndexedSnapshot<LayoutSnapshot, DocBlockLayout, DocNodeId> | readonly DocBlockLayout[]): DocLayoutCache

Creates a layout cache from already computed block records.

snapshot: LayoutSnapshot
Layout snapshot used to derive this cache.
blocksOrIndex: IndexedSnapshot<LayoutSnapshot, DocBlockLayout, DocNodeId> | readonly DocBlockLayout[]
Top-level block layout records ordered by document position, or a custom indexed store.
memberblocks
blocks: unknown
membersnapshot
snapshot: unknown
methodgetBlockById
getBlockById(id: DocNodeId): DocBlockLayout | null

Returns the cached layout record for a document block id.

id: DocNodeId
methodgetBlockByIndex
getBlockByIndex(index: number): DocBlockLayout | null

Returns the cached layout record for a top-level block index.

index: number
methodgetBlockIdsByIndexes
getBlockIdsByIndexes(indexes: readonly number[]): readonly DocNodeId[]

Returns block ids for the supplied top-level block indexes.

indexes: readonly number[]
methodgetBlocksInVerticalRange
getBlocksInVerticalRange(top: number, bottom: number): readonly DocBlockLayout[]

Returns all cached block records intersecting the supplied vertical range.

top: number
bottom: number
methodgetContentLayoutReusableBlockIndexes
getContentLayoutReusableBlockIndexes(previous: DocLayoutCache): readonly number[]

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.

previous: DocLayoutCache
methodhasBlockFlowLayoutChanged
hasBlockFlowLayoutChanged(previous: DocLayoutCache, blockId: DocNodeId): boolean

Returns whether one block's height-sensitive flow layout changed.

previous: DocLayoutCache
blockId: DocNodeId
methodhasFlowHeightChanged
hasFlowHeightChanged(previous: DocLayoutCache, blockId: DocNodeId): boolean

Returns whether one block's flow height changed compared with another cache.

previous: DocLayoutCache
blockId: DocNodeId
methodfromSnapshotstatic
fromSnapshot(document: readonly RichDocNode[], snapshot: LayoutSnapshot, previousCache?: DocLayoutCache | null): DocLayoutCache

Builds a block layout cache from a rich document and its layout snapshot.

document: readonly RichDocNode[]
snapshot: LayoutSnapshot
previousCache: DocLayoutCache | null
classDocLayoutEnginesource ↗
class DocLayoutEngine

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.

constructorconstructor
DocLayoutEngine(blockFlowRegistry: RichTextBlockFlowRegistry): DocLayoutEngine
blockFlowRegistry: RichTextBlockFlowRegistry
propertysymbolstatic
readonly symbol: symbol

DI token for resolving DocLayoutEngine.

methodbuildSnapshot
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: RichDocNode[]
The current RichDocNode[] being edited.
blockManager: RichTextBlockLayoutProvider
Layout provider that already holds the paragraph blocks.
editorWidth: number
Total pixel width of the editor box (including padding).
editorHeight: number
Total pixel height of the editor box (including padding).
cellPadding: number
Padding on each side (default 4).
verticalAlign: DocVerticalAlign
Vertical positioning strategy (default center for embedded cell editors).
methodbuildSnapshotForBlocks
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.

doc: RichDocNode[]
blockManager: RichTextBlockLayoutProvider
blockIndexes: readonly number[]
blockTops: readonly number[]
editorWidth: number
cellPadding: number
methodcursorToPoint
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.

pos: DocCursorPos
snapshot: LayoutSnapshot
methodfindLineIndex
findLineIndex(pos: DocCursorPos, snapshot: LayoutSnapshot): number

Returns the index into snapshot.lines for the line containing pos.
Returns 0 if not found.

pos: DocCursorPos
snapshot: LayoutSnapshot
methodgetSelectionRects
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: DocSelection
The current DocSelection (anchor + head).
snapshot: LayoutSnapshot
Layout snapshot from buildSnapshot.
originX: number
Absolute canvas X of the editor box top-left.
originY: number
Absolute canvas Y of the editor box top-left.
methodpointToCursor
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.

px: number
py: number
snapshot: LayoutSnapshot
classDocPageMapsource ↗
class DocPageMap

Maps document blocks to pages for viewport range queries and virtualization.

constructorconstructor
DocPageMap(pageHeight: number, pageGap: number, pages: readonly DocPageLayout[]): DocPageMap

Creates a page map from immutable page records.

pageHeight: number
Page height used by this map.
pageGap: number
Gap between pages in document coordinates.
pages: readonly DocPageLayout[]
Ordered page layout records.
propertypageGap
readonly pageGap: number

Gap between pages in document coordinates.

propertypageHeight
readonly pageHeight: number

Page height used by this map.

propertypages
readonly pages: readonly DocPageLayout[]

Ordered page layout records.

methodgetPage
getPage(index: number): DocPageLayout | null

Returns a page record by index.

index: number
methodgetPageIndexesForBlock
getPageIndexesForBlock(blockId: DocNodeId): readonly number[]

Returns page indexes that intersect a block id.

blockId: DocNodeId
methodgetPagesByIndexes
getPagesByIndexes(indexes: readonly number[]): readonly DocPageLayout[]

Returns pages for the supplied page indexes, preserving page order.

indexes: readonly number[]
methodgetPagesForBlock
getPagesForBlock(block: DocBlockLayout): readonly DocPageLayout[]

Returns all pages intersecting a block layout record.

block: DocBlockLayout
methodgetPagesInVerticalRange
getPagesInVerticalRange(top: number, bottom: number): readonly DocPageLayout[]

Returns all pages intersecting the supplied vertical document range.

top: number
bottom: number
methodfromLayoutCachestatic
fromLayoutCache(cache: DocLayoutCache, pageHeight: number, pageGap?: number): DocPageMap

Builds a page map by intersecting cached block rectangles with fixed-height pages.

cache: DocLayoutCache
pageHeight: number
pageGap: number
classDocViewportWindowsource ↗
class DocViewportWindow

Visible document window used to filter block and page layout ranges.

constructorconstructor
DocViewportWindow(x: number, y: number, width: number, height: number): DocViewportWindow

Creates a viewport window from document-space rectangle coordinates.

x: number
Left edge in document coordinates.
y: number
Top edge in document coordinates.
width: number
Visible width in document units.
height: number
Visible height in document units.
propertyheight
readonly height: number

Visible height in document units.

propertywidth
readonly width: number

Visible width in document units.

propertyx
readonly x: number

Left edge in document coordinates.

propertyy
readonly y: number

Top edge in document coordinates.

memberbottom
bottom: unknown
methodintersects
intersects(rect: DocLayoutRect): boolean

Returns whether this viewport intersects another document-space rectangle.

rect: DocLayoutRect
methodfromViewportstatic
fromViewport(viewport: { contentRect: DocLayoutRect }, scroll?: { x: number; y: number }): DocViewportWindow

Creates a document-space window from a viewport rectangle and scroll offsets.

viewport: { contentRect: DocLayoutRect }
scroll: { x: number; y: number }
classIndexedSnapshotsource ↗
class IndexedSnapshot<TSnapshot, TItem, TKey>

Generic immutable snapshot plus ordered, multi-key indexed item access.

propertyitems
readonly items: readonly TItem[]

Items in their canonical order.

propertysnapshot
readonly snapshot: TSnapshot
methodgetByIndex
getByIndex(index: number): TItem | null

Returns one item by its numeric index.

index: number
methodgetByKey
getByKey(key: TKey): TItem | null

Returns one item by its stable key.

key: TKey
methodgetKeysByIndexes
getKeysByIndexes(indexes: readonly number[]): readonly TKey[]

Returns keys for the supplied numeric indexes, preserving input order.

indexes: readonly number[]
classSearEditorsource ↗
class SearEditor

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.

constructorconstructor
SearEditor(): SearEditor

Constructs the editor service.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the editor service.

methodinitialize
initialize(): void

Initializes document-editor runtime state.

interfaceBlockLayoutSnapshotsource ↗
interface BlockLayoutSnapshot

Materialized layout for a subset of top-level document blocks.

propertyblocks
readonly blocks: readonly DocBlockLayout[]

Block records for the materialized blocks, using full-document indexes.

propertysnapshot
readonly snapshot: LayoutSnapshot

Line snapshot containing only the materialized block ranges.

interfaceDocBlockLayoutsource ↗
interface DocBlockLayout

Cached layout metadata for one top-level document block.

propertyflowHeight
readonly flowHeight: number

Flow height from this block top to the next block top, or visual height for the last block.

propertyid
readonly id: DocNodeId

Stable block identity used by retained render nodes.

propertyindex
readonly index: number

Zero-based top-level document block index.

propertylineEnd
readonly lineEnd: number

Exclusive index after the last layout line belonging to this block.

propertylineStart
readonly lineStart: number

Inclusive index of the first layout line belonging to this block.

propertyrect
readonly rect: DocLayoutRect

Document-space rectangle occupied by this block.

interfaceDocBlockLayoutDiffEntrysource ↗
interface DocBlockLayoutDiffEntry
propertycurrent
readonly current: DocBlockLayout | null
propertydeltaY
readonly deltaY: number
propertyid
readonly id: DocNodeId
propertyindex
readonly index: number
propertyprevious
readonly previous: DocBlockLayout | null
propertystatus
readonly status: DocBlockLayoutDiffStatus
interfaceDocBlockLayoutDiffOptionssource ↗
interface DocBlockLayoutDiffOptions
propertyreflowBlockIds
readonly reflowBlockIds?: ReadonlySet<DocNodeId>

Reflow blocks whose render output changed even if their measured layout shape did not.

propertyrepaintBlockIds
readonly repaintBlockIds?: ReadonlySet<DocNodeId>

Repaint blocks whose render output changed without invalidating layout cache.

interfaceDocBlockRasterReusesource ↗
interface DocBlockRasterReuse
propertydestination
readonly destination: DocLayoutRect
propertyid
readonly id: DocNodeId
propertyindex
readonly index: number
propertysource
readonly source: DocLayoutRect
interfaceDocBlockRenderDebugCopysource ↗
interface DocBlockRenderDebugCopy
propertydestination
readonly destination: DocBlockRenderDebugRect
propertysource
readonly source: DocBlockRenderDebugRect
interfaceDocBlockRenderDebugRectsource ↗
interface DocBlockRenderDebugRect
propertyheight
readonly height: number
propertywidth
readonly width: number
propertyx
readonly x: number
propertyy
readonly y: number
interfaceDocBlockRenderDebugSnapshotsource ↗
interface DocBlockRenderDebugSnapshot
propertychangedBlocks
readonly changedBlocks: readonly DocBlockRenderDebugRect[]
propertycopiedPixelArea
readonly copiedPixelArea: number
propertyframeMode
readonly frameMode: DocBlockRenderFrameMode
propertyincrementalRenderAccepted
readonly incrementalRenderAccepted: boolean
propertyincrementalRenderCandidate
readonly incrementalRenderCandidate?: DocBlockRenderPolicyCandidateDebugMetrics
propertyincrementalRenderReason
readonly incrementalRenderReason: string
propertyinvalidRedrawRects
readonly invalidRedrawRects: readonly DocBlockRenderDebugRect[]
propertyrasterCopies
readonly rasterCopies: readonly DocBlockRenderDebugCopy[]
propertyredrawnBlockCount
readonly redrawnBlockCount: number
propertyreusedBlocks
readonly reusedBlocks: readonly DocBlockRenderDebugRect[]
propertyshiftedBlocks
readonly shiftedBlocks: readonly DocBlockRenderDebugRect[]
propertyskippedBlockCount
readonly skippedBlockCount: number
interfaceDocBlockRenderPolicyCandidateDebugMetricssource ↗
interface DocBlockRenderPolicyCandidateDebugMetrics
propertycopiedAreaRatio
readonly copiedAreaRatio: number
propertycopiedPixelArea
readonly copiedPixelArea: number
propertycopyCount
readonly copyCount: number
propertyinvalidAreaRatio
readonly invalidAreaRatio: number
propertyinvalidPixelArea
readonly invalidPixelArea: number
propertyinvalidRectCount
readonly invalidRectCount: number
interfaceDocLayoutRectsource ↗
interface DocLayoutRect

Rectangle contract used by document layout planning without binding to a render target.

propertyheight
readonly height: number

Height in document units.

propertywidth
readonly width: number

Width in document units.

propertyx
readonly x: number

Left edge in document coordinates.

propertyy
readonly y: number

Top edge in document coordinates.

interfaceDocPageLayoutsource ↗
interface DocPageLayout

Layout metadata for one document page.

propertyblockIds
readonly blockIds: readonly DocNodeId[]

Block ids that intersect this page.

propertyindex
readonly index: number

Zero-based page index.

propertyrect
readonly rect: DocLayoutRect

Page rectangle in document coordinates.

interfaceDocViewportRangesource ↗
interface DocViewportRange

Inclusive visible block/page range within the current document viewport.

propertyendBlock
readonly endBlock: number

Last top-level document block index included in the buffered viewport.

propertyendPage
readonly endPage: number

Last page index included in the buffered viewport.

propertystartBlock
readonly startBlock: number

First top-level document block index included in the buffered viewport.

propertystartPage
readonly startPage: number

First page index included in the buffered viewport.

interfaceDocViewportScrollSourcesource ↗
interface DocViewportScrollSource

Minimal scroll/viewport contract needed to compute a document viewport range.

methodgetShape
getShape(): readonly [number, number]

Returns the viewport width/height.

methodgetState
getState(): { x: number; y: number }

Returns the current scroll offset in document coordinates.

interfaceLayoutLinesource ↗
interface LayoutLine

A single wrapped line inside the editor, with full path metadata for
bidirectional cursor ↔ pixel coordinate mapping.

propertychars
chars: RichTextChar[]

Per-character measurements for this line.

propertycharStartOffset
charStartOffset: number

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.

propertycursorXOffsets
cursorXOffsets?: number[]

Cursor boundary x offsets relative to this line's x, one entry per char boundary.

propertyfontAscent
fontAscent: number

Font ascent: distance from baseline to top of tallest glyph on this line.

propertyheight
height: number

Line height in CSS/canvas pixels.

propertytextNodePath
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 <= offset <= charStartOffset + chars.length.

propertyx
x: number

Left edge of text, relative to editor box top-left (includes cellPadding).

propertyy
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.

interfaceLayoutSnapshotsource ↗
interface LayoutSnapshot

Pre-computed layout for the entire editing session.

propertylines
lines: LayoutLine[]
typeDocBlockLayoutDiffStatussource ↗
type DocBlockLayoutDiffStatus = "unchanged" | "shifted" | "changed" | "added" | "removed"
typeDocBlockRenderFrameModesource ↗
type DocBlockRenderFrameMode = "rebuild" | "full" | "scroll" | "block-copy" | "skipped"
typeDocVerticalAlignsource ↗
type DocVerticalAlign = "top" | "center"

Vertical positioning strategy for a laid-out document frame.

functioncomputeViewportRangesource ↗
computeViewportRange(scrollSource: DocViewportScrollSource, layoutCache: DocLayoutCache, pageMap: DocPageMap, offset?: { x: number; 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.

scrollSource: DocViewportScrollSource
layoutCache: DocLayoutCache
pageMap: DocPageMap
offset: { x: number; y: number }
functionlockLayoutSnapshotsource ↗
lockLayoutSnapshot(snapshot: LayoutSnapshot): LayoutSnapshot

Locks a completed layout so readers cannot change cursor or render geometry.

snapshot: LayoutSnapshot

Package

@searsuite/sear-domain-format

15 exports

Portable cell-format values and formatting contracts.

interfaceExcelDatePartssource ↗
interface ExcelDateParts
propertyday
readonly day: number
propertymonth
readonly month: number
propertyphantomLeapDay
readonly phantomLeapDay?: boolean
propertyyear
readonly year: number
interfaceSpreadsheetErrorValuesource ↗
interface SpreadsheetErrorValue
propertycode
readonly code: string
propertykind
readonly kind: "error"
interfaceSpreadsheetFormatDisplaysource ↗
interface SpreadsheetFormatDisplay

Display metadata selected from one Excel number-format section.

propertycolor
readonly color?: string
propertyfillCharacter
readonly fillCharacter?: string
propertytext
readonly text: string
interfaceSpreadsheetFormatLocalesource ↗
interface SpreadsheetFormatLocale
propertydatePattern
readonly datePattern: string
propertydateTimePattern
readonly dateTimePattern: string
propertydecimalSeparator
readonly decimalSeparator?: string
propertygroupSeparator
readonly groupSeparator?: string
propertylocale
readonly locale: string
propertytimePattern
readonly timePattern: string
interfaceSpreadsheetTextValuesource ↗
interface SpreadsheetTextValue
propertykind
readonly kind: "text"
propertyvalue
readonly value: string
typeSpreadsheetFormatValuesource ↗
type SpreadsheetFormatValue = string | number | boolean | null | undefined | SpreadsheetTextValue | SpreadsheetErrorValue | readonly SpreadsheetFormatValue[] | readonly readonly SpreadsheetFormatValue[][]
variableDefaultSpreadsheetFormatLocalesource ↗
DefaultSpreadsheetFormatLocale: SpreadsheetFormatLocale
functionexcelDatePartsFromSerialsource ↗
excelDatePartsFromSerial(serial: number): ExcelDateParts | null
serial: number
functionformatDollarsource ↗
formatDollar(number: number, decimals: number, currencySymbol?: string): string
number: number
decimals: number
currencySymbol: string
functionformatExcelDateTimesource ↗
formatExcelDateTime(serial: number, pattern?: string, locale?: SpreadsheetFormatLocale): string

Formats an Excel date/time serial with date, clock, and elapsed-time tokens.

serial: number
pattern: string
locale: SpreadsheetFormatLocale
functionformatExcelDisplaysource ↗
formatExcelDisplay(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): SpreadsheetFormatDisplay | SpreadsheetErrorValue | null

Formats a scalar value and preserves section-level visual metadata.

value: SpreadsheetFormatValue
formatText: string
locale: SpreadsheetFormatLocale
functionformatExcelTextsource ↗
formatExcelText(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): string | SpreadsheetErrorValue | null
value: SpreadsheetFormatValue
formatText: string
locale: SpreadsheetFormatLocale
functionformatFixedsource ↗
formatFixed(number: number, decimals: number, noCommas: boolean): string
number: number
decimals: number
noCommas: boolean
functionformatSpreadsheetNumbersource ↗
formatSpreadsheetNumber(value: number, code: string, locale?: SpreadsheetFormatLocale): string | null
value: number
code: string
locale: SpreadsheetFormatLocale
functionparseNumberValuesource ↗
parseNumberValue(source: string, decimalSeparator?: string, groupSeparator?: string): number | null
source: string
decimalSeparator: string
groupSeparator: string

Package

@searsuite/sear-domain-formula-engine-ts

606 exports

The TypeScript formula parser, evaluator, dependency graph, and built-in function runtime.

classAggregationCachesource ↗
class AggregationCache extends IAggregationCache

Caches incremental aggregate results for large formula ranges.

constructorconstructor
AggregationCache(): AggregationCache
propertysymbolstatic
readonly symbol: typeof symbol
methodclear
clear(): void

Clears all caches.

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

Binds cache writes to the owning editor command dispatch after initialization.

isCommandExecuting: (): boolean
methodgetCount
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.

startRow: number
startCol: number
endRow: number
endCol: number
methodgetSum
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: number
Start row (0-based).
startCol: number
Start column (0-based).
endRow: number
End row (0-based).
endCol: number
End column (0-based).
methodonCellChanged
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: number
Changed row (0-based).
col: number
Changed column (0-based).
oldVal: FormulaValue
Previous value.
newVal: FormulaValue
New value.
methodonStructureChanged
onStructureChanged(): void

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.

methodsetCount
setCount(startRow: number, startCol: number, endRow: number, endCol: number, count: number): void

Stores a successfully calculated COUNT for a rectangular range.

startRow: number
startCol: number
endRow: number
endCol: number
count: number
methodsetSum
setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): void

Stores a successfully calculated SUM for a rectangular range.

startRow: number
startCol: number
endRow: number
endCol: number
sum: number
classAsyncFormulaServiceCachesource ↗
class AsyncFormulaServiceCache<TKey, TValue>

Host-driven async cache. read() never starts work or returns a Promise.

constructorconstructor
AsyncFormulaServiceCache<TKey, TValue>(loader: (key: TKey): Promise<TValue>, warn?: (message: string, error: unknown): void): AsyncFormulaServiceCache<TKey, TValue>
loader: (key: TKey): Promise<TValue>
warn: (message: string, error: unknown): void
methodclear
clear(): void

Drops values and ignores results from requests started before this boundary.

methoddestroy
destroy(): void
methodload
load(key: TKey): Promise<void>

Loads one value, deduplicating concurrent requests for the same key.

key: TKey
methodread
read(key: TKey): FormulaServiceCacheResult<TValue>
key: TKey
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
classDependencyGraphsource ↗
class DependencyGraph extends IDependencyGraph

Tracks formula dependencies, dirty propagation, evaluation readiness, and cycles.

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

DI token for resolving DependencyGraph.

memberpendingCount
pendingCount: unknown

Number of dirty formulas still waiting for evaluation.

membersize
size: unknown

Total number of formula cells currently in the graph.

methodclear
clear(): void

Clears all data.

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

Binds mutations to the owning editor command dispatch after initialization.

isCommandExecuting: (): boolean
methodgetDependencies
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.

formulaKey: number
methodgetDependents
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)

key: number
methodgetFormulaKeys
getFormulaKeys(): readonly number[]

Gets a defensive snapshot of formula cells currently registered in the graph.

methodgetLastCycleKeys
getLastCycleKeys(): number[]

Returns the last cycle keys.

methodgetNextReadyBatch
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.

viewport: Set<number>
maxCount: number
methodisDirty
isDirty(key: number): boolean

Reports whether one formula cell is currently dirty.

key: number
methodmarkClean
markClean(key: number): void

Marks one formula clean.

Unlocks downstream dependencies by decrementing dirtyDepCount for every
dirty formula that depends on key.

key: number
methodmarkDirty
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.

changedKeys: number[]
methodonStructureChanged
onStructureChanged(changes: StructureChange[]): void

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.

changes: StructureChange[]
methodremoveCell
removeCell(formulaKey: number): void

Removes one formula cell.

formulaKey: number
methodupdateCell
updateCell(formulaKey: number, depsList: Dependency[]): void

Registers or updates dependencies for one formula cell.

formulaKey: number
depsList: Dependency[]
classFormulaCubeCachesource ↗
class FormulaCubeCache extends FormulaCubeService

Host-driven OLAP cache. Formula evaluation reads synchronously and never starts connection I/O.

constructorconstructor
FormulaCubeCache(loader: (query: FormulaCubeQuery): Promise<FormulaCubeResult>, warn?: (message: string, error: unknown): void): FormulaCubeCache
loader: (query: FormulaCubeQuery): Promise<FormulaCubeResult>
warn: (message: string, error: unknown): void
methodclear
clear(): void
methoddestroy
destroy(): void
methodload
load(query: FormulaCubeQuery): Promise<void>
query: FormulaCubeQuery
methodread
read(query: FormulaCubeQuery): FormulaServiceCacheResult<FormulaCubeResult>
query: FormulaCubeQuery
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
classFormulaEvaluatorsource ↗
class FormulaEvaluator extends IFormulaEvaluator

Evaluates parsed formulas against an explicit host-provided context.

constructorconstructor
FormulaEvaluator(registry: IFunctionRegistry, aggCache: IAggregationCache): FormulaEvaluator

Creates a FormulaEvaluator instance.

registry: IFunctionRegistry
aggCache: IAggregationCache
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaEvaluator.

methodevaluate
evaluate(ast: FormulaAST, context: EvalContext): FormulaValue

Evaluates one AST.

Recursively traverses each AST node and executes the matching operation.

ast: FormulaAST
context: EvalContext
methodevaluateBatch
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.

asts: { ast: FormulaAST; key: number }[]
context: EvalContext
methodregisterFunction
registerFunction(fn: FormulaFunction): void

Registers a custom function.

fn: FormulaFunction
classFormulaExecutionBudgetsource ↗
class FormulaExecutionBudget extends FormulaEvaluationBudget

Mutable, deterministic guard against unbounded formula work.

constructorconstructor
FormulaExecutionBudget(maxSteps?: number): FormulaExecutionBudget
maxSteps: number
propertymaxSteps
readonly maxSteps: number
methodconsumeStep
consumeStep(): boolean
classFormulaExternalServiceRegistrysource ↗
class FormulaExternalServiceRegistry extends IFormulaExternalServiceProvider

Tokenized editor-local external-service registry with isolated listener failures.

constructorconstructor
FormulaExternalServiceRegistry(warn?: (message: string, error: unknown): void): FormulaExternalServiceRegistry
warn: (message: string, error: unknown): void
methoddestroy
destroy(ownerToken?: object): void
ownerToken: object
methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
isCommandExecuting: (): boolean
dispatchRemoval: (id: number): void
methodenforceTeardownBoundary
enforceTeardownBoundary(ownerToken: object): void

Reserves cleanup of an assembled registry for its owning editor.

ownerToken: object
methodget
get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefined
definition: FormulaExternalServiceDefinition<T>
methodinvalidate
invalidate<T>(definition: FormulaExternalServiceDefinition<T>): void
definition: FormulaExternalServiceDefinition<T>
methodregister
register<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): void
definition: FormulaExternalServiceDefinition<T>
service: T
methodsubscribeInvalidation
subscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): void
listener: (serviceIds: readonly string[]): void
methodunregisterRegistration
unregisterRegistration(id: number): void
id: number
classFormulaFormattersource ↗
class FormulaFormatter

Formats the shared FormulaAST back to formula source text.

constructorconstructor
FormulaFormatter(): FormulaFormatter
methodformat
format(ast: FormulaAST, options?: WorkbookFormulaFormatOptions): string
ast: FormulaAST
options: WorkbookFormulaFormatOptions
classFormulaGoogleServiceCachesource ↗
class FormulaGoogleServiceCache extends FormulaGoogleService

Host-driven cache for AI, import, finance, and translation formulas.

constructorconstructor
FormulaGoogleServiceCache(loader: (request: FormulaGoogleRequest): Promise<FormulaValue>, warn?: (message: string, error: unknown): void): FormulaGoogleServiceCache
loader: (request: FormulaGoogleRequest): Promise<FormulaValue>
warn: (message: string, error: unknown): void
methodclear
clear(): void
methoddestroy
destroy(): void
methodload
load(request: FormulaGoogleRequest): Promise<void>
request: FormulaGoogleRequest
methodread
read(request: FormulaGoogleRequest): FormulaServiceCacheResult<FormulaValue>
request: FormulaGoogleRequest
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
classFormulaLexicalScopesource ↗
class FormulaLexicalScope extends FormulaEvaluationScope

Case-insensitive lexical scope for LET bindings.

constructorconstructor
FormulaLexicalScope(parent?: FormulaEvaluationScope): FormulaLexicalScope
parent: FormulaEvaluationScope
propertyparent
readonly parent?: FormulaEvaluationScope
methodget
get(name: string): FormulaValue | undefined
name: string
methodset
set(name: string, value: FormulaValue): void
name: string
value: FormulaValue
classFormulaParsersource ↗
class FormulaParser extends IFormulaParser

Parses formula source and rewrites structural references.

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

DI token for resolving FormulaParser.

methodextractDependencies
extractDependencies(ast: FormulaAST): Dependency[]

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.

ast: FormulaAST
methodparse
parse(formula: string): FormulaAST

Parses a formula string into an AST.

ReturnsParsed AST.

formula: string
Formula string including the leading '=', such as "=A1+B1".
methodshiftReferences
shiftReferences(ast: FormulaAST, changes: StructureChange[]): FormulaAST

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.

ast: FormulaAST
changes: StructureChange[]
classFormulaStockHistoryCachesource ↗
class FormulaStockHistoryCache extends FormulaStockHistoryService

Host-driven STOCKHISTORY cache; the loader owns transport, credentials, policy, and normalization.

constructorconstructor
FormulaStockHistoryCache(loader: (request: FormulaStockHistoryRequest): Promise<FormulaError | unknown[][]>, warn?: (message: string, error: unknown): void): FormulaStockHistoryCache
loader: (request: FormulaStockHistoryRequest): Promise<FormulaError | FormulaValue[][]>
warn: (message: string, error: unknown): void
methodclear
clear(): void
methoddestroy
destroy(): void
methodload
load(request: FormulaStockHistoryRequest): Promise<void>
request: FormulaStockHistoryRequest
methodread
read(request: FormulaStockHistoryRequest): FormulaServiceCacheResult<FormulaError | FormulaValue[][]>
request: FormulaStockHistoryRequest
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
classFormulaTextServiceRegistrysource ↗
class FormulaTextServiceRegistry extends IFormulaTextServiceProvider

Default tokenized editor-local registry for metadata and cached external formula services.

constructorconstructor
FormulaTextServiceRegistry(): FormulaTextServiceRegistry
methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
isCommandExecuting: (): boolean
dispatchRemoval: (id: number): void
methodgetLanguageService
getLanguageService(): FormulaLanguageService | undefined
methodgetPhoneticReader
getPhoneticReader(): FormulaPhoneticReader | undefined
methodregisterLanguageService
registerLanguageService(service: FormulaLanguageService): (): void
service: FormulaLanguageService
methodregisterPhoneticReader
registerPhoneticReader(reader: FormulaPhoneticReader): (): void
reader: FormulaPhoneticReader
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
methodunregisterRegistration
unregisterRegistration(id: number): void
id: number
classFormulaWebServiceCachesource ↗
class FormulaWebServiceCache extends AsyncFormulaServiceCache<string, string | FormulaError>, FormulaWebService

Host-driven WEBSERVICE cache; loaders own HTTP status checks, cancellation, and network policy.

constructorconstructor
FormulaWebServiceCache(loader: (url: string): Promise<string>, warn?: (message: string, error: unknown): void): FormulaWebServiceCache
loader: (url: string): Promise<string>
warn: (message: string, error: unknown): void
methodclearinherited
clear(): void

Drops values and ignores results from requests started before this boundary.

methoddestroyinherited
destroy(): void
methodloadinherited
load(key: string): Promise<void>

Loads one value, deduplicating concurrent requests for the same key.

key: string
methodreadinherited
read(key: string): FormulaServiceCacheResult<string | FormulaError>
key: string
methodsubscribeInvalidationinherited
subscribeInvalidation(listener: (): void): (): void
listener: (): void
classFunctionRegistrysource ↗
class FunctionRegistry extends IFunctionRegistry

Public contract for IFunctionRegistry.

constructorconstructor
FunctionRegistry(options?: FunctionRegistryOptions): FunctionRegistry

Creates a FunctionRegistry instance.

options: FunctionRegistryOptions
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FunctionRegistry.

methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Requires post-initialization writes to occur during the owning editor's command dispatch.

isCommandExecuting: (): boolean
dispatchRemoval: (id: number): void
methodget
get(name: string): FormulaFunction | undefined

Returns the value.

name: string
methodhas
has(name: string): boolean

Returns whether the requested entry exists.

name: string
methodlist
list(): string[]

Returns all registered entries.

methodregister
register(fn: FormulaFunction): (): void

Registers a formula function under its canonical and compatible names.

fn: FormulaFunction
methodregisterMany
registerMany(functions: readonly FormulaFunction[]): (): void

Registers multiple functions while publishing one combined invalidation.

functions: readonly FormulaFunction[]
methodsubscribe
subscribe(listener: (functionNames: readonly string[]): void): (): void

Subscribes to registrations and removals that can change formula results.

listener: (functionNames: readonly string[]): void
methodunregisterRegistration
unregisterRegistration(id: number): void

Removes one tokenized registration; disposal may dispatch an owner command.

id: number
classWebFormulaAddInServicesource ↗
class WebFormulaAddInService extends FormulaAddInService

Web host adapter: browsers cannot resolve or invoke native add-in procedures.

constructorconstructor
WebFormulaAddInService(): WebFormulaAddInService
methodcall
call(_request: FormulaAddInCall): FormulaServiceCacheResult<FormulaValue>
_request: FormulaAddInCall
methodresolveRegistration
resolveRegistration(_request: FormulaAddInRegistrationRequest): FormulaServiceCacheResult<number>
_request: FormulaAddInRegistrationRequest
interfaceCouponSchedulesource ↗
interface CouponSchedule

Coupon schedule resolved around a bond settlement date.

propertybasis
readonly basis: FinancialDayCountBasis
propertycouponsRemaining
readonly couponsRemaining: number
propertydaysFromPrevious
readonly daysFromPrevious: number
propertydaysInPeriod
readonly daysInPeriod: number
propertydaysToNext
readonly daysToNext: number
propertyfrequency
readonly frequency: 1 | 2 | 4
propertynextCoupon
readonly nextCoupon: number
propertypreviousCoupon
readonly previousCoupon: number
interfaceExcelDatePartssource ↗
interface ExcelDateParts
propertyday
readonly day: number
propertymonth
readonly month: number
propertyphantomLeapDay
readonly phantomLeapDay?: boolean
propertyyear
readonly year: number
interfaceExcelDateTimeParseOptionssource ↗
interface ExcelDateTimeParseOptions extends FormulaDateTimeParseOptions

Options passed to locale-aware formula date/time parsers.

propertycurrentDateTimeinherited
readonly currentDateTime?: number
propertylocale
readonly locale?: FormulaDateTimeLocale
interfaceFinancialRootOptionssource ↗
interface FinancialRootOptions
propertyinitialGuess
readonly initialGuess?: number
propertylowerBound
readonly lowerBound?: number
propertymaxIterations
readonly maxIterations?: number
propertytolerance
readonly tolerance?: number
propertyupperBound
readonly upperBound?: number
interfaceFunctionRegistryOptionssource ↗
interface FunctionRegistryOptions

FunctionRegistry public API.

propertyexcludedBuiltinNames
readonly excludedBuiltinNames?: readonly string[]

Built-ins omitted from the initial catalog; hosts may register them later.

propertyincludeGoogleFunctions
readonly includeGoogleFunctions?: boolean

Google-specific functions require an explicit host contribution when disabled.

interfaceParsedCellRefsource ↗
interface ParsedCellRef

Parsed A1 cell reference.

propertyabsCol
absCol: boolean
propertyabsRow
absRow: boolean
propertycol
col: number
propertyrow
row: number
interfaceParsedExcelDateTimesource ↗
interface ParsedExcelDateTime
propertyhasDate
readonly hasDate: boolean
propertyhasTime
readonly hasTime: boolean
propertyserial
readonly serial: number
interfaceWorkbookFormulaFormatOptionssource ↗
interface WorkbookFormulaFormatOptions

Workbook name resolution used while formatting formula source.

propertymissingSheetName
readonly missingSheetName?: string
propertyresolveSheetName
readonly resolveSheetName?: (formulaSheetName: string): string | undefined
typeBondResultsource ↗
type BondResult = number | FormulaError
typeBuiltInExcelDateTimeLocaleIdsource ↗
type BuiltInExcelDateTimeLocaleId = typeof BuiltInExcelDateTimeLocaleId[keyof typeof BuiltInExcelDateTimeLocaleId]

Built-in locale identifiers registered by sear-plugin-i18n.

typeDayCountResultsource ↗
type DayCountResult = number | FormulaError
typeDepreciationResultsource ↗
type DepreciationResult = number | FormulaError
typeFinancialDayCountBasissource ↗
type FinancialDayCountBasis = 0 | 1 | 2 | 3 | 4

Excel financial day-count conventions.

typeFinancialNumberResultsource ↗
type FinancialNumberResult = number | FormulaError
typeFinancialRootResultsource ↗
type FinancialRootResult = number | FormulaError
variableABSsource ↗
ABS: FormulaFunction

ABS: Returns the absolute value of a number.

Example
=ABS(-2) returns 2.
variableACCRINTsource ↗
ACCRINT: FormulaFunction

ACCRINT: accrued interest for a periodically paying security.

variableACCRINTMsource ↗
ACCRINTM: FormulaFunction

ACCRINTM: accrued interest for a security paying interest at maturity.

variableACOSsource ↗
ACOS: FormulaFunction

ACOS: Returns the arccosine of a number in radians.

Example
=ACOS(1) returns 0.
variableACOSHsource ↗
ACOSH: FormulaFunction

ACOSH: Returns the inverse hyperbolic cosine of a number.

Example
=ACOSH(2) returns approximately 1.316957897.
variableACOTsource ↗
ACOT: FormulaFunction

ACOT: Returns the arccotangent of a number in radians.

Example
=ACOT(1) returns pi/4.
variableACOTHsource ↗
ACOTH: FormulaFunction

ACOTH: Returns the inverse hyperbolic cotangent of a number.

Example
=ACOTH(2) returns approximately 0.549306144.
variableADDsource ↗
ADD: FormulaFunction

ADD returns the sum of two values. Example: =ADD(2,3) returns 5.

variableaddInFunctionssource ↗
addInFunctions: readonly FormulaFunction[]
variableADDRESSsource ↗
ADDRESS: FormulaFunction

ADDRESS returns an A1 or R1C1 address. Example: =ADDRESS(2,3) returns $C$2.

variableAGGREGATEsource ↗
AGGREGATE: FormulaFunction

AGGREGATE: Applies an aggregate operation while honoring options for hidden rows and errors.

Example
=AGGREGATE(4,6,{1,2,3}) returns 3.
variableAIsource ↗
AI: FormulaFunction

AI reads a Gemini result from a host-managed cache. Example: =AI("Summarize",A1) returns cached generated text.

variableAMORDEGRCsource ↗
AMORDEGRC: FormulaFunction

AMORDEGRC: declining-balance depreciation with a French accounting coefficient.

variableAMORLINCsource ↗
AMORLINC: FormulaFunction

AMORLINC: straight-line depreciation prorated over the first period.

variableANDsource ↗
AND: FormulaFunction

AND: Returns TRUE when every supplied logical value is TRUE.

Example
=AND(TRUE,1)
variableARABICsource ↗
ARABIC: FormulaFunction

ARABIC: Converts a Roman numeral text value to an Arabic number.

Example
=ARABIC("MCMXCIX") returns 1999.
variableAREASsource ↗
AREAS: FormulaFunction

AREAS counts areas in a reference. Example: =AREAS(A1:B2) returns 1.

variableARRAY_CONSTRAINsource ↗
ARRAY_CONSTRAIN: FormulaFunction

ARRAY_CONSTRAIN limits an array to a row and column count. Example: =ARRAY_CONSTRAIN(A1:C3,2,1).

variableARRAYFORMULAsource ↗
ARRAYFORMULA: FormulaFunction

ARRAYFORMULA exposes an expression's array result. Example: =ARRAYFORMULA({1,2}*2) returns {2,4}.

variableARRAYTOTEXTsource ↗
ARRAYTOTEXT: FormulaFunction

Converts an array to concise or strict text. Example: ARRAYTOTEXT({1,"A"},1) returns "{1,\"A\"}".

variableASCsource ↗
ASC: FormulaFunction

Converts full-width DBCS characters to half-width characters. Example: ASC("ABC") returns "ABC".

variableASINsource ↗
ASIN: FormulaFunction

ASIN: Returns the arcsine of a number in radians.

Example
=ASIN(0) returns 0.
variableASINHsource ↗
ASINH: FormulaFunction

ASINH: Returns the inverse hyperbolic sine of a number.

Example
=ASINH(0) returns 0.
variableATANsource ↗
ATAN: FormulaFunction

ATAN: Returns the arctangent of a number in radians.

Example
=ATAN(0) returns 0.
variableATAN2source ↗
ATAN2: FormulaFunction

ATAN2: Returns the angle from an X and Y coordinate pair in radians.

Example
=ATAN2(1,0) returns 0.
variableATANHsource ↗
ATANH: FormulaFunction

ATANH: Returns the inverse hyperbolic tangent of a number.

Example
=ATANH(0) returns 0.
variableAVEDEVsource ↗
AVEDEV: FormulaFunction

AVEDEV formula.
Evaluates the Excel-compatible AVEDEV statistical function.
Example: =AVEDEV(1,2,3).

variableAVERAGEsource ↗
AVERAGE: FormulaFunction

AVERAGE: Returns the arithmetic mean of numeric values.

Example
=AVERAGE(10,20,30) returns 20.
variableAVERAGE_WEIGHTEDsource ↗
AVERAGE_WEIGHTED: FormulaFunction

AVERAGE_WEIGHTED formula. Computes a weighted arithmetic mean. Example: =AVERAGE_WEIGHTED({10,20},{1,3}) returns 17.5.

variableAVERAGE_WEIGHTED_DOTTEDsource ↗
AVERAGE_WEIGHTED_DOTTED: FormulaFunction

AVERAGE.WEIGHTED is the dotted Google Sheets alias. Example: =AVERAGE.WEIGHTED({10,20},{1,3}) returns 17.5.

variableAVERAGEAsource ↗
AVERAGEA: FormulaFunction

AVERAGEA formula.
Evaluates the Excel-compatible AVERAGEA statistical function.
Example: =AVERAGEA(1,2,3).

variableAVERAGEIFsource ↗
AVERAGEIF: FormulaFunction

AVERAGEIF formula.
Evaluates the Excel-compatible AVERAGEIF statistical function.
Example: =AVERAGEIF(1,2,3).

variableAVERAGEIFSsource ↗
AVERAGEIFS: FormulaFunction

AVERAGEIFS formula.
Evaluates the Excel-compatible AVERAGEIFS statistical function.
Example: =AVERAGEIFS(1,2,3).

variableBAHTTEXTsource ↗
BAHTTEXT: FormulaFunction

Spells a number as Thai baht and satang. Example: BAHTTEXT(1234) returns Thai amount text.

variableBASEsource ↗
BASE: FormulaFunction

BASE: Converts a nonnegative integer to text in a selected radix.

Example
=BASE(31,16) returns "1F".
variableBETA_DISTsource ↗
BETA_DIST: FormulaFunction

BETA.DIST formula.
Evaluates the Excel-compatible BETA.DIST statistical function.
Example: =BETA.DIST(1,1,TRUE).

variableBETA_INVsource ↗
BETA_INV: FormulaFunction

BETA.INV formula.
Evaluates the Excel-compatible BETA.INV statistical function.
Example: =BETA.INV(0.5,1,1).

variableBETADISTsource ↗
BETADIST: FormulaFunction

BETADIST compatibility formula: Returns the cumulative beta distribution using the legacy signature.

Example
=BETADIST(2,8,10,1,3)
variableBETAINVsource ↗
BETAINV: FormulaFunction

BETAINV compatibility formula: Returns the inverse cumulative beta distribution.

Example
=BETAINV(0.685470581,8,10,1,3)
variableBINOM_DISTsource ↗
BINOM_DIST: FormulaFunction

BINOM.DIST formula.
Evaluates the Excel-compatible BINOM.DIST statistical function.
Example: =BINOM.DIST(1,1,TRUE).

variableBINOM_DIST_RANGEsource ↗
BINOM_DIST_RANGE: FormulaFunction

BINOM.DIST.RANGE formula.
Evaluates the Excel-compatible BINOM.DIST.RANGE statistical function.
Example: =BINOM.DIST.RANGE(1,1,TRUE).

variableBINOM_INVsource ↗
BINOM_INV: FormulaFunction

BINOM.INV formula.
Evaluates the Excel-compatible BINOM.INV statistical function.
Example: =BINOM.INV(0.5,1,1).

variableBINOMDISTsource ↗
BINOMDIST: FormulaFunction

BINOMDIST compatibility formula: Returns a binomial probability using the legacy function name.

Example
=BINOMDIST(6,10,0.5,FALSE)
variableBuiltInExcelDateTimeLocaleIdsource ↗
BuiltInExcelDateTimeLocaleId: { Chinese: "zh"; English: "en" }

Built-in locale identifiers registered by sear-plugin-i18n.

variableCALLsource ↗
CALL: FormulaFunction

Calls a host-authorized add-in procedure by registration id or module signature.
Example: =CALL("example","entry","JJ",1) invokes entry with the argument 1.

variableCEILINGsource ↗
CEILING: FormulaFunction

CEILING compatibility formula: Rounds a number up to a legacy significance multiple.

Example
=CEILING(2.5,1)
variableCEILING_MATHsource ↗
CEILING_MATH: FormulaFunction

CEILING.MATH: Rounds a number up to the nearest multiple.

Example
=CEILING.MATH(24.3,5) returns 25.
variableCEILING_PRECISEsource ↗
CEILING_PRECISE: FormulaFunction

CEILING.PRECISE: Rounds a number up to the nearest multiple, using an absolute direction.

Example
=CEILING.PRECISE(-4.3,2) returns -4.
variableCELLsource ↗
CELL: FormulaFunction

CELL: Returns information about a referenced cell.

Example
=CELL("row",B3)
variableCHARsource ↗
CHAR: FormulaFunction

Returns the character for a code-page number. Example: CHAR(65) returns "A".

variableCHIDISTsource ↗
CHIDIST: FormulaFunction

CHIDIST compatibility formula: Returns the right-tailed chi-square probability.

Example
=CHIDIST(18.307,10)
variableCHIINVsource ↗
CHIINV: FormulaFunction

CHIINV compatibility formula: Returns the inverse right-tailed chi-square value.

Example
=CHIINV(0.05,10)
variableChineseExcelDateTimeLocalesource ↗
ChineseExcelDateTimeLocale: FormulaDateTimeLocale

Chinese Excel-style date/time text parser and formatter.

variableChineseExcelDateTimeSymbolssource ↗
ChineseExcelDateTimeSymbols: FormulaDateTimeSymbols

Chinese symbols consumed by the shared Excel-compatible date/time parser.

variableCHISQ_DISTsource ↗
CHISQ_DIST: FormulaFunction

CHISQ.DIST formula.
Evaluates the Excel-compatible CHISQ.DIST statistical function.
Example: =CHISQ.DIST(1,1,TRUE).

variableCHISQ_DIST_RTsource ↗
CHISQ_DIST_RT: FormulaFunction

CHISQ.DIST.RT formula.
Evaluates the Excel-compatible CHISQ.DIST.RT statistical function.
Example: =CHISQ.DIST.RT(1,1,TRUE).

variableCHISQ_INVsource ↗
CHISQ_INV: FormulaFunction

CHISQ.INV formula.
Evaluates the Excel-compatible CHISQ.INV statistical function.
Example: =CHISQ.INV(0.5,1,1).

variableCHISQ_INV_RTsource ↗
CHISQ_INV_RT: FormulaFunction

CHISQ.INV.RT formula.
Evaluates the Excel-compatible CHISQ.INV.RT statistical function.
Example: =CHISQ.INV.RT(0.5,1,1).

variableCHISQ_TESTsource ↗
CHISQ_TEST: FormulaFunction

CHISQ.TEST formula.
Evaluates the Excel-compatible CHISQ.TEST statistical function.
Example: =CHISQ.TEST(1,2,3).

variableCHITESTsource ↗
CHITEST: FormulaFunction

CHITEST compatibility formula: Returns the chi-square independence test probability.

Example
=CHITEST({58,35;11,25},{45,48;24,22})
variableCHOOSEsource ↗
CHOOSE: FormulaFunction

CHOOSE selects a value by index. Example: =CHOOSE(2,"A","B") returns B.

variableCHOOSECOLSsource ↗
CHOOSECOLS: FormulaFunction

CHOOSECOLS selects columns from an array. Example: =CHOOSECOLS(A1:C2,1,3).

variableCHOOSEROWSsource ↗
CHOOSEROWS: FormulaFunction

CHOOSEROWS selects rows from an array. Example: =CHOOSEROWS(A1:C3,1,3).

variableCjkFormulaTextLocalesource ↗
CjkFormulaTextLocale: FormulaTextLocale

Excel-compatible CJK text locale where wide CJK code points count as two bytes.

variableCLEANsource ↗
CLEAN: FormulaFunction

Removes ASCII control characters 0 through 31. Example: CLEAN(CHAR(9)&"A") returns "A".

variableCODEsource ↗
CODE: FormulaFunction

Returns the code of the first character. Example: CODE("A") returns 65.

variableCOLUMNsource ↗
COLUMN: FormulaFunction

COLUMN returns a reference's first column number. Example: =COLUMN(C5) returns 3.

variableCOLUMNSsource ↗
COLUMNS: FormulaFunction

COLUMNS returns the number of columns in a reference. Example: =COLUMNS(A1:C2) returns 3.

variableCOMBINsource ↗
COMBIN: FormulaFunction

COMBIN: Returns the number of combinations for choosing items without repetition.

Example
=COMBIN(8,2) returns 28.
variableCOMBINAsource ↗
COMBINA: FormulaFunction

COMBINA: Returns the number of combinations for choosing items with repetition.

Example
=COMBINA(4,3) returns 20.
variablecompatibilityFunctionssource ↗
compatibilityFunctions: readonly FormulaFunction[]
variableCompatibleExcelDateTimeLocalesource ↗
CompatibleExcelDateTimeLocale: FormulaDateTimeLocale

Legacy alias for the default parser, which now falls back to English symbols.

variableCONCATsource ↗
CONCAT: FormulaFunction

Joins text and ranges without a delimiter. Example: CONCAT("A",1) returns "A1".

variableCONCATENATEsource ↗
CONCATENATE: FormulaFunction

Legacy text concatenation. Example: CONCATENATE("Hello"," World") returns "Hello World".

variableCONFIDENCEsource ↗
CONFIDENCE: FormulaFunction

CONFIDENCE compatibility formula: Returns a normal-distribution confidence interval.

Example
=CONFIDENCE(0.05,2.5,50)
variableCONFIDENCE_NORMsource ↗
CONFIDENCE_NORM: FormulaFunction

CONFIDENCE.NORM formula.
Evaluates the Excel-compatible CONFIDENCE.NORM statistical function.
Example: =CONFIDENCE.NORM(1,2,3).

variableCONFIDENCE_Tsource ↗
CONFIDENCE_T: FormulaFunction

CONFIDENCE.T formula.
Evaluates the Excel-compatible CONFIDENCE.T statistical function.
Example: =CONFIDENCE.T(1,2,3).

variableCORRELsource ↗
CORREL: FormulaFunction

CORREL formula.
Evaluates the Excel-compatible CORREL statistical function.
Example: =CORREL(1,2,3).

variableCOSsource ↗
COS: FormulaFunction

COS: Returns the cosine of an angle in radians.

Example
=COS(0) returns 1.
variableCOSHsource ↗
COSH: FormulaFunction

COSH: Returns the hyperbolic cosine of a number.

Example
=COSH(0) returns 1.
variableCOTsource ↗
COT: FormulaFunction

COT: Returns the cotangent of an angle in radians.

Example
=COT(RADIANS(45)) returns 1.
variableCOTHsource ↗
COTH: FormulaFunction

COTH: Returns the hyperbolic cotangent of a number.

Example
=COTH(1) returns approximately 1.313035285.
variableCOUNTsource ↗
COUNT: FormulaFunction

COUNT function definition.

variableCOUNTAsource ↗
COUNTA: FormulaFunction

COUNTA formula.
Evaluates the Excel-compatible COUNTA statistical function.
Example: =COUNTA(1,2,3).

variableCOUNTBLANKsource ↗
COUNTBLANK: FormulaFunction

COUNTBLANK formula.
Evaluates the Excel-compatible COUNTBLANK statistical function.
Example: =COUNTBLANK(1,2,3).

variableCOUNTIFsource ↗
COUNTIF: FormulaFunction

COUNTIF formula.
Evaluates the Excel-compatible COUNTIF statistical function.
Example: =COUNTIF(1,2,3).

variableCOUNTIFSsource ↗
COUNTIFS: FormulaFunction

COUNTIFS formula.
Evaluates the Excel-compatible COUNTIFS statistical function.
Example: =COUNTIFS(1,2,3).

variableCOUNTUNIQUEsource ↗
COUNTUNIQUE: FormulaFunction

COUNTUNIQUE counts distinct values. Example: =COUNTUNIQUE(1,1,2) returns 2.

variableCOUPDAYBSsource ↗
COUPDAYBS: FormulaFunction

COUPDAYBS: days from the beginning of a coupon period to settlement.

variableCOUPDAYSsource ↗
COUPDAYS: FormulaFunction

COUPDAYS: number of days in the coupon period containing settlement.

variableCOUPDAYSNCsource ↗
COUPDAYSNC: FormulaFunction

COUPDAYSNC: days from settlement to the next coupon.

variableCOUPNCDsource ↗
COUPNCD: FormulaFunction

COUPNCD: next coupon date after settlement.

variableCOUPNUMsource ↗
COUPNUM: FormulaFunction

COUPNUM: number of coupons remaining after settlement.

variableCOUPPCDsource ↗
COUPPCD: FormulaFunction

COUPPCD: previous coupon date before settlement.

variableCOVARsource ↗
COVAR: FormulaFunction

COVAR compatibility formula: Returns population covariance for two data sets.

Example
=COVAR({2,4,8},{5,11,12})
variableCOVARIANCE_Psource ↗
COVARIANCE_P: FormulaFunction

COVARIANCE.P formula.
Evaluates the Excel-compatible COVARIANCE.P statistical function.
Example: =COVARIANCE.P(1,2,3).

variableCOVARIANCE_Ssource ↗
COVARIANCE_S: FormulaFunction

COVARIANCE.S formula.
Evaluates the Excel-compatible COVARIANCE.S statistical function.
Example: =COVARIANCE.S(1,2,3).

variableCRITBINOMsource ↗
CRITBINOM: FormulaFunction

CRITBINOM compatibility formula: Returns the smallest binomial value meeting a cumulative probability.

Example
=CRITBINOM(6,0.5,0.75)
variableCSCsource ↗
CSC: FormulaFunction

CSC: Returns the cosecant of an angle in radians.

Example
=CSC(PI()/2) returns 1.
variableCSCHsource ↗
CSCH: FormulaFunction

CSCH: Returns the hyperbolic cosecant of a number.

Example
=CSCH(1) returns approximately 0.850918128.
variablecubeFunctionssource ↗
cubeFunctions: readonly [FormulaFunction, FormulaFunction, FormulaFunction, FormulaFunction, FormulaFunction, FormulaFunction, FormulaFunction]
variableCUBEKPIMEMBERsource ↗
CUBEKPIMEMBER: FormulaFunction

Returns a typed KPI property member. Example: CUBEKPIMEMBER("Sales","Revenue KPI",KPIGoal).

variableCUBEMEMBERsource ↗
CUBEMEMBER: FormulaFunction

Returns a typed cube member or tuple. Example: CUBEMEMBER("Sales","[Time].[Fiscal].[2004]").

variableCUBEMEMBERPROPERTYsource ↗
CUBEMEMBERPROPERTY: FormulaFunction

Returns one property of a cube member. Example: CUBEMEMBERPROPERTY("Sales","[Time].[2004]","Name").

variableCUBERANKEDMEMBERsource ↗
CUBERANKEDMEMBER: FormulaFunction

Returns the member at a one-based set rank. Example: CUBERANKEDMEMBER("Sales",A1,1).

variableCUBESETsource ↗
CUBESET: FormulaFunction

Returns a typed OLAP set. Example: CUBESET("Sales","[Product].Members","Products").

variableCUBESETCOUNTsource ↗
CUBESETCOUNT: FormulaFunction

Returns the item count of a CUBESET result. Example: CUBESETCOUNT(A1).

variableCUBEVALUEsource ↗
CUBEVALUE: FormulaFunction

Returns an aggregated cube value. Example: CUBEVALUE("Sales","[Measures].[Profit]").

variableCUMIPMTsource ↗
CUMIPMT: FormulaFunction

CUMIPMT: cumulative interest paid between two periods.

variableCUMPRINCsource ↗
CUMPRINC: FormulaFunction

CUMPRINC: cumulative principal paid between two periods.

variabledatabaseFunctionssource ↗
databaseFunctions: readonly FormulaFunction[]
variableDATEsource ↗
DATE: FormulaFunction

DATE: Creates an Excel date serial from year, month, and day parts.
Example: =DATE(2024,2,29) returns 45351.

variableDATEDIFsource ↗
DATEDIF: FormulaFunction

DATEDIF: Returns the elapsed days, months, or years between two dates.
Example: =DATEDIF("1/1/2001","1/1/2003","Y") returns 2.

variabledateTimeFunctionssource ↗
dateTimeFunctions: readonly FormulaFunction[]
variableDATEVALUEsource ↗
DATEVALUE: FormulaFunction

DATEVALUE: Converts date text into an Excel date serial.
Example: =DATEVALUE("22-MAY-2011") returns 40685.

variableDAVERAGEsource ↗
DAVERAGE: FormulaFunction

DAVERAGE: Returns the average of matching numeric database records.

Example
=DAVERAGE(A1:C5,"Sales",E1:F2)
variableDAYsource ↗
DAY: FormulaFunction

DAY: Returns the day of month for a date serial.
Example: =DAY("2011-4-15") returns 15.

variableDAYSsource ↗
DAYS: FormulaFunction

DAYS: Returns the number of days between an end date and a start date.
Example: =DAYS("2021-12-31","2021-1-1") returns 364.

variableDAYS360source ↗
DAYS360: FormulaFunction

DAYS360: Returns the day difference using a 360-day accounting year.
Example: =DAYS360("2011-1-1","2011-12-31") returns 360.

variableDBsource ↗
DB: FormulaFunction

DB: fixed-declining balance depreciation.

variableDBCSsource ↗
DBCS: FormulaFunction

Converts half-width characters to full-width DBCS characters. Example: DBCS("ABC") returns "ABC".

variableDCOUNTsource ↗
DCOUNT: FormulaFunction

DCOUNT: Counts matching database records containing numbers.

Example
=DCOUNT(A1:C5,"Sales",E1:F2)
variableDCOUNTAsource ↗
DCOUNTA: FormulaFunction

DCOUNTA: Counts matching nonblank database records.

Example
=DCOUNTA(A1:C5,"Name",E1:F2)
variableDDBsource ↗
DDB: FormulaFunction

DDB: double-declining or custom-factor depreciation.

variableDECIMALsource ↗
DECIMAL: FormulaFunction

DECIMAL: Converts text in a selected radix to a decimal number.

Example
=DECIMAL("1010",2) returns 10.
variableDEGREESsource ↗
DEGREES: FormulaFunction

DEGREES: Converts an angle from radians to degrees.

Example
=DEGREES(PI()) returns 180.
variableDETECTLANGUAGEsource ↗
DETECTLANGUAGE: FormulaFunction

Reads language detection from the host cache. Example: DETECTLANGUAGE("hello") commonly returns "en".

variableDEVSQsource ↗
DEVSQ: FormulaFunction

DEVSQ formula.
Evaluates the Excel-compatible DEVSQ statistical function.
Example: =DEVSQ(1,2,3).

variableDGETsource ↗
DGET: FormulaFunction

DGET: Returns the single field value from exactly one matching record.

Example
=DGET(A1:C5,"Sales",E1:F2)
variableDISCsource ↗
DISC: FormulaFunction

DISC: annualized discount rate for a discounted security.

variableDIVIDEsource ↗
DIVIDE: FormulaFunction

DIVIDE divides one value by another. Example: =DIVIDE(6,2) returns 3.

variableDMAXsource ↗
DMAX: FormulaFunction

DMAX: Returns the largest matching numeric database value.

Example
=DMAX(A1:C5,"Sales",E1:F2)
variableDMINsource ↗
DMIN: FormulaFunction

DMIN: Returns the smallest matching numeric database value.

Example
=DMIN(A1:C5,"Sales",E1:F2)
variableDOLLARsource ↗
DOLLAR: FormulaFunction

Formats a number as currency text. Example: DOLLAR(1234.5,2) returns "$1,234.50".

variableDOLLARDEsource ↗
DOLLARDE: FormulaFunction

DOLLARDE: converts a fractional dollar price to a decimal price.

variableDOLLARFRsource ↗
DOLLARFR: FormulaFunction

DOLLARFR: converts a decimal dollar price to a fractional price.

variableDPRODUCTsource ↗
DPRODUCT: FormulaFunction

DPRODUCT: Multiplies matching numeric database values.

Example
=DPRODUCT(A1:C5,"Sales",E1:F2)
variableDROPsource ↗
DROP: FormulaFunction

DROP removes rows and columns. Example: =DROP(A1:C3,1) removes the first row.

variableDSTDEVsource ↗
DSTDEV: FormulaFunction

DSTDEV: Returns the sample standard deviation of matching records.

Example
=DSTDEV(A1:C5,"Sales",E1:F2)
variableDSTDEVPsource ↗
DSTDEVP: FormulaFunction

DSTDEVP: Returns the population standard deviation of matching records.

Example
=DSTDEVP(A1:C5,"Sales",E1:F2)
variableDSUMsource ↗
DSUM: FormulaFunction

DSUM: Sums matching numeric database values.

Example
=DSUM(A1:C5,"Sales",E1:F2)
variableDURATIONsource ↗
DURATION: FormulaFunction

DURATION: Macaulay duration of a coupon security.

variableDVARsource ↗
DVAR: FormulaFunction

DVAR: Returns the sample variance of matching records.

Example
=DVAR(A1:C5,"Sales",E1:F2)
variableDVARPsource ↗
DVARP: FormulaFunction

DVARP: Returns the population variance of matching records.

Example
=DVARP(A1:C5,"Sales",E1:F2)
variableEDATEsource ↗
EDATE: FormulaFunction

EDATE: Returns the date serial offset by a whole number of months.
Example: =EDATE("2011-1-15",2) returns 40617.

variableEFFECTsource ↗
EFFECT: FormulaFunction

EFFECT: effective annual interest rate.

variableENCODEURLsource ↗
ENCODEURL: FormulaFunction

Encodes text as an RFC 3986 UTF-8 URL component. Example: ENCODEURL("a b") returns "a%20b".

variableEnglishExcelDateTimeLocalesource ↗
EnglishExcelDateTimeLocale: FormulaDateTimeLocale

English Excel-style date/time text parser and formatter.

variableEnglishExcelDateTimeSymbolssource ↗
EnglishExcelDateTimeSymbols: FormulaDateTimeSymbols

English symbols consumed by the shared Excel-compatible date/time parser.

variableEOMONTHsource ↗
EOMONTH: FormulaFunction

EOMONTH: Returns the last day of the month offset from a start date.
Example: =EOMONTH("2011-1-1",1) returns 40602.

variableEPOCHTODATEsource ↗
EPOCHTODATE: FormulaFunction

EPOCHTODATE converts a Unix timestamp to an Excel UTC date-time serial. Example: =EPOCHTODATE(0) returns 25569.

variableEQsource ↗
EQ: FormulaFunction

EQ tests two values for equality. Example: =EQ(2,2) returns TRUE.

variableERROR_TYPEsource ↗
ERROR_TYPE: FormulaFunction

ERROR.TYPE: Returns the numeric code for an error value.

Example
=ERROR.TYPE(NA())
variableEUROCONVERTsource ↗
EUROCONVERT: FormulaFunction

Converts between the euro and legacy euro-member currencies using fixed EU rates.
Example: =EUROCONVERT(1.2,"DEM","EUR") returns 0.61.

variableEVENsource ↗
EVEN: FormulaFunction

EVEN: Rounds a number away from zero to the nearest even integer.

Example
=EVEN(1.5) returns 2.
variableEXACTsource ↗
EXACT: FormulaFunction

Compares two strings with case sensitivity. Example: EXACT("A","a") returns FALSE.

variableEXCEL_1904_SERIAL_OFFSETsource ↗
EXCEL_1904_SERIAL_OFFSET: 1462
variableEXPsource ↗
EXP: FormulaFunction

EXP: Returns e raised to the specified power.

Example
=EXP(0) returns 1.
variableEXPANDsource ↗
EXPAND: FormulaFunction

EXPAND pads an array. Example: =EXPAND(A1:B2,3,3,0).

variableEXPON_DISTsource ↗
EXPON_DIST: FormulaFunction

EXPON.DIST formula.
Evaluates the Excel-compatible EXPON.DIST statistical function.
Example: =EXPON.DIST(1,1,TRUE).

variableEXPONDISTsource ↗
EXPONDIST: FormulaFunction

EXPONDIST compatibility formula: Returns an exponential distribution value.

Example
=EXPONDIST(0.2,10,TRUE)
variableF_DISTsource ↗
F_DIST: FormulaFunction

F.DIST formula.
Evaluates the Excel-compatible F.DIST statistical function.
Example: =F.DIST(1,1,TRUE).

variableF_DIST_RTsource ↗
F_DIST_RT: FormulaFunction

F.DIST.RT formula.
Evaluates the Excel-compatible F.DIST.RT statistical function.
Example: =F.DIST.RT(1,1,TRUE).

variableF_INVsource ↗
F_INV: FormulaFunction

F.INV formula.
Evaluates the Excel-compatible F.INV statistical function.
Example: =F.INV(0.5,1,1).

variableF_INV_RTsource ↗
F_INV_RT: FormulaFunction

F.INV.RT formula.
Evaluates the Excel-compatible F.INV.RT statistical function.
Example: =F.INV.RT(0.5,1,1).

variableF_TESTsource ↗
F_TEST: FormulaFunction

F.TEST formula.
Evaluates the Excel-compatible F.TEST statistical function.
Example: =F.TEST(1,2,3).

variableFACTsource ↗
FACT: FormulaFunction

FACT: Returns the factorial of a nonnegative integer.

Example
=FACT(5) returns 120.
variableFACTDOUBLEsource ↗
FACTDOUBLE: FormulaFunction

FACTDOUBLE: Returns the double factorial of a nonnegative integer.

Example
=FACTDOUBLE(7) returns 105.
variableFALSEsource ↗
FALSE: FormulaFunction

FALSE: Returns the logical value FALSE.

Example
=FALSE()
variableFDISTsource ↗
FDIST: FormulaFunction

FDIST compatibility formula: Returns the right-tailed F distribution probability.

Example
=FDIST(15.2069,6,4)
variableFILTERsource ↗
FILTER: FormulaFunction

FILTER returns rows matching a Boolean include array. Example: =FILTER(A1:B3,{TRUE;FALSE;TRUE}).

variableFILTERXMLsource ↗
FILTERXML: FormulaFunction

Extracts XPath matches from XML as a spilling column. Example: FILTERXML("<r><v>A</v></r>","//v") returns A.

variablefinancialFunctionssource ↗
financialFunctions: readonly FormulaFunction[]

All built-in financial worksheet functions.

variableFINDsource ↗
FIND: FormulaFunction

Finds case-sensitive text and returns a one-based position. Example: FIND("b","abc") returns 2.

variableFINDBsource ↗
FINDB: FormulaFunction

Finds case-sensitive text using locale-defined DBCS byte positions. Example: FINDB("b", "abc") returns 2.

variableFINVsource ↗
FINV: FormulaFunction

FINV compatibility formula: Returns the inverse right-tailed F distribution.

Example
=FINV(0.01,6,4)
variableFISHERsource ↗
FISHER: FormulaFunction

FISHER formula.
Evaluates the Excel-compatible FISHER statistical function.
Example: =FISHER(1,2,3).

variableFISHERINVsource ↗
FISHERINV: FormulaFunction

FISHERINV formula.
Evaluates the Excel-compatible FISHERINV statistical function.
Example: =FISHERINV(0.5,1,1).

variableFIXEDsource ↗
FIXED: FormulaFunction

Formats rounded fixed-decimal text. Example: FIXED(1234.567,1) returns "1,234.6".

variableFLATTENsource ↗
FLATTEN: FormulaFunction

FLATTEN combines one or more arrays into a single column. Example: =FLATTEN(A1:B2,C1:C2).

variableFLOORsource ↗
FLOOR: FormulaFunction

FLOOR compatibility formula: Rounds a number down to a legacy significance multiple.

Example
=FLOOR(2.5,1)
variableFLOOR_MATHsource ↗
FLOOR_MATH: FormulaFunction

FLOOR.MATH: Rounds a number down to the nearest multiple.

Example
=FLOOR.MATH(-8.1,2) returns -10.
variableFLOOR_PRECISEsource ↗
FLOOR_PRECISE: FormulaFunction

FLOOR.PRECISE: Rounds a number down to the nearest multiple using an absolute direction.

Example
=FLOOR.PRECISE(-3.2,1) returns -4.
variableFORECASTsource ↗
FORECAST: FormulaFunction

FORECAST formula.
Evaluates the Excel-compatible FORECAST statistical function.
Example: =FORECAST(1,2,3).

variableFORECAST_ETSsource ↗
FORECAST_ETS: FormulaFunction

FORECAST.ETS formula.
Evaluates the Excel-compatible FORECAST.ETS statistical function.
Example: =FORECAST.ETS(1,2,3).

variableFORECAST_ETS_CONFINTsource ↗
FORECAST_ETS_CONFINT: FormulaFunction

FORECAST.ETS.CONFINT formula.
Evaluates the Excel-compatible FORECAST.ETS.CONFINT statistical function.
Example: =FORECAST.ETS.CONFINT(1,2,3).

variableFORECAST_ETS_SEASONALITYsource ↗
FORECAST_ETS_SEASONALITY: FormulaFunction

FORECAST.ETS.SEASONALITY formula.
Evaluates the Excel-compatible FORECAST.ETS.SEASONALITY statistical function.
Example: =FORECAST.ETS.SEASONALITY(1,2,3).

variableFORECAST_ETS_STATsource ↗
FORECAST_ETS_STAT: FormulaFunction

FORECAST.ETS.STAT formula.
Evaluates the Excel-compatible FORECAST.ETS.STAT statistical function.
Example: =FORECAST.ETS.STAT(1,2,3).

variableFORECAST_LINEARsource ↗
FORECAST_LINEAR: FormulaFunction

FORECAST.LINEAR formula.
Evaluates the Excel-compatible FORECAST.LINEAR statistical function.
Example: =FORECAST.LINEAR(1,2,3).

variableFORMULATEXTsource ↗
FORMULATEXT: FormulaFunction

FORMULATEXT returns source text for a formula cell. Example: =FORMULATEXT(A1).

variableFREQUENCYsource ↗
FREQUENCY: FormulaFunction

FREQUENCY formula.
Evaluates the Excel-compatible FREQUENCY statistical function.
Example: =FREQUENCY(1,2,3).

variableFTESTsource ↗
FTEST: FormulaFunction

FTEST compatibility formula: Returns the two-tailed F-test probability.

Example
=FTEST({1,2,3},{1,2,4})
variableFVsource ↗
FV: FormulaFunction

FV: future value of an annuity.

variableFVSCHEDULEsource ↗
FVSCHEDULE: FormulaFunction

FVSCHEDULE: future value using a series of variable rates.

variableGAMMAsource ↗
GAMMA: FormulaFunction

GAMMA formula.
Evaluates the Excel-compatible GAMMA statistical function.
Example: =GAMMA(1,2,3).

variableGAMMA_DISTsource ↗
GAMMA_DIST: FormulaFunction

GAMMA.DIST formula.
Evaluates the Excel-compatible GAMMA.DIST statistical function.
Example: =GAMMA.DIST(1,1,TRUE).

variableGAMMA_INVsource ↗
GAMMA_INV: FormulaFunction

GAMMA.INV formula.
Evaluates the Excel-compatible GAMMA.INV statistical function.
Example: =GAMMA.INV(0.5,1,1).

variableGAMMADISTsource ↗
GAMMADIST: FormulaFunction

GAMMADIST compatibility formula: Returns a gamma distribution value.

Example
=GAMMADIST(10,9,2,TRUE)
variableGAMMAINVsource ↗
GAMMAINV: FormulaFunction

GAMMAINV compatibility formula: Returns an inverse gamma distribution value.

Example
=GAMMAINV(0.068094,9,2)
variableGAMMALNsource ↗
GAMMALN: FormulaFunction

GAMMALN formula.
Evaluates the Excel-compatible GAMMALN statistical function.
Example: =GAMMALN(1,2,3).

variableGAMMALN_PRECISEsource ↗
GAMMALN_PRECISE: FormulaFunction

GAMMALN.PRECISE formula.
Evaluates the Excel-compatible GAMMALN.PRECISE statistical function.
Example: =GAMMALN.PRECISE(1,2,3).

variableGAUSSsource ↗
GAUSS: FormulaFunction

GAUSS formula.
Evaluates the Excel-compatible GAUSS statistical function.
Example: =GAUSS(1,2,3).

variableGCDsource ↗
GCD: FormulaFunction

GCD: Returns the greatest common divisor of numeric values.

Example
=GCD(24,36) returns 12.
variableGEOMEANsource ↗
GEOMEAN: FormulaFunction

GEOMEAN formula.
Evaluates the Excel-compatible GEOMEAN statistical function.
Example: =GEOMEAN(1,2,3).

variableGETPIVOTDATAsource ↗
GETPIVOTDATA: FormulaFunction

GETPIVOTDATA reads a host pivot data service. Example: =GETPIVOTDATA("Sales",A1).

variableGOOGLEFINANCEsource ↗
GOOGLEFINANCE: FormulaFunction

GOOGLEFINANCE reads market data from a host-managed cache. Example: =GOOGLEFINANCE("NASDAQ:GOOG","price") returns cached price data.

variablegoogleFunctionssource ↗
googleFunctions: readonly FormulaFunction[]
variableGOOGLETRANSLATEsource ↗
GOOGLETRANSLATE: FormulaFunction

GOOGLETRANSLATE reads a translation from a host-managed cache. Example: =GOOGLETRANSLATE("hello","en","zh-CN") returns cached text.

variableGROUPBYsource ↗
GROUPBY: FormulaFunction

GROUPBY groups rows by a key and aggregates values by sum. Example: =GROUPBY(A2:A5,B2:B5,SUM).

variableGROWTHsource ↗
GROWTH: FormulaFunction

GROWTH formula.
Evaluates the Excel-compatible GROWTH statistical function.
Example: =GROWTH(1,2,3).

variableGTsource ↗
GT: FormulaFunction

GT tests whether the first value is greater. Example: =GT(3,2) returns TRUE.

variableGTEsource ↗
GTE: FormulaFunction

GTE tests whether the first value is at least the second. Example: =GTE(2,2) returns TRUE.

variableHARMEANsource ↗
HARMEAN: FormulaFunction

HARMEAN formula.
Evaluates the Excel-compatible HARMEAN statistical function.
Example: =HARMEAN(1,2,3).

variableHLOOKUPsource ↗
HLOOKUP: FormulaFunction

HLOOKUP searches a table's first row. Example: =HLOOKUP("B",A1:C2,2,FALSE).

variableHOURsource ↗
HOUR: FormulaFunction

HOUR: Returns the hour component from a time or date-time value.
Example: =HOUR("2011-7-18 7:45") returns 7.

variableHSTACKsource ↗
HSTACK: FormulaFunction

HSTACK joins arrays horizontally. Example: =HSTACK({1;2},{3;4}).

variableHYPGEOM_DISTsource ↗
HYPGEOM_DIST: FormulaFunction

HYPGEOM.DIST formula.
Evaluates the Excel-compatible HYPGEOM.DIST statistical function.
Example: =HYPGEOM.DIST(1,1,TRUE).

variableHYPGEOMDISTsource ↗
HYPGEOMDIST: FormulaFunction

HYPGEOMDIST compatibility formula: Returns the non-cumulative hypergeometric probability.

Example
=HYPGEOMDIST(1,4,8,20)
variableIFsource ↗
IF: FormulaFunction

Returns one value when a condition is true and another when it is false.

variableIFERRORsource ↗
IFERROR: FormulaFunction

IFERROR: Replaces a formula error with a fallback value.

Example
=IFERROR(1/0,0) returns 0.
variableIFNAsource ↗
IFNA: FormulaFunction

IFNA: Returns a fallback only when the input is #N/A.

Example
=IFNA(NA(),0)
variableIFSsource ↗
IFS: FormulaFunction

IFS: Returns the value paired with the first TRUE condition.

Example
=IFS(A1>90,"A",A1>80,"B",TRUE,"C")
variableIMAGEsource ↗
IMAGE: FormulaFunction

IMAGE reads a host-managed image cache. Example: =IMAGE("https://example.com/logo.png").

variableIMPORTDATAsource ↗
IMPORTDATA: FormulaFunction

IMPORTDATA reads CSV or TSV data from a host-managed cache. Example: =IMPORTDATA("https://example.com/data.csv") returns cached rows.

variableIMPORTFEEDsource ↗
IMPORTFEED: FormulaFunction

IMPORTFEED reads RSS or Atom data from a host-managed cache. Example: =IMPORTFEED("https://example.com/feed.xml") returns cached feed rows.

variableIMPORTHTMLsource ↗
IMPORTHTML: FormulaFunction

IMPORTHTML reads an HTML table or list from a host-managed cache. Example: =IMPORTHTML("https://example.com","table",1) returns cached rows.

variableIMPORTRANGEsource ↗
IMPORTRANGE: FormulaFunction

IMPORTRANGE reads another spreadsheet through a host-managed cache. Example: =IMPORTRANGE("sheet-id","A1:B2") returns cached cells.

variableIMPORTXMLsource ↗
IMPORTXML: FormulaFunction

IMPORTXML reads XPath-selected data from a host-managed cache. Example: =IMPORTXML("https://example.com","//title") returns cached nodes.

variableINDEXsource ↗
INDEX: FormulaFunction

INDEX returns a value or subarray by row and column. Example: =INDEX(A1:C3,2,3).

variableINDIRECTsource ↗
INDIRECT: FormulaFunction

INDIRECT resolves text to a reference. Example: =INDIRECT("A1") returns A1.

variableINFOsource ↗
INFO: FormulaFunction

INFO: Returns host or workbook environment information.

Example
=INFO("numfile")
variableinformationFunctionssource ↗
informationFunctions: readonly FormulaFunction[]
variableINTsource ↗
INT: FormulaFunction

INT: Rounds a number down to the nearest integer.

Example
=INT(-0.1) returns -1.
variableINTERCEPTsource ↗
INTERCEPT: FormulaFunction

INTERCEPT formula.
Evaluates the Excel-compatible INTERCEPT statistical function.
Example: =INTERCEPT(1,2,3).

variableINTRATEsource ↗
INTRATE: FormulaFunction

INTRATE: annualized interest rate of a fully invested security.

variableIPMTsource ↗
IPMT: FormulaFunction

IPMT: interest payment for a period.

variableIRRsource ↗
IRR: FormulaFunction

IRR: periodic internal rate of return.

variableISBETWEENsource ↗
ISBETWEEN: FormulaFunction

ISBETWEEN tests whether a value lies between bounds. Example: =ISBETWEEN(5,1,10) returns TRUE.

variableISBLANKsource ↗
ISBLANK: FormulaFunction

ISBLANK: Returns TRUE only for a genuinely empty referenced cell.

Example
=ISBLANK(A1)
variableISDATEsource ↗
ISDATE: FormulaFunction

ISDATE reports whether a value is a valid date or date serial. Example: =ISDATE("2024-02-29") returns TRUE.

variableISEMAILsource ↗
ISEMAIL: FormulaFunction

ISEMAIL checks common email-address syntax without contacting a server. Example: =ISEMAIL("a@example.com") returns TRUE.

variableISERRsource ↗
ISERR: FormulaFunction

ISERR: Returns TRUE for errors other than #N/A.

Example
=ISERR(1/0)
variableISERRORsource ↗
ISERROR: FormulaFunction

ISERROR: Returns TRUE for any formula error.

Example
=ISERROR(1/0)
variableISEVENsource ↗
ISEVEN: FormulaFunction

ISEVEN: Returns TRUE when a number is even.

Example
=ISEVEN(4)
variableISFORMULAsource ↗
ISFORMULA: FormulaFunction

ISFORMULA: Returns TRUE when a referenced cell contains a formula.

Example
=ISFORMULA(A1)
variableISLOGICALsource ↗
ISLOGICAL: FormulaFunction

ISLOGICAL: Returns TRUE for logical values.

Example
=ISLOGICAL(TRUE)
variableISNAsource ↗
ISNA: FormulaFunction

ISNA: Returns TRUE only for #N/A.

Example
=ISNA(NA())
variableISNONTEXTsource ↗
ISNONTEXT: FormulaFunction

ISNONTEXT: Returns TRUE for non-text values.

Example
=ISNONTEXT(42)
variableISNUMBERsource ↗
ISNUMBER: FormulaFunction

ISNUMBER: Returns TRUE for numeric values.

Example
=ISNUMBER(42)
variableISO_CEILINGsource ↗
ISO_CEILING: FormulaFunction

ISO.CEILING: Rounds a number up to the nearest multiple.

Example
=ISO.CEILING(-4.3,2) returns -4.
variableISODDsource ↗
ISODD: FormulaFunction

ISODD: Returns TRUE when a number is odd.

Example
=ISODD(3)
variableISOWEEKNUMsource ↗
ISOWEEKNUM: FormulaFunction

ISOWEEKNUM: Returns the ISO 8601 week number for a date.
Example: =ISOWEEKNUM("2012-3-9") returns 10.

variableISPMTsource ↗
ISPMT: FormulaFunction

ISPMT: interest paid during a specific period of an investment.

variableISREFsource ↗
ISREF: FormulaFunction

ISREF: Returns TRUE when its argument preserves reference identity.

Example
=ISREF(A1)
variableISTEXTsource ↗
ISTEXT: FormulaFunction

ISTEXT: Returns TRUE for text values.

Example
=ISTEXT("text")
variableISURLsource ↗
ISURL: FormulaFunction

ISURL checks whether text is an absolute URL. Example: =ISURL("https://example.com") returns TRUE.

variableJISsource ↗
JIS: FormulaFunction

Converts half-width text to Japanese full-width text. Example: JIS("ABC カ") returns "ABC カ".

variableJOINsource ↗
JOIN: FormulaFunction

JOIN concatenates values with a delimiter. Example: =JOIN("-",{1,2,3}) returns "1-2-3".

variableKURTsource ↗
KURT: FormulaFunction

KURT formula.
Evaluates the Excel-compatible KURT statistical function.
Example: =KURT(1,2,3).

variableLARGEsource ↗
LARGE: FormulaFunction

LARGE formula.
Evaluates the Excel-compatible LARGE statistical function.
Example: =LARGE(1,2,3).

variableLAST_EXCEL_DATE_SERIALsource ↗
LAST_EXCEL_DATE_SERIAL: 2958465
variableLCMsource ↗
LCM: FormulaFunction

LCM: Returns the least common multiple of numeric values.

Example
=LCM(4,6) returns 12.
variableLEFTsource ↗
LEFT: FormulaFunction

Returns characters from the start of text. Example: LEFT("Sale",2) returns "Sa".

variableLEFTBsource ↗
LEFTB: FormulaFunction

Returns leading text limited by a locale-defined DBCS byte count. Example: LEFTB("abc", 2) returns "ab".

variableLENsource ↗
LEN: FormulaFunction

Returns the UTF-16 character count used by Excel compatibility mode. Example: LEN("Excel") returns 5.

variableLENBsource ↗
LENB: FormulaFunction

Returns text length measured in locale-defined DBCS bytes. Example: LENB("abc") returns 3.

variableLETsource ↗
LET: FormulaFunction

LET: Evaluates sequential name/value bindings in a child lexical scope.

Example
=LET(rate,2,amount,5,rate*amount) returns 10.
variableLINESTsource ↗
LINEST: FormulaFunction

LINEST formula.
Evaluates the Excel-compatible LINEST statistical function.
Example: =LINEST(1,2,3).

variableLNsource ↗
LN: FormulaFunction

LN: Returns the natural logarithm of a positive number.

Example
=LN(1) returns 0.
variableLOGsource ↗
LOG: FormulaFunction

LOG: Returns the logarithm of a number for a specified base.

Example
=LOG(8,2) returns 3.
variableLOG10source ↗
LOG10: FormulaFunction

LOG10: Returns the base-10 logarithm of a positive number.

Example
=LOG10(100) returns 2.
variableLOGESTsource ↗
LOGEST: FormulaFunction

LOGEST formula.
Evaluates the Excel-compatible LOGEST statistical function.
Example: =LOGEST(1,2,3).

variablelogicalFunctionssource ↗
logicalFunctions: readonly FormulaFunction[]
variableLOGINVsource ↗
LOGINV: FormulaFunction

LOGINV compatibility formula: Returns the inverse lognormal distribution.

Example
=LOGINV(0.039084,3.5,1.2)
variableLOGNORM_DISTsource ↗
LOGNORM_DIST: FormulaFunction

LOGNORM.DIST formula.
Evaluates the Excel-compatible LOGNORM.DIST statistical function.
Example: =LOGNORM.DIST(1,1,TRUE).

variableLOGNORM_INVsource ↗
LOGNORM_INV: FormulaFunction

LOGNORM.INV formula.
Evaluates the Excel-compatible LOGNORM.INV statistical function.
Example: =LOGNORM.INV(0.5,1,1).

variableLOGNORMDISTsource ↗
LOGNORMDIST: FormulaFunction

LOGNORMDIST compatibility formula: Returns the cumulative lognormal distribution.

Example
=LOGNORMDIST(4,3.5,1.2)
variableLOOKUPsource ↗
LOOKUP: FormulaFunction

LOOKUP performs approximate vector lookup. Example: =LOOKUP(2,{1,2,3},{"A","B","C"}) returns B.

variablelookupFunctionNamessource ↗
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.

variableLOWERsource ↗
LOWER: FormulaFunction

Converts letters to lowercase. Example: LOWER("Excel") returns "excel".

variableLTsource ↗
LT: FormulaFunction

LT tests whether the first value is smaller. Example: =LT(2,3) returns TRUE.

variableLTEsource ↗
LTE: FormulaFunction

LTE tests whether the first value is no greater than the second. Example: =LTE(2,2) returns TRUE.

variableMARGINOFERRORsource ↗
MARGINOFERROR: FormulaFunction

MARGINOFERROR formula. Estimates the normal confidence margin for a sample. Example: =MARGINOFERROR(0.95,A1:A10).

variableMATCHsource ↗
MATCH: FormulaFunction

MATCH returns the position of a lookup value. Example: =MATCH("B",{"A";"B"},0) returns 2.

variableMAXsource ↗
MAX: FormulaFunction

MAX formula.
Evaluates the Excel-compatible MAX statistical function.
Example: =MAX(1,2,3).

variableMAXAsource ↗
MAXA: FormulaFunction

MAXA formula.
Evaluates the Excel-compatible MAXA statistical function.
Example: =MAXA(1,2,3).

variableMAXIFSsource ↗
MAXIFS: FormulaFunction

MAXIFS formula.
Evaluates the Excel-compatible MAXIFS statistical function.
Example: =MAXIFS(1,2,3).

variableMDETERMsource ↗
MDETERM: FormulaFunction

MDETERM: Returns the determinant of a square matrix.

Example
=MDETERM({1,2;3,4}) returns -2.
variableMDURATIONsource ↗
MDURATION: FormulaFunction

MDURATION: modified duration of a coupon security.

variableMEDIANsource ↗
MEDIAN: FormulaFunction

MEDIAN formula.
Evaluates the Excel-compatible MEDIAN statistical function.
Example: =MEDIAN(1,2,3).

variableMIDsource ↗
MID: FormulaFunction

Returns a substring by one-based start and length. Example: MID("Fluid Flow",7,4) returns "Flow".

variableMIDBsource ↗
MIDB: FormulaFunction

Returns text from a locale-defined DBCS byte position. Example: MIDB("abc", 2, 1) returns "b".

variableMINsource ↗
MIN: FormulaFunction

MIN formula.
Evaluates the Excel-compatible MIN statistical function.
Example: =MIN(1,2,3).

variableMINAsource ↗
MINA: FormulaFunction

MINA formula.
Evaluates the Excel-compatible MINA statistical function.
Example: =MINA(1,2,3).

variableMINIFSsource ↗
MINIFS: FormulaFunction

MINIFS formula.
Evaluates the Excel-compatible MINIFS statistical function.
Example: =MINIFS(1,2,3).

variableMINUSsource ↗
MINUS: FormulaFunction

MINUS subtracts the second value from the first. Example: =MINUS(5,2) returns 3.

variableMINUTEsource ↗
MINUTE: FormulaFunction

MINUTE: Returns the minute component from a time or date-time value.
Example: =MINUTE("12:45 PM") returns 45.

variableMINVERSEsource ↗
MINVERSE: FormulaFunction

MINVERSE: Returns the inverse matrix for a square, nonsingular matrix.

Example
=MINVERSE({1,2;3,4}) returns {-2,1;1.5,-0.5}.
variableMIRRsource ↗
MIRR: FormulaFunction

MIRR: modified internal rate of return.

variableMMULTsource ↗
MMULT: FormulaFunction

MMULT: Returns the matrix product of two compatible arrays.

Example
=MMULT({1,2},{3;4}) returns 11.
variableMODsource ↗
MOD: FormulaFunction

MOD: Returns the remainder after division.

Example
=MOD(-3,2) returns 1.
variableMODEsource ↗
MODE: FormulaFunction

MODE compatibility formula: Returns the most frequent numeric value.

Example
=MODE(1,1,2,3)
variableMODE_MULTsource ↗
MODE_MULT: FormulaFunction

MODE.MULT formula.
Evaluates the Excel-compatible MODE.MULT statistical function.
Example: =MODE.MULT(1,2,3).

variableMODE_SNGLsource ↗
MODE_SNGL: FormulaFunction

MODE.SNGL formula.
Evaluates the Excel-compatible MODE.SNGL statistical function.
Example: =MODE.SNGL(1,2,3).

variableMONTHsource ↗
MONTH: FormulaFunction

MONTH: Returns the month number for a date serial.
Example: =MONTH("2011-4-15") returns 4.

variableMROUNDsource ↗
MROUND: FormulaFunction

MROUND: Rounds a number to the nearest specified multiple.

Example
=MROUND(10,3) returns 9.
variableMULTINOMIALsource ↗
MULTINOMIAL: FormulaFunction

MULTINOMIAL: Returns the multinomial coefficient for a set of numbers.

Example
=MULTINOMIAL(1,1,1) returns 6.
variableMULTIPLYsource ↗
MULTIPLY: FormulaFunction

MULTIPLY multiplies two values. Example: =MULTIPLY(3,4) returns 12.

variableMUNITsource ↗
MUNIT: FormulaFunction

MUNIT: Returns an identity matrix of the requested size.

Example
=MUNIT(2) returns {1,0;0,1}.
variableNsource ↗
N: FormulaFunction

N: Converts numbers, booleans, and other values to a numeric projection.

Example
=N(TRUE)
variableNAsource ↗
NA: FormulaFunction

NA: Returns the #N/A error value.

Example
=NA()
variableNEsource ↗
NE: FormulaFunction

NE tests two values for inequality. Example: =NE(2,3) returns TRUE.

variableNEGBINOM_DISTsource ↗
NEGBINOM_DIST: FormulaFunction

NEGBINOM.DIST formula.
Evaluates the Excel-compatible NEGBINOM.DIST statistical function.
Example: =NEGBINOM.DIST(1,1,TRUE).

variableNEGBINOMDISTsource ↗
NEGBINOMDIST: FormulaFunction

NEGBINOMDIST compatibility formula: Returns the non-cumulative negative-binomial probability.

Example
=NEGBINOMDIST(10,5,0.25)
variableNETWORKDAYSsource ↗
NETWORKDAYS: FormulaFunction

NETWORKDAYS: 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_INTLsource ↗
NETWORKDAYS_INTL: FormulaFunction

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.

variableNOMINALsource ↗
NOMINAL: FormulaFunction

NOMINAL: nominal annual interest rate.

variableNORM_DISTsource ↗
NORM_DIST: FormulaFunction

NORM.DIST formula.
Evaluates the Excel-compatible NORM.DIST statistical function.
Example: =NORM.DIST(1,1,TRUE).

variableNORM_INVsource ↗
NORM_INV: FormulaFunction

NORM.INV compatibility formula: Returns an inverse normal distribution value under the NORM.INV name.

Example
=NORM.INV(0.908789,40,1.5)
variableNORM_S_DISTsource ↗
NORM_S_DIST: FormulaFunction

NORM.S.DIST formula.
Evaluates the Excel-compatible NORM.S.DIST statistical function.
Example: =NORM.S.DIST(1,1,TRUE).

variableNORM_S_INVsource ↗
NORM_S_INV: FormulaFunction

NORM.S.INV formula.
Evaluates the Excel-compatible NORM.S.INV statistical function.
Example: =NORM.S.INV(0.5,1,1).

variableNORMDISTsource ↗
NORMDIST: FormulaFunction

NORMDIST compatibility formula: Returns a normal distribution value.

Example
=NORMDIST(42,40,1.5,TRUE)
variableNORMINVsource ↗
NORMINV: FormulaFunction

NORMINV formula.
Evaluates the Excel-compatible NORMINV statistical function.
Example: =NORMINV(0.5,1,1).

variableNORMSDISTsource ↗
NORMSDIST: FormulaFunction

NORMSDIST compatibility formula: Returns the cumulative standard normal distribution.

Example
=NORMSDIST(1.333333)
variableNORMSINVsource ↗
NORMSINV: FormulaFunction

NORMSINV compatibility formula: Returns the inverse standard normal distribution.

Example
=NORMSINV(0.908789)
variableNOTsource ↗
NOT: FormulaFunction

NOT: Returns the inverse of a logical value.

Example
=NOT(TRUE)
variableNOWsource ↗
NOW: FormulaFunction

NOW: 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.

variableNPERsource ↗
NPER: FormulaFunction

NPER: number of periods for an annuity.

variableNPVsource ↗
NPV: FormulaFunction

NPV: net present value of periodic cash flows.

variableNUMBERSTRINGsource ↗
NUMBERSTRING: FormulaFunction

Converts a nonnegative number to one of the supported Chinese numeral styles.

variableNUMBERVALUEsource ↗
NUMBERVALUE: FormulaFunction

Parses numeric text with explicit separators. Example: NUMBERVALUE("2.500,27",",",".") returns 2500.27.

variableODDsource ↗
ODD: FormulaFunction

ODD: Rounds a number away from zero to the nearest odd integer.

Example
=ODD(0) returns 1.
variableODDFPRICEsource ↗
ODDFPRICE: FormulaFunction

ODDFPRICE: clean price for a security with an odd first coupon period.

variableODDFYIELDsource ↗
ODDFYIELD: FormulaFunction

ODDFYIELD: yield for a security with an odd first coupon period.

variableODDLPRICEsource ↗
ODDLPRICE: FormulaFunction

ODDLPRICE: clean price for a security with an odd last coupon period.

variableODDLYIELDsource ↗
ODDLYIELD: FormulaFunction

ODDLYIELD: yield for a security with an odd last coupon period.

variableOFFSETsource ↗
OFFSET: FormulaFunction

OFFSET returns a shifted reference. Example: =OFFSET(A1,1,1) returns B2.

variableORsource ↗
OR: FormulaFunction

OR: Returns TRUE when any supplied logical value is TRUE.

Example
=OR(FALSE,TRUE)
variablePDURATIONsource ↗
PDURATION: FormulaFunction

PDURATION: periods required for an investment to reach a target value.

variablePEARSONsource ↗
PEARSON: FormulaFunction

PEARSON formula.
Evaluates the Excel-compatible PEARSON statistical function.
Example: =PEARSON(1,2,3).

variablePERCENTILEsource ↗
PERCENTILE: FormulaFunction

PERCENTILE compatibility formula: Returns an inclusive percentile.

Example
=PERCENTILE({1,2,3,4},0.5)
variablePERCENTILE_EXCsource ↗
PERCENTILE_EXC: FormulaFunction

PERCENTILE.EXC formula.
Evaluates the Excel-compatible PERCENTILE.EXC statistical function.
Example: =PERCENTILE.EXC(1,2,3).

variablePERCENTILE_INCsource ↗
PERCENTILE_INC: FormulaFunction

PERCENTILE.INC formula.
Evaluates the Excel-compatible PERCENTILE.INC statistical function.
Example: =PERCENTILE.INC(1,2,3).

variablePERCENTOFsource ↗
PERCENTOF: FormulaFunction

PERCENTOF: Returns the proportion represented by one value or array within another.

Example
=PERCENTOF({25},{100}) returns 0.25.
variablePERCENTRANKsource ↗
PERCENTRANK: FormulaFunction

PERCENTRANK compatibility formula: Returns an inclusive percentage rank.

Example
=PERCENTRANK({1,2,3,4},3)
variablePERCENTRANK_EXCsource ↗
PERCENTRANK_EXC: FormulaFunction

PERCENTRANK.EXC formula.
Evaluates the Excel-compatible PERCENTRANK.EXC statistical function.
Example: =PERCENTRANK.EXC(1,2,3).

variablePERCENTRANK_INCsource ↗
PERCENTRANK_INC: FormulaFunction

PERCENTRANK.INC formula.
Evaluates the Excel-compatible PERCENTRANK.INC statistical function.
Example: =PERCENTRANK.INC(1,2,3).

variablePERMUTsource ↗
PERMUT: FormulaFunction

PERMUT formula.
Evaluates the Excel-compatible PERMUT statistical function.
Example: =PERMUT(1,2,3).

variablePERMUTATIONAsource ↗
PERMUTATIONA: FormulaFunction

PERMUTATIONA formula.
Evaluates the Excel-compatible PERMUTATIONA statistical function.
Example: =PERMUTATIONA(1,2,3).

variablePHIsource ↗
PHI: FormulaFunction

PHI formula.
Evaluates the Excel-compatible PHI statistical function.
Example: =PHI(1,2,3).

variablePHONETICsource ↗
PHONETIC: FormulaFunction

Returns stored phonetic metadata for a cell. Example: PHONETIC(A1) returns its furigana when available.

variablePIsource ↗
PI: FormulaFunction

PI: Returns the mathematical constant pi.

Example
=PI()*0 returns 0.
variablePIVOTBYsource ↗
PIVOTBY: FormulaFunction

PIVOTBY creates a two-key summary by sum. Example: =PIVOTBY(A2:A5,B2:B5,C2:C5).

variablePMTsource ↗
PMT: FormulaFunction

PMT: periodic payment for an annuity.

variablePOISSONsource ↗
POISSON: FormulaFunction

POISSON compatibility formula: Returns a Poisson distribution value.

Example
=POISSON(2,5,TRUE)
variablePOISSON_DISTsource ↗
POISSON_DIST: FormulaFunction

POISSON.DIST formula.
Evaluates the Excel-compatible POISSON.DIST statistical function.
Example: =POISSON.DIST(1,1,TRUE).

variablePOWsource ↗
POW: FormulaFunction

POW raises a base to an exponent. Example: =POW(2,3) returns 8.

variablePOWERsource ↗
POWER: FormulaFunction

POWER: Raises a number to a specified power.

Example
=POWER(2,0) returns 1.
variablePPMTsource ↗
PPMT: FormulaFunction

PPMT: principal payment for a period.

variablePRICEsource ↗
PRICE: FormulaFunction

PRICE: clean price of a coupon security.

variablePRICEDISCsource ↗
PRICEDISC: FormulaFunction

PRICEDISC: price of a discounted security.

variablePRICEMATsource ↗
PRICEMAT: FormulaFunction

PRICEMAT: price of a security paying interest at maturity.

variablePROBsource ↗
PROB: FormulaFunction

PROB formula.
Evaluates the Excel-compatible PROB statistical function.
Example: =PROB(1,2,3).

variablePRODUCTsource ↗
PRODUCT: FormulaFunction

PRODUCT: Multiplies all numeric values in the supplied arguments.

Example
=PRODUCT(1,2,3) returns 6.
variablePROPERsource ↗
PROPER: FormulaFunction

Capitalizes each word and lowercases remaining letters. Example: PROPER("this is A TITLE") returns "This Is A Title".

variablePVsource ↗
PV: FormulaFunction

PV: present value of an annuity.

variableQUARTILEsource ↗
QUARTILE: FormulaFunction

QUARTILE compatibility formula: Returns an inclusive quartile.

Example
=QUARTILE({1,2,3,4,5},1)
variableQUARTILE_EXCsource ↗
QUARTILE_EXC: FormulaFunction

QUARTILE.EXC formula.
Evaluates the Excel-compatible QUARTILE.EXC statistical function.
Example: =QUARTILE.EXC(1,2,3).

variableQUARTILE_INCsource ↗
QUARTILE_INC: FormulaFunction

QUARTILE.INC formula.
Evaluates the Excel-compatible QUARTILE.INC statistical function.
Example: =QUARTILE.INC(1,2,3).

variableQUERYsource ↗
QUERY: FormulaFunction

QUERY runs a Google Visualization-style query over tabular data. Example: =QUERY({"A",1;"B",2},"select Col1 where Col2 > 1",0) returns "B".

variableQUOTIENTsource ↗
QUOTIENT: FormulaFunction

QUOTIENT: Returns the integer portion of a division.

Example
=QUOTIENT(-10,3) returns -3.
variableRADIANSsource ↗
RADIANS: FormulaFunction

RADIANS: Converts an angle from degrees to radians.

Example
=RADIANS(180) returns pi.
variableRANDsource ↗
RAND: FormulaFunction

RAND: 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).
variableRANDARRAYsource ↗
RANDARRAY: FormulaFunction

RANDARRAY: Generates an array of random numbers with the requested shape and bounds.

Example
=RANDARRAY(1,4,5,5,TRUE) returns {5,5,5,5}.
variableRANDBETWEENsource ↗
RANDBETWEEN: FormulaFunction

RANDBETWEEN: Returns a random integer between two inclusive bounds.

Example
=RANDBETWEEN(7,7) returns 7.
variableRANKsource ↗
RANK: FormulaFunction

RANK compatibility formula: Returns the rank of a number in a list.

Example
=RANK(3,{1,2,3,4},0)
variableRANK_AVGsource ↗
RANK_AVG: FormulaFunction

RANK.AVG formula.
Evaluates the Excel-compatible RANK.AVG statistical function.
Example: =RANK.AVG(1,2,3).

variableRANK_EQsource ↗
RANK_EQ: FormulaFunction

RANK.EQ formula.
Evaluates the Excel-compatible RANK.EQ statistical function.
Example: =RANK.EQ(1,2,3).

variableRATEsource ↗
RATE: FormulaFunction

RATE: periodic interest rate for an annuity.

variableRECEIVEDsource ↗
RECEIVED: FormulaFunction

RECEIVED: amount received at maturity for a discounted security.

variableREGEXEXTRACTsource ↗
REGEXEXTRACT: FormulaFunction

Extracts regex matches or capture groups. Example: REGEXEXTRACT("A12","[0-9]+") returns "12".

variableREGEXMATCHsource ↗
REGEXMATCH: FormulaFunction

REGEXMATCH tests whether text matches a regular expression. Example: =REGEXMATCH("A12","[0-9]+") returns TRUE.

variableREGEXREPLACEsource ↗
REGEXREPLACE: FormulaFunction

Replaces all or one regex match. Example: REGEXREPLACE("A12","[0-9]+","#") returns "A#".

variableREGEXTESTsource ↗
REGEXTEST: FormulaFunction

Tests whether text matches a regular expression. Example: REGEXTEST("A12","[0-9]+") returns TRUE.

variableREGISTER_IDsource ↗
REGISTER_ID: FormulaFunction

Resolves a host-authorized add-in procedure to a stable numeric registration id.
Example: =REGISTER.ID("example","entry","JJ") returns the host's handle for entry.

variableREPLACEsource ↗
REPLACE: FormulaFunction

Replaces characters at a one-based position. Example: REPLACE("abc",2,1,"X") returns "aXc".

variableREPLACEBsource ↗
REPLACEB: FormulaFunction

Replaces text at a locale-defined DBCS byte position. Example: REPLACEB("abc", 2, 1, "x") returns "axc".

variableREPTsource ↗
REPT: FormulaFunction

Repeats text a specified number of times. Example: REPT("*-",3) returns "*-*-*-".

variableRIGHTsource ↗
RIGHT: FormulaFunction

Returns characters from the end of text. Example: RIGHT("Sale",2) returns "le".

variableRIGHTBsource ↗
RIGHTB: FormulaFunction

Returns trailing text limited by a locale-defined DBCS byte count. Example: RIGHTB("abc", 2) returns "bc".

variableROMANsource ↗
ROMAN: FormulaFunction

ROMAN: Converts an Arabic number to Roman numeral text.

Example
=ROMAN(2024) returns "MMXXIV".
variableROUNDsource ↗
ROUND: FormulaFunction

ROUND: Rounds a number to a specified number of digits.

Example
=ROUND(-1.475,2) returns -1.48.
variableROUNDDOWNsource ↗
ROUNDDOWN: FormulaFunction

ROUNDDOWN: Rounds a number toward zero to a specified number of digits.

Example
=ROUNDDOWN(-3.9,0) returns -3.
variableROUNDUPsource ↗
ROUNDUP: FormulaFunction

ROUNDUP: Rounds a number away from zero to a specified number of digits.

Example
=ROUNDUP(-3.1,0) returns -4.
variableROWsource ↗
ROW: FormulaFunction

ROW returns a reference's first row number. Example: =ROW(C5) returns 5.

variableROWSsource ↗
ROWS: FormulaFunction

ROWS returns the number of rows in a reference. Example: =ROWS(A1:C2) returns 2.

variableRRIsource ↗
RRI: FormulaFunction

RRI: equivalent growth rate for an investment.

variableRSQsource ↗
RSQ: FormulaFunction

RSQ formula.
Evaluates the Excel-compatible RSQ statistical function.
Example: =RSQ(1,2,3).

variableRTDsource ↗
RTD: FormulaFunction

RTD reads a host-managed real-time data cache. Example: =RTD("provider",,"price","MSFT").

variableSEARCHBsource ↗
SEARCHB: FormulaFunction

Finds case-insensitive text using locale-defined DBCS byte positions. Example: SEARCHB("B", "abc") returns 2.

variableSECsource ↗
SEC: FormulaFunction

SEC: Returns the secant of an angle in radians.

Example
=SEC(0) returns 1.
variableSECHsource ↗
SECH: FormulaFunction

SECH: Returns the hyperbolic secant of a number.

Example
=SECH(0) returns 1.
variableSECONDsource ↗
SECOND: FormulaFunction

SECOND: Returns the second component from a time or date-time value.
Example: =SECOND("4:48:18 PM") returns 18.

variableSEQUENCEsource ↗
SEQUENCE: FormulaFunction

SEQUENCE: Generates a sequential array from a starting value and step.

Example
=SEQUENCE(2,3,0,2) returns {0,2,4;6,8,10}.
variableSERIESSUMsource ↗
SERIESSUM: FormulaFunction

SERIESSUM: Evaluates a power series from an initial value, step, and coefficients.

Example
=SERIESSUM(2,0,1,{1,2,3}) returns 17.
variableSHEETsource ↗
SHEET: FormulaFunction

SHEET: Returns the one-based index of a sheet.

Example
=SHEET()
variableSHEETSsource ↗
SHEETS: FormulaFunction

SHEETS: Returns the number of sheets in the workbook.

Example
=SHEETS()
variableSIGNsource ↗
SIGN: FormulaFunction

SIGN: Returns -1, 0, or 1 according to the sign of a number.

Example
=SIGN(0) returns 0.
variableSINsource ↗
SIN: FormulaFunction

SIN: Returns the sine of an angle in radians.

Example
=SIN(0) returns 0.
variableSingleByteFormulaTextLocalesource ↗
SingleByteFormulaTextLocale: FormulaTextLocale

Excel-compatible text locale where every Unicode code point counts as one byte.

variableSINHsource ↗
SINH: FormulaFunction

SINH: Returns the hyperbolic sine of a number.

Example
=SINH(0) returns 0.
variableSKEWsource ↗
SKEW: FormulaFunction

SKEW formula.
Evaluates the Excel-compatible SKEW statistical function.
Example: =SKEW(1,2,3).

variableSKEW_Psource ↗
SKEW_P: FormulaFunction

SKEW.P formula.
Evaluates the Excel-compatible SKEW.P statistical function.
Example: =SKEW.P(1,2,3).

variableSLNsource ↗
SLN: FormulaFunction

SLN: straight-line depreciation.

variableSLOPEsource ↗
SLOPE: FormulaFunction

SLOPE formula.
Evaluates the Excel-compatible SLOPE statistical function.
Example: =SLOPE(1,2,3).

variableSMALLsource ↗
SMALL: FormulaFunction

SMALL formula.
Evaluates the Excel-compatible SMALL statistical function.
Example: =SMALL(1,2,3).

variableSORTsource ↗
SORT: FormulaFunction

SORT orders rows by one column. Example: =SORT(A1:B3,1,1).

variableSORTBYsource ↗
SORTBY: FormulaFunction

SORTBY orders rows using one or more key arrays. Example: =SORTBY(A1:B3,B1:B3,1).

variableSORTNsource ↗
SORTN: FormulaFunction

SORTN returns the first ranked rows after sorting. Example: =SORTN({3;1;2},2) returns {1;2}.

variableSPARKLINEsource ↗
SPARKLINE: FormulaFunction

SPARKLINE renders numeric data as a compact text sparkline. Example: =SPARKLINE({1,3,2}) returns a three-glyph trend.

variableSPLITsource ↗
SPLIT: FormulaFunction

SPLIT divides text into a spilling row. Example: =SPLIT("a,b,c",",") returns {"a","b","c"}.

variableSQRTsource ↗
SQRT: FormulaFunction

SQRT: Returns the positive square root of a number.

Example
=SQRT(0) returns 0.
variableSQRTPIsource ↗
SQRTPI: FormulaFunction

SQRTPI: Returns the square root of a number multiplied by pi.

Example
=SQRTPI(0) returns 0.
variableSTANDARDIZEsource ↗
STANDARDIZE: FormulaFunction

STANDARDIZE formula.
Evaluates the Excel-compatible STANDARDIZE statistical function.
Example: =STANDARDIZE(1,2,3).

variableSTDEVsource ↗
STDEV: FormulaFunction

STDEV compatibility formula: Returns the sample standard deviation.

Example
=STDEV(1,2,3)
variableSTDEV_Psource ↗
STDEV_P: FormulaFunction

STDEV.P formula.
Evaluates the Excel-compatible STDEV.P statistical function.
Example: =STDEV.P(1,2,3).

variableSTDEV_Ssource ↗
STDEV_S: FormulaFunction

STDEV.S formula.
Evaluates the Excel-compatible STDEV.S statistical function.
Example: =STDEV.S(1,2,3).

variableSTDEVAsource ↗
STDEVA: FormulaFunction

STDEVA formula.
Evaluates the Excel-compatible STDEVA statistical function.
Example: =STDEVA(1,2,3).

variableSTDEVPsource ↗
STDEVP: FormulaFunction

STDEVP compatibility formula: Returns the population standard deviation.

Example
=STDEVP(1,2,3)
variableSTDEVPAsource ↗
STDEVPA: FormulaFunction

STDEVPA formula.
Evaluates the Excel-compatible STDEVPA statistical function.
Example: =STDEVPA(1,2,3).

variableSTEYXsource ↗
STEYX: FormulaFunction

STEYX formula.
Evaluates the Excel-compatible STEYX statistical function.
Example: =STEYX(1,2,3).

variableSTOCKHISTORYsource ↗
STOCKHISTORY: FormulaFunction

STOCKHISTORY: Returns historical market data from a host-managed synchronous cache.

Example
=STOCKHISTORY("MSFT",DATE(2024,1,1))
variableSUBSTITUTEsource ↗
SUBSTITUTE: FormulaFunction

Replaces matching text, optionally only one occurrence. Example: SUBSTITUTE("a-b","-","/") returns "a/b".

variableSUBTOTALsource ↗
SUBTOTAL: FormulaFunction

SUBTOTAL: Calculates a subtotal for a range using a selected aggregation code.

Example
=SUBTOTAL(9,A1:A3) returns the sum of A1:A3.
variableSUMsource ↗
SUM: FormulaFunction

SUM function definition.

variableSUMIFsource ↗
SUMIF: FormulaFunction

SUMIF: Adds values that satisfy one condition.

Example
=SUMIF({1,2,3},">1",{10,20,30}) returns 50.
variableSUMIFSsource ↗
SUMIFS: FormulaFunction

Sums values whose corresponding ranges satisfy every criterion.

variableSUMPRODUCTsource ↗
SUMPRODUCT: FormulaFunction

SUMPRODUCT: Multiplies corresponding array elements and adds the products.

Example
=SUMPRODUCT({2,3,4},{10,20,30}) returns 200.
variableSUMSQsource ↗
SUMSQ: FormulaFunction

SUMSQ: Returns the sum of the squares of numeric values.

Example
=SUMSQ(0,3) returns 9.
variableSUMX2MY2source ↗
SUMX2MY2: FormulaFunction

SUMX2MY2: Returns the sum of the differences between corresponding squares.

Example
=SUMX2MY2({1,2},{3,4}) returns -20.
variableSUMX2PY2source ↗
SUMX2PY2: FormulaFunction

SUMX2PY2: Returns the sum of the sums of corresponding squares.

Example
=SUMX2PY2({1,2},{3,4}) returns 30.
variableSUMXMY2source ↗
SUMXMY2: FormulaFunction

SUMXMY2: Returns the sum of the squares of corresponding differences.

Example
=SUMXMY2({1,2},{3,4}) returns 8.
variableSWITCHsource ↗
SWITCH: FormulaFunction

SWITCH: Matches one expression and returns its paired result.

Example
=SWITCH(2,1,"one",2,"two","other")
variableSYDsource ↗
SYD: FormulaFunction

SYD: sum-of-years-digits depreciation.

variableTsource ↗
T: FormulaFunction

Returns text values and an empty string for non-text values. Example: T("Excel") returns "Excel".

variableT_DISTsource ↗
T_DIST: FormulaFunction

T.DIST formula.
Evaluates the Excel-compatible T.DIST statistical function.
Example: =T.DIST(1,1,TRUE).

variableT_DIST_2Tsource ↗
T_DIST_2T: FormulaFunction

T.DIST.2T formula.
Evaluates the Excel-compatible T.DIST.2T statistical function.
Example: =T.DIST.2T(1,1,TRUE).

variableT_DIST_RTsource ↗
T_DIST_RT: FormulaFunction

T.DIST.RT formula.
Evaluates the Excel-compatible T.DIST.RT statistical function.
Example: =T.DIST.RT(1,1,TRUE).

variableT_INVsource ↗
T_INV: FormulaFunction

T.INV formula.
Evaluates the Excel-compatible T.INV statistical function.
Example: =T.INV(0.5,1,1).

variableT_INV_2Tsource ↗
T_INV_2T: FormulaFunction

T.INV.2T formula.
Evaluates the Excel-compatible T.INV.2T statistical function.
Example: =T.INV.2T(0.5,1,1).

variableT_TESTsource ↗
T_TEST: FormulaFunction

T.TEST formula.
Evaluates the Excel-compatible T.TEST statistical function.
Example: =T.TEST(1,2,3).

variableTAKEsource ↗
TAKE: FormulaFunction

TAKE keeps rows and columns. Example: =TAKE(A1:C3,2) keeps the first two rows.

variableTANsource ↗
TAN: FormulaFunction

TAN: Returns the tangent of an angle in radians.

Example
=TAN(0) returns 0.
variableTANHsource ↗
TANH: FormulaFunction

TANH: Returns the hyperbolic tangent of a number.

Example
=TANH(0) returns 0.
variableTBILLEQsource ↗
TBILLEQ: FormulaFunction

TBILLEQ: bond-equivalent yield for a Treasury bill.

variableTBILLPRICEsource ↗
TBILLPRICE: FormulaFunction

TBILLPRICE: price per 100 for a Treasury bill.

variableTBILLYIELDsource ↗
TBILLYIELD: FormulaFunction

TBILLYIELD: discount yield for a Treasury bill price.

variableTDISTsource ↗
TDIST: FormulaFunction

TDIST compatibility formula: Returns a one- or two-tailed Student t probability.

Example
=TDIST(1.96,60,2)
variableTEXTsource ↗
TEXT: FormulaFunction

Formats a value with an Excel format code. Example: TEXT(1234.5,"#,##0.00") returns "1,234.50".

variableTEXTAFTERsource ↗
TEXTAFTER: FormulaFunction

Returns text after a delimiter occurrence. Example: TEXTAFTER("red-blue","-") returns "blue".

variableTEXTBEFOREsource ↗
TEXTBEFORE: FormulaFunction

Returns text before a delimiter occurrence. Example: TEXTBEFORE("red-blue","-") returns "red".

variabletextFunctionssource ↗
textFunctions: readonly FormulaFunction[]
variableTEXTJOINsource ↗
TEXTJOIN: FormulaFunction

Joins values with a delimiter and optional empty-value filtering. Example: TEXTJOIN(",",TRUE,"A","B") returns "A,B".

variableTEXTSPLITsource ↗
TEXTSPLIT: FormulaFunction

Splits text into a spill matrix. Example: TEXTSPLIT("A,B",",") returns {"A","B"}.

variableTIMEsource ↗
TIME: FormulaFunction

TIME: Converts hour, minute, and second parts into a fraction of one day.
Example: =TIME(12,0,0) returns 0.5.

variableTIMEVALUEsource ↗
TIMEVALUE: FormulaFunction

TIMEVALUE: Converts time text into the fractional part of one day.
Example: =TIMEVALUE("2:24 AM") returns 0.1.

variableTINVsource ↗
TINV: FormulaFunction

TINV compatibility formula: Returns the inverse two-tailed Student t value.

Example
=TINV(0.05,10)
variableTO_DATEsource ↗
TO_DATE: FormulaFunction

TO_DATE converts a number to its Excel date serial by removing its time fraction. Example: =TO_DATE(45351.75) returns 45351.

variableTO_DOLLARSsource ↗
TO_DOLLARS: FormulaFunction

TO_DOLLARS converts a value to a dollar amount. Example: =TO_DOLLARS(12.5) returns 12.5.

variableTO_PERCENTsource ↗
TO_PERCENT: FormulaFunction

TO_PERCENT converts a decimal to its percentage value. Example: =TO_PERCENT(0.25) returns 0.25 for percentage formatting.

variableTO_PURE_NUMBERsource ↗
TO_PURE_NUMBER: FormulaFunction

TO_PURE_NUMBER strips display formatting and returns a number. Example: =TO_PURE_NUMBER("42") returns 42.

variableTO_TEXTsource ↗
TO_TEXT: FormulaFunction

TO_TEXT converts a scalar to text. Example: =TO_TEXT(42) returns "42".

variableTOCOLsource ↗
TOCOL: FormulaFunction

TOCOL flattens an array into one column. Example: =TOCOL(A1:B2).

variableTODAYsource ↗
TODAY: FormulaFunction

TODAY: 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.

variableTOROWsource ↗
TOROW: FormulaFunction

TOROW flattens an array into one row. Example: =TOROW(A1:B2).

variableTRANSLATEsource ↗
TRANSLATE: FormulaFunction

Reads a previously loaded translation from the host cache. Example: TRANSLATE("hello", "en", "es") reads the cached result.

variableTRANSPOSEsource ↗
TRANSPOSE: FormulaFunction

TRANSPOSE swaps array rows and columns. Example: =TRANSPOSE(A1:B2).

variableTRENDsource ↗
TREND: FormulaFunction

TREND formula.
Evaluates the Excel-compatible TREND statistical function.
Example: =TREND(1,2,3).

variableTRIMsource ↗
TRIM: FormulaFunction

Removes outer ASCII spaces and collapses internal runs. Example: TRIM(" a b ") returns "a b".

variableTRIMMEANsource ↗
TRIMMEAN: FormulaFunction

TRIMMEAN formula.
Evaluates the Excel-compatible TRIMMEAN statistical function.
Example: =TRIMMEAN(1,2,3).

variableTRIMRANGEsource ↗
TRIMRANGE: FormulaFunction

TRIMRANGE removes fully blank outer rows and columns. Example: =TRIMRANGE(A1:D5).

variableTRUEsource ↗
TRUE: FormulaFunction

TRUE: Returns the logical value TRUE.

Example
=TRUE()
variableTRUNCsource ↗
TRUNC: FormulaFunction

TRUNC: Truncates a number toward zero to a specified number of digits.

Example
=TRUNC(-3.9) returns -3.
variableTTESTsource ↗
TTEST: FormulaFunction

TTEST compatibility formula: Returns a Student t-test probability.

Example
=TTEST({1,2,3},{1,2,4},2,1)
variableTYPEsource ↗
TYPE: FormulaFunction

TYPE: Returns the numeric type code for a formula value.

Example
=TYPE(42)
variableUMINUSsource ↗
UMINUS: FormulaFunction

UMINUS reverses a number's sign. Example: =UMINUS(3) returns -3.

variableUNARY_PERCENTsource ↗
UNARY_PERCENT: FormulaFunction

UNARY_PERCENT converts a percentage value to its decimal. Example: =UNARY_PERCENT(25) returns 0.25.

variableUNICHARsource ↗
UNICHAR: FormulaFunction

Returns the Unicode character for a code point. Example: UNICHAR(9733) returns "★".

variableUNICODEsource ↗
UNICODE: FormulaFunction

Returns the Unicode code point of the first character. Example: UNICODE("★") returns 9733.

variableUNIQUEsource ↗
UNIQUE: FormulaFunction

UNIQUE returns distinct rows. Example: =UNIQUE({1;1;2}) returns 1 and 2.

variableUPLUSsource ↗
UPLUS: FormulaFunction

UPLUS returns the numeric value unchanged. Example: =UPLUS("3") returns 3.

variableUPPERsource ↗
UPPER: FormulaFunction

Converts letters to uppercase. Example: UPPER("Excel") returns "EXCEL".

variableVALUEsource ↗
VALUE: FormulaFunction

Converts common numeric text to a number. Example: VALUE("$1,234.50") returns 1234.5.

variableVALUETOTEXTsource ↗
VALUETOTEXT: FormulaFunction

Converts one value to concise or strict text. Example: VALUETOTEXT("A",1) returns "\"A\"".

variableVARsource ↗
VAR: FormulaFunction

VAR formula.
Estimates sample variance for compatibility with legacy Excel workbooks.
Example: =VAR(1,2,3).

variableVAR_Psource ↗
VAR_P: FormulaFunction

VAR.P formula.
Evaluates the Excel-compatible VAR.P statistical function.
Example: =VAR.P(1,2,3).

variableVAR_Ssource ↗
VAR_S: FormulaFunction

VAR.S formula.
Evaluates the Excel-compatible VAR.S statistical function.
Example: =VAR.S(1,2,3).

variableVARAsource ↗
VARA: FormulaFunction

VARA formula.
Evaluates the Excel-compatible VARA statistical function.
Example: =VARA(1,2,3).

variableVARPsource ↗
VARP: FormulaFunction

VARP compatibility formula: Returns the population variance.

Example
=VARP(1,2,3)
variableVARPAsource ↗
VARPA: FormulaFunction

VARPA formula.
Evaluates the Excel-compatible VARPA statistical function.
Example: =VARPA(1,2,3).

variableVDBsource ↗
VDB: FormulaFunction

VDB: variable declining-balance depreciation.

variableVLOOKUPsource ↗
VLOOKUP: FormulaFunction

VLOOKUP: 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".
variableVSTACKsource ↗
VSTACK: FormulaFunction

VSTACK joins arrays vertically. Example: =VSTACK({1,2},{3,4}).

variablewebFunctionssource ↗
webFunctions: readonly FormulaFunction[]
variableWEBSERVICEsource ↗
WEBSERVICE: FormulaFunction

Reads response text from a host-loaded HTTP cache. Example: WEBSERVICE("https://example.com/data.xml") returns cached XML.

variableWEEKDAYsource ↗
WEEKDAY: FormulaFunction

WEEKDAY: Returns the day of week using the requested Excel return type.
Example: =WEEKDAY("2008-2-14",2) returns 4.

variableWEEKNUMsource ↗
WEEKNUM: FormulaFunction

WEEKNUM: Returns the week number of a date using Excel week-numbering rules.
Example: =WEEKNUM("2012-3-9",2) returns 11.

variableWEIBULLsource ↗
WEIBULL: FormulaFunction

WEIBULL compatibility formula: Returns a Weibull distribution value.

Example
=WEIBULL(105,20,100,TRUE)
variableWEIBULL_DISTsource ↗
WEIBULL_DIST: FormulaFunction

WEIBULL.DIST formula.
Evaluates the Excel-compatible WEIBULL.DIST statistical function.
Example: =WEIBULL.DIST(1,1,TRUE).

variableWORKDAYsource ↗
WORKDAY: FormulaFunction

WORKDAY: 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_INTLsource ↗
WORKDAY_INTL: FormulaFunction

WORKDAY.INTL: Returns a workday-offset date serial with custom weekend rules.
Example: =WORKDAY.INTL(DATE(2012,1,1),30,17) returns 40944.

variableWRAPCOLSsource ↗
WRAPCOLS: FormulaFunction

WRAPCOLS wraps a vector by columns. Example: =WRAPCOLS({1,2,3},2,0).

variableWRAPROWSsource ↗
WRAPROWS: FormulaFunction

WRAPROWS wraps a vector by rows. Example: =WRAPROWS({1,2,3},2,0).

variableXIRRsource ↗
XIRR: FormulaFunction

XIRR: internal rate of return for irregular cash-flow dates.

variableXLOOKUPsource ↗
XLOOKUP: FormulaFunction

XLOOKUP searches a vector and returns a corresponding value. Example: =XLOOKUP(2,{1,2},{"A","B"}).

variableXMATCHsource ↗
XMATCH: FormulaFunction

XMATCH returns a position with modern MATCH modes. Example: =XMATCH("B",{"A";"B"}).

variableXNPVsource ↗
XNPV: FormulaFunction

XNPV: net present value for irregular cash-flow dates.

variableXORsource ↗
XOR: FormulaFunction

XOR: Returns TRUE when an odd number of values are TRUE.

Example
=XOR(TRUE,FALSE)
variableYEARsource ↗
YEAR: FormulaFunction

YEAR: Returns the year for a date serial.
Example: =YEAR("7/5/2025") returns 2025.

variableYEARFRACsource ↗
YEARFRAC: FormulaFunction

YEARFRAC: Returns the fraction of a year represented by two dates.
Example: =YEARFRAC("1/1/2012","7/30/2012",1) returns 0.5765027322404371.

variableYIELDsource ↗
YIELD: FormulaFunction

YIELD: yield of a coupon security.

variableYIELDDISCsource ↗
YIELDDISC: FormulaFunction

YIELDDISC: yield of a discounted security.

variableYIELDMATsource ↗
YIELDMAT: FormulaFunction

YIELDMAT: yield of a security paying interest at maturity.

variableZ_TESTsource ↗
Z_TEST: FormulaFunction

Z.TEST formula.
Evaluates the Excel-compatible Z.TEST statistical function.
Example: =Z.TEST(1,2,3).

variableZTESTsource ↗
ZTEST: FormulaFunction

ZTEST compatibility formula: Returns the one-tailed z-test probability.

Example
=ZTEST({3,6,7,8},4)
functionbondDurationsource ↗
bondDuration(settlement: number, maturity: number, annualRate: number, annualYield: number, redemption?: number, frequencyValue?: number, basisValue?: number): BondResult

Computes Macaulay duration from a clean bond price.

settlement: number
maturity: number
annualRate: number
annualYield: number
redemption: number
frequencyValue: number
basisValue: number
functionbondPricesource ↗
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.

settlement: number
maturity: number
annualRate: number
annualYield: number
redemption: number
frequencyValue: number
basisValue: number
functioncellKeysource ↗
cellKey(row: number, col: number): number

Encodes zero-based coordinates as one numeric cell key.

row: number
col: number
functioncollectFinancialCashFlowssource ↗
collectFinancialCashFlows(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaError

Collects a scalar, array, or range argument into finite numeric cash flows.

arg: FormulaArg | undefined
context: EvalContext
acceptFormattedText: boolean
functioncollectFinancialDateSerialssource ↗
collectFinancialDateSerials(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaError

Date arguments use whole serial days and reject boolean values.

arg: FormulaArg | undefined
context: EvalContext
acceptFormattedText: boolean
functioncollectFinancialScheduleRatessource ↗
collectFinancialScheduleRates(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaError

Multi-cell schedules reject stored text rates even when the text is numeric.

arg: FormulaArg | undefined
context: EvalContext
functioncollectNpvCashFlowssource ↗
collectNpvCashFlows(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaError

NPV ignores nonnumeric cells in references without consuming a period.

arg: FormulaArg | undefined
context: EvalContext
functioncouponAmountsource ↗
couponAmount(faceValue: number, annualRate: number, frequency: 1 | 2 | 4): number | FormulaError

Returns the coupon amount for a face value and annual coupon rate.

faceValue: number
annualRate: number
frequency: 1 | 2 | 4
functioncreateDefaultFormulaLocaleProvidersource ↗
createDefaultFormulaLocaleProvider(): IFormulaLocaleProvider

Creates the default formula locale provider used when no i18n plugin is installed.

functioncreateExcelDateTimeLocalesource ↗
createExcelDateTimeLocale(input: BuiltInExcelDateTimeLocaleId | { locale: string; symbols?: FormulaDateTimeSymbols }): FormulaDateTimeLocale

Creates a built-in Excel-compatible date/time locale.

input: BuiltInExcelDateTimeLocaleId | { locale: string; symbols?: FormulaDateTimeSymbols }
functioncreateFormulaTextLocalesource ↗
createFormulaTextLocale(input: { calculationModeLabel?: (mode: "Automatic" | "Manual"): string; characterCode?: (text: string): number; characterFromCode?: (code: number): string | undefined; charWidth: CharWidth; compareText?: (left: string, right: string): number; locale: string; toFullWidth?: (text: string): string; toHalfWidth?: (text: string): string; … }): FormulaTextLocale

Creates a byte-oriented text locale from a character-width strategy.

input: { calculationModeLabel?: (mode: "Automatic" | "Manual"): string; characterCode?: (text: string): number; characterFromCode?: (code: number): string | undefined; charWidth: CharWidth; compareText?: (left: string, right: string): number; locale: string; toFullWidth?: (text: string): string; toHalfWidth?: (text: string): string; … }
functioncurrentExcelDateTimeSerialsource ↗
currentExcelDateTimeSerial(context: EvalContext): number
context: EvalContext
functiondecliningBalanceDepreciationsource ↗
decliningBalanceDepreciation(cost: number, salvage: number, life: number, period: number, factor?: number): DepreciationResult

Declining-balance depreciation for a one-based period.

cost: number
salvage: number
life: number
period: number
factor: number
functionexcelDatePartsFromSerialsource ↗
excelDatePartsFromSerial(serial: number): ExcelDateParts | null
serial: number
functionexcelSerialFromDatePartssource ↗
excelSerialFromDateParts(year: number, month: number, day: number): number | null
year: number
month: number
day: number
functionexcelSerialToUnixMillissource ↗
excelSerialToUnixMillis(serial: number): number
serial: number
functionexcelTimeFractionsource ↗
excelTimeFraction(hour: number, minute: number, second: number): number | null
hour: number
minute: number
second: number
functionfinancialDayCountDayssource ↗
financialDayCountDays(start: number, end: number, basis: FinancialDayCountBasis): DayCountResult

Returns the number of days between two Excel serial dates for a basis.

start: number
end: number
basis: FinancialDayCountBasis
functionfinancialDivisionErrorsource ↗
financialDivisionError(): FormulaError

Returns a standard #DIV/0! result for an undefined periodic payment.

functionfinancialNumberErrorsource ↗
financialNumberError(): FormulaError

Returns a standard #NUM! result for an invalid basis or date interval.

functionfinancialValueErrorsource ↗
financialValueError(): FormulaError

Returns a standard #VALUE! result for malformed financial inputs.

functionfinancialYearFractionsource ↗
financialYearFraction(start: number, end: number, basis: FinancialDayCountBasis): DayCountResult

Returns the Excel year fraction for a financial basis.

start: number
end: number
basis: FinancialDayCountBasis
functionforEachFinancialCashFlowsource ↗
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.

arg: FormulaArg
context: EvalContext
callback: (value: number, index: number): boolean | void
functionformatBahtTextsource ↗
formatBahtText(value: number): string | undefined

Converts a finite number to Excel-style Thai baht and satang text.

value: number
functionformatExcelDateTimesource ↗
formatExcelDateTime(serial: number, pattern?: string): string
serial: number
pattern: string
functionfromCellKeysource ↗
fromCellKey(key: number): [number, number]

Decodes a numeric cell key to zero-based coordinates.

key: number
functionfutureValuesource ↗
futureValue(rate: number, periods: number, payment: number, presentValue: number, type?: number): FinancialNumberResult

Computes the future value of a periodic annuity.

rate: number
periods: number
payment: number
presentValue: number
type: number
functionisFinancialMonthEndsource ↗
isFinancialMonthEnd(serial: number): boolean

Returns whether an Excel serial date is the last calendar day of its month.

serial: number
functionisTextualFinancialReferencesource ↗
isTextualFinancialReference(arg: FormulaArg | undefined, context: EvalContext): boolean
arg: FormulaArg | undefined
context: EvalContext
functionnormalizeCouponFrequencysource ↗
normalizeCouponFrequency(value: number): 1 | 2 | 4 | FormulaError

Validates a bond frequency used by Excel financial functions.

value: number
functionnormalizeFinancialBasissource ↗
normalizeFinancialBasis(value: number | undefined): FormulaError | FinancialDayCountBasis

Checks and normalizes the five Excel day-count basis values.

value: number | undefined
functionnumericDateTextsource ↗
numericDateText(value: FormulaValue, context: EvalContext): number | undefined
value: FormulaValue
context: EvalContext
functionoddLastRegularPeriodDayssource ↗
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.

lastCoupon: number
frequency: 1 | 2 | 4
basis: FinancialDayCountBasis
functionparseCellRefsource ↗
parseCellRef(ref: string): ParsedCellRef

Parses an A1-notation cell reference.

ref: string
functionparseExcelDatesource ↗
parseExcelDate(value: unknown, options?: ExcelDateTimeParseOptions): number | null
value: unknown
options: ExcelDateTimeParseOptions
functionparseExcelDateTimesource ↗
parseExcelDateTime(value: unknown, options?: ExcelDateTimeParseOptions): ParsedExcelDateTime | null
value: unknown
options: ExcelDateTimeParseOptions
functionparseExcelTimesource ↗
parseExcelTime(value: unknown, options?: ExcelDateTimeParseOptions): number | null
value: unknown
options: ExcelDateTimeParseOptions
functionpaymentsource ↗
payment(rate: number, periods: number, presentValue: number, future?: number, type?: number): FinancialNumberResult

Computes a periodic payment for an annuity.

rate: number
periods: number
presentValue: number
future: number
type: number
functionperiodicNpvsource ↗
periodicNpv(rate: number, cashFlows: readonly number[]): FinancialNumberResult

Computes periodic NPV. The first value is discounted by one period.

rate: number
cashFlows: readonly number[]
functionreadFinancialNumbersource ↗
readFinancialNumber(arg: FormulaArg | undefined, context: EvalContext, options?: { acceptLocalizedCurrency?: boolean }): FinancialNumberResult

Reads a scalar financial input, preserving formula errors.

arg: FormulaArg | undefined
context: EvalContext
options: { acceptLocalizedCurrency?: boolean }
functionresolveCouponSchedulesource ↗
resolveCouponSchedule(settlement: number, maturity: number, frequencyValue: number, basisValue?: number): FormulaError | CouponSchedule

Resolves the previous/next coupon dates and basis-dependent day counts.

settlement: number
maturity: number
frequencyValue: number
basisValue: number
functionresolveOddFirstCouponSchedulesource ↗
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.

settlement: number
maturity: number
firstCoupon: number
frequencyValue: number
basisValue: number
functionsolveFinancialRootsource ↗
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.

functionValue: (value: number): number
derivative: (value: number): number | undefined
options: FinancialRootOptions
functionstraightLineDepreciationsource ↗
straightLineDepreciation(cost: number, salvage: number, life: number): DepreciationResult

Straight-line depreciation for one period.

cost: number
salvage: number
life: number
functionsumOfYearsDepreciationsource ↗
sumOfYearsDepreciation(cost: number, salvage: number, life: number, period: number): DepreciationResult

Sum-of-years-digits depreciation for a one-based period.

cost: number
salvage: number
life: number
period: number
functiontoCellRefsource ↗
toCellRef(row: number, col: number, absRow?: boolean, absCol?: boolean): string

Converts zero-based coordinates to A1 notation.

row: number
col: number
absRow: boolean
absCol: boolean
functionunixMillisToExcelSerialsource ↗
unixMillisToExcelSerial(epochMs: number): number
epochMs: number
functionvariableDecliningBalancesource ↗
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.

cost: number
salvage: number
life: number
startPeriod: number
endPeriod: number
factor: number
noSwitch: boolean

Package

@searsuite/sear-domain-formula-engine

175 exports

Host-neutral formula values, evaluation contracts, registries, references, and external-service boundaries.

namespaceIAggregationCachesource ↗
IAggregationCache: unknown
variablesymbol
symbol: typeof symbol
namespaceIDependencyGraphsource ↗
IDependencyGraph: unknown
variablesymbol
symbol: typeof symbol
namespaceIFormulaCalculationTraceProvidersource ↗
IFormulaCalculationTraceProvider: unknown
variablesymbol
symbol: typeof symbol

DI token for resolving IFormulaCalculationTraceProvider.

namespaceIFormulaDateSystemProvidersource ↗
IFormulaDateSystemProvider: unknown
variablesymbol
symbol: typeof symbol
namespaceIFormulaEvaluatorsource ↗
IFormulaEvaluator: unknown
variablesymbol
symbol: typeof symbol
namespaceIFormulaExternalServiceProvidersource ↗
IFormulaExternalServiceProvider: unknown
variablesymbol
symbol: symbol
namespaceIFormulaIterationSettingsProvidersource ↗
IFormulaIterationSettingsProvider: unknown
variablesymbol
symbol: typeof symbol
namespaceIFormulaLocaleProvidersource ↗
IFormulaLocaleProvider: unknown
variablesymbol
symbol: typeof symbol

DI token for resolving IFormulaLocaleProvider.

namespaceIFormulaParsersource ↗
IFormulaParser: unknown
variablesymbol
symbol: typeof symbol
namespaceIFormulaResultProvidersource ↗
IFormulaResultProvider: unknown
variablesymbol
symbol: typeof symbol

DI token for resolving IFormulaResultProvider.

namespaceIFormulaRichResultProvidersource ↗
IFormulaRichResultProvider: unknown
variablesymbol
symbol: typeof symbol
namespaceIFormulaSourceProvidersource ↗
IFormulaSourceProvider: unknown
variablesymbol
symbol: typeof symbol

DI token for resolving IFormulaSourceProvider.

namespaceIFormulaStatusProvidersource ↗
IFormulaStatusProvider: unknown
variablesymbol
symbol: typeof symbol

DI token for resolving IFormulaStatusProvider.

namespaceIFormulaTextServiceProvidersource ↗
IFormulaTextServiceProvider: unknown
variablesymbol
symbol: typeof symbol

DI token for host adapters that supply text-formula services.

namespaceIFunctionRegistrysource ↗
IFunctionRegistry: unknown
variablesymbol
symbol: typeof symbol
classFormulaFunctionArgumentssource ↗
class FormulaFunctionArguments

Public coercion and argument-reading SDK for built-in and third-party formula functions.

constructorconstructor
FormulaFunctionArguments(args: readonly FormulaArg[], context: EvalContext): FormulaFunctionArguments
args: readonly FormulaArg[]
context: EvalContext
methodboolean
boolean(index: number, fallback?: boolean): boolean | FormulaError

Reads a boolean argument from booleans, numbers, or TRUE/FALSE text.

index: number
fallback: boolean
methodinteger
integer(index: number, fallback?: number): number | FormulaError

Reads a truncated integer argument.

index: number
fallback: number
methodisMissing
isMissing(index: number): boolean

Returns whether an argument was omitted.

index: number
methodnumber
number(index: number, fallback?: number): number | FormulaError

Reads and coerces one argument to a finite number.

index: number
fallback: number
methodreference
reference(index: number): FormulaError | ResolvedFormulaRange

Reads a reference argument without materializing it.

index: number
methodtext
text(index: number, fallback?: string): string | FormulaError

Reads and coerces one argument to text using spreadsheet-compatible scalar rules.

index: number
fallback: string
methodvalue
value(index: number): FormulaValue

Reads one scalar argument while preserving formula errors.

index: number
interfaceCellChangesource ↗
interface CellChange

Value transition for one formula-visible cell.

propertycol
col: number
propertykey
key: number
propertynewVal
newVal: FormulaValue
propertyoldVal
oldVal: FormulaValue
propertyrow
row: number
interfaceEvalContextsource ↗
interface EvalContext

Host-provided services and data readers used during formula evaluation.

propertyaggregationCache
aggregationCache?: IAggregationCache
propertyarrayFormulaMode
arrayFormulaMode?: "dynamic" | "legacy"
propertybudget
budget?: FormulaEvaluationBudget
propertycurrentCell
currentCell?: FormulaCellPosition
propertydateSystem
dateSystem?: FormulaDateSystem
propertydateTimeLocale
dateTimeLocale?: FormulaDateTimeLocale
propertyexternalServices
externalServices?: FormulaExternalServiceReader
propertyformulaSource
formulaSource?: IFormulaSourceProvider
propertylanguageService
languageService?: FormulaLanguageService
propertymetadata
metadata?: FormulaMetadataReader
propertyphoneticReader
phoneticReader?: FormulaPhoneticReader
propertyreferenceResolver
referenceResolver?: FormulaReferenceResolver
propertyregisterDynamicDependency
registerDynamicDependency?: FormulaDynamicDependencyRegistrar
propertyscope
scope?: FormulaEvaluationScope
propertytextLocale
textLocale?: FormulaTextLocale
propertyxmlXPath
xmlXPath?: XmlXPathEvaluator
methodcurrentDateTime
currentDateTime(): number
methodevaluateArrayFormula
evaluateArrayFormula(ast: FormulaAST, scope?: FormulaEvaluationScope): FormulaValue
ast: FormulaAST
scope: FormulaEvaluationScope
methodevaluateFormula
evaluateFormula(ast: FormulaAST, scope?: FormulaEvaluationScope): FormulaValue
ast: FormulaAST
scope: FormulaEvaluationScope
methodforFormulaCell
forFormulaCell(cell: FormulaCellPosition): EvalContext
cell: FormulaCellPosition
methodgetCellValue
getCellValue(row: number, col: number): FormulaValue
row: number
col: number
methodgetSheetShape
getSheetShape(): [rowCount: number, colCount: number]
methodgetWorkbookCellValue
getWorkbookCellValue(sheetName: string, row: number, col: number): FormulaValue
sheetName: string
row: number
col: number
methodisCellInBounds
isCellInBounds(row: number, col: number): boolean
row: number
col: number
methodisCellOccupied
isCellOccupied(row: number, col: number): boolean
row: number
col: number
methoditerateRange
iterateRange(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>
startRow: number
startCol: number
endRow: number
endCol: number
methoditerateRangeCells
iterateRangeCells(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>
startRow: number
startCol: number
endRow: number
endCol: number
methoditerateWorkbookRange
iterateWorkbookRange(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>
sheetName: string
startRow: number
startCol: number
endRow: number
endCol: number
methoditerateWorkbookRangeCells
iterateWorkbookRangeCells(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>
sheetName: string
startRow: number
startCol: number
endRow: number
endCol: number
methodrandom
random(): number
methodreadReference
readReference(reference: ResolvedFormulaRange): FormulaValue
reference: ResolvedFormulaRange
interfaceEvalResultsource ↗
interface EvalResult

One result produced during formula batch evaluation.

propertykey
key: number
propertyvalue
value: FormulaValue
interfaceFormulaAddInRegistrationRequestsource ↗
interface FormulaAddInRegistrationRequest

Identifies one procedure exposed by a host-managed add-in.

propertymodule
readonly module: string
propertyprocedure
readonly procedure: string
propertytypeText
readonly typeText?: string
interfaceFormulaAddInServicesource ↗
interface FormulaAddInService

Host-owned native add-in boundary used by CALL and REGISTER.ID.
Implementations must enforce authorization and isolation outside formula evaluation.

methodcall
call(request: FormulaAddInCall): FormulaServiceCacheResult<FormulaValue>
request: FormulaAddInCall
methodresolveRegistration
resolveRegistration(request: FormulaAddInRegistrationRequest): FormulaServiceCacheResult<number>
request: FormulaAddInRegistrationRequest
interfaceFormulaBatchFlushedEventsource ↗
interface FormulaBatchFlushedEvent extends FormulaCalculationTraceEventBase

Event emitted when one batch of derived results is flushed.

propertygeneration
readonly generation: number
propertypendingCount
readonly pendingCount: number
propertyresults
readonly results: readonly FormulaFlushedCellResult[]
propertysequenceinherited
readonly sequence: number
propertytype
readonly type: "formula.batchFlushed"
interfaceFormulaCalculationTraceEventBasesource ↗
interface FormulaCalculationTraceEventBase

Shared metadata attached to every calculation trace event.

propertysequence
readonly sequence: number
interfaceFormulaCellMetadatasource ↗
interface FormulaCellMetadata

Read-only cell facts consumed by information formulas.

propertyformula
readonly formula?: string
propertylocked
readonly locked?: boolean
propertynumberFormat
readonly numberFormat?: string
propertyreference
readonly reference: FormulaMetadataCellReference
propertysource
readonly source: FormulaCellSource
propertyvalue
readonly value: FormulaValue
propertywidth
readonly width?: number
interfaceFormulaCellPositionsource ↗
interface FormulaCellPosition

Position of the formula currently being evaluated.

propertycol
readonly col: number
propertyrow
readonly row: number
propertysheetId
readonly sheetId?: string
propertysheetName
readonly sheetName?: string
interfaceFormulaCellStatussource ↗
interface FormulaCellStatus

Read-only formula status snapshot for one sheet cell.

propertycol
readonly col: number
propertydependencies
readonly dependencies: readonly Dependency[]
propertydependents
readonly dependents: readonly number[]
propertydirty
readonly dirty: boolean
propertyerrorCode
readonly errorCode: FormulaErrorCode | undefined
propertyformula
readonly formula: string | undefined
propertyisFormulaCell
readonly isFormulaCell: boolean
propertyresult
readonly result: FormulaValue | undefined
propertyrow
readonly row: number
interfaceFormulaCubeMemberValuesource ↗
interface FormulaCubeMemberValue

CUBE member or tuple identity with its display caption.

propertycaption
readonly caption: string
propertyconnection
readonly connection: string
propertyexpression
readonly expression: string
propertykind
readonly kind: "cube-member"
interfaceFormulaCubeServicesource ↗
interface FormulaCubeService

Host-owned synchronous OLAP cache view. Loading and connection I/O stay outside evaluation.

methodload
load(query: FormulaCubeQuery): Promise<void>
query: FormulaCubeQuery
methodread
read(query: FormulaCubeQuery): FormulaServiceCacheResult<FormulaCubeResult>
query: FormulaCubeQuery
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
interfaceFormulaCubeSetValuesource ↗
interface FormulaCubeSetValue

CUBE set identity with its display caption.

propertycaption
readonly caption: string
propertyconnection
readonly connection: string
propertycount
readonly count?: number
propertyexpression
readonly expression: string
propertykind
readonly kind: "cube-set"
interfaceFormulaDateTimeLocalesource ↗
interface FormulaDateTimeLocale

Locale-specific date/time parsing and formatting used by formulas.

propertylocale
readonly locale: string
propertysymbols
readonly symbols?: FormulaDateTimeSymbols
methodformatDateTime
formatDateTime(serial: number, pattern?: string): string
serial: number
pattern: string
methodparseDateTime
parseDateTime(value: unknown, options?: FormulaDateTimeParseOptions): FormulaDateTimeParseResult | null
value: unknown
options: FormulaDateTimeParseOptions
interfaceFormulaDateTimeMeridiemSymbolsource ↗
interface FormulaDateTimeMeridiemSymbol

Locale-specific AM/PM token.

propertyperiod
readonly period: "am" | "pm"
propertytext
readonly text: string
interfaceFormulaDateTimeMonthSymbolsource ↗
interface FormulaDateTimeMonthSymbol

Locale-specific month-name token.

propertymonth
readonly month: number
propertytext
readonly text: string
interfaceFormulaDateTimeParseOptionssource ↗
interface FormulaDateTimeParseOptions

Options passed to locale-aware formula date/time parsers.

propertycurrentDateTime
readonly currentDateTime?: number
interfaceFormulaDateTimeParseResultsource ↗
interface FormulaDateTimeParseResult

Parsed Excel-compatible date/time serial and source components.

propertyhasDate
readonly hasDate: boolean
propertyhasTime
readonly hasTime: boolean
propertyserial
readonly serial: number
interfaceFormulaDateTimeSymbolssource ↗
interface FormulaDateTimeSymbols

Locale-specific symbols consumed by the shared date/time parser.

propertymeridiems
readonly meridiems?: readonly FormulaDateTimeMeridiemSymbol[]
propertymonths
readonly months?: readonly FormulaDateTimeMonthSymbol[]
propertyunits
readonly units?: FormulaDateTimeUnitSymbols
interfaceFormulaDateTimeUnitSymbolssource ↗
interface FormulaDateTimeUnitSymbols

Locale-specific date-unit tokens.

propertyday
readonly day?: readonly string[]
propertymonth
readonly month?: readonly string[]
propertyyear
readonly year?: readonly string[]
interfaceFormulaDependenciesChangedEventsource ↗
interface FormulaDependenciesChangedEvent extends FormulaCalculationTraceEventBase

Event emitted when one formula cell's dependency edges change.

propertycol
readonly col: number
propertydependencies
readonly dependencies: readonly Dependency[]
propertykey
readonly key: number
propertypreviousDependencies
readonly previousDependencies: readonly Dependency[]
propertyrow
readonly row: number
propertysequenceinherited
readonly sequence: number
propertytype
readonly type: "formula.dependenciesChanged"
interfaceFormulaDirectAddInCallsource ↗
interface FormulaDirectAddInCall extends FormulaAddInRegistrationRequest

Invokes a host-authorized procedure by module signature.

propertyarguments
readonly arguments: readonly FormulaValue[]
propertykind
readonly kind: "direct"
propertymoduleinherited
readonly module: string
propertyprocedureinherited
readonly procedure: string
propertytypeText
readonly typeText: string
interfaceFormulaEnvironmentMetadatasource ↗
interface FormulaEnvironmentMetadata

Optional host facts exposed without leaking platform-native APIs.

propertycalculationMode
readonly calculationMode?: "Automatic" | "Manual"
propertydirectory
readonly directory?: string
propertyoperatingSystem
readonly operatingSystem?: string
propertysystem
readonly system?: string
propertyversion
readonly version?: string
interfaceFormulaErrorsource ↗
interface FormulaError

Serializable formula error value.

propertycode
code: FormulaErrorCode
propertykind
kind: "error"
interfaceFormulaErrorChangedEventsource ↗
interface FormulaErrorChangedEvent extends FormulaCalculationTraceEventBase

Event emitted when one formula cell's error code changes.

propertycol
readonly col: number
propertyerrorCode
readonly errorCode: FormulaErrorCode | undefined
propertygeneration
readonly generation: number
propertykey
readonly key: number
propertypreviousErrorCode
readonly previousErrorCode: FormulaErrorCode | undefined
propertyrow
readonly row: number
propertysequenceinherited
readonly sequence: number
propertytype
readonly type: "formula.errorChanged"
interfaceFormulaEvaluationBudgetsource ↗
interface FormulaEvaluationBudget

Host-neutral execution budget for formula evaluation.

propertymaxSteps
readonly maxSteps: number
methodconsumeStep
consumeStep(): boolean
interfaceFormulaEvaluationScopesource ↗
interface FormulaEvaluationScope

Lexical scope for formula-local names.

propertyparent
readonly parent?: FormulaEvaluationScope
methodget
get(name: string): FormulaValue | undefined
name: string
methodset
set(name: string, value: FormulaValue): void
name: string
value: FormulaValue
interfaceFormulaExternalServiceDefinitionsource ↗
interface FormulaExternalServiceDefinition<T>

Typed identity for one synchronous service view consumed by formulas.

propertyid
readonly id: string
propertysubscribeInvalidation
readonly subscribeInvalidation?: (service: T, listener: (): void): (): void
propertytype
readonly type?: T
interfaceFormulaExternalServiceReadersource ↗
interface FormulaExternalServiceReader

Read-only external-service view exposed during formula evaluation.

methodget
get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefined
definition: FormulaExternalServiceDefinition<T>
interfaceFormulaFlushedCellResultsource ↗
interface FormulaFlushedCellResult

One cell result written during a formula batch flush.

propertycol
readonly col: number
propertyerrorCode
readonly errorCode: FormulaErrorCode | undefined
propertykey
readonly key: number
propertypreviousResult
readonly previousResult: FormulaValue | undefined
propertyresult
readonly result: FormulaValue
propertyrow
readonly row: number
interfaceFormulaFunctionsource ↗
interface FormulaFunction

Runtime contract implemented by built-in and third-party formula functions.

propertyallowReferencesOutsideHostShape
allowReferencesOutsideHostShape?: boolean

Pass reference coordinates to the function even when outside the host's materialized sheet shape.

propertydescriptor
descriptor?: FormulaFunctionDescriptor
propertylazy
lazy?: boolean
propertyname
name: string
propertynamedConstants
namedConstants?: Readonly<Record<string, FormulaValue>>
propertyvolatile
volatile?: boolean
methodevaluate
evaluate(args: FormulaArg[], context: EvalContext): FormulaValue
args: FormulaArg[]
context: EvalContext
methodincrementalUpdate
incrementalUpdate(prevResult: FormulaValue, changedCells: CellChange[], args: FormulaAST[], context: EvalContext): FormulaValue
prevResult: FormulaValue
changedCells: CellChange[]
args: FormulaAST[]
context: EvalContext
interfaceFormulaFunctionDescriptorsource ↗
interface FormulaFunctionDescriptor

Versioned presentation-neutral formula function metadata.

propertycategory
readonly category: string
propertyexample
readonly example: string
propertyexternalServices
readonly externalServices?: readonly string[]
propertymaxArguments
readonly maxArguments?: number

Authoritative upper argument bound. Omit for variadic or illustrative signatures.

propertyminArguments
readonly minArguments?: number

Authoritative lower argument bound. Omit when a signature is illustrative only.

propertyparameters
readonly parameters: readonly FormulaFunctionParameterDescriptor[]
propertyreturnKind
readonly returnKind?: "array" | "scalar" | "scalar-or-array"
propertysummary
readonly summary: string
propertyversion
readonly version: 1
interfaceFormulaFunctionParameterDescriptorsource ↗
interface FormulaFunctionParameterDescriptor

One function parameter exposed to formula-authoring tools.

propertyaccepts
readonly accepts?: readonly FormulaFunctionArgumentKind[]
propertydescription
readonly description: string
propertyname
readonly name: string
propertyoptional
readonly optional?: boolean
propertyrepeating
readonly repeating?: boolean
interfaceFormulaGoogleRequestsource ↗
interface FormulaGoogleRequest

Serializable request used by host-backed Google-compatible formulas.

propertyarguments
readonly arguments: readonly FormulaValue[]
propertyfunctionName
readonly functionName: string
interfaceFormulaGoogleServicesource ↗
interface FormulaGoogleService

Synchronous cache view. Hosts load values outside formula evaluation.

methodread
read(request: FormulaGoogleRequest): FormulaServiceCacheResult<FormulaValue>
request: FormulaGoogleRequest
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
interfaceFormulaHyperlinkResultsource ↗
interface FormulaHyperlinkResult

Host-neutral hyperlink result projected by a formula renderer.

propertykind
readonly kind: "hyperlink"
propertylabel
readonly label: string
propertytarget
readonly target: string
interfaceFormulaHyperlinkServicesource ↗
interface FormulaHyperlinkService

Host policy for validating and normalizing hyperlink targets.

methodnormalizeTarget
normalizeTarget(target: string): string | undefined
target: string
interfaceFormulaImageResourcesource ↗
interface FormulaImageResource

Host-neutral image resource returned by an image loader.

propertyassetId
readonly assetId: string
propertyintrinsicHeight
readonly intrinsicHeight?: number
propertyintrinsicWidth
readonly intrinsicWidth?: number
propertysource
readonly source: string
interfaceFormulaImageResultsource ↗
interface FormulaImageResult

Host-neutral image result projected by a formula renderer.

propertyaltText
readonly altText?: string
propertyheight
readonly height?: number
propertykind
readonly kind: "image"
propertyresource
readonly resource: FormulaImageResource
propertysizing
readonly sizing?: number
propertywidth
readonly width?: number
interfaceFormulaImageServicesource ↗
interface FormulaImageService

Host-owned image loader used by IMAGE.

methodload
load(source: string): Promise<void>
source: string
methodread
read(source: string): FormulaServiceCacheResult<FormulaImageResource>
source: string
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
interfaceFormulaIterationSettingssource ↗
interface FormulaIterationSettings

Per-editor calculation policy for circular formula dependencies.

propertyenabled
enabled: boolean
propertymaxChange
maxChange: number
propertymaxIterations
maxIterations: number
interfaceFormulaLanguageServicesource ↗
interface FormulaLanguageService

Synchronous cache view for host-managed language services.

propertydefaultTargetLanguage
readonly defaultTargetLanguage?: string
methoddetectLanguage
detectLanguage(text: string): FormulaLanguageServiceResult
text: string
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
methodtranslate
translate(text: string, sourceLanguage: string | undefined, targetLanguage: string): FormulaLanguageServiceResult
text: string
sourceLanguage: string | undefined
targetLanguage: string
interfaceFormulaMetadataCellReferencesource ↗
interface FormulaMetadataCellReference

Platform-neutral identity of one cell visible to formula evaluation.

propertycol
readonly col: number
propertyrow
readonly row: number
propertysheetName
readonly sheetName?: string
interfaceFormulaMetadataReadersource ↗
interface FormulaMetadataReader

Host-owned, synchronous metadata projection consumed during formula evaluation.

methodreadCell
readCell(reference: FormulaMetadataCellReference): FormulaCellMetadata | undefined
reference: FormulaMetadataCellReference
methodreadEnvironment
readEnvironment(): FormulaEnvironmentMetadata | undefined
methodreadWorkbook
readWorkbook(): FormulaWorkbookMetadata | undefined
interfaceFormulaPhoneticReadersource ↗
interface FormulaPhoneticReader

Reads persisted phonetic text without coupling formulas to a cell schema.

methodgetCellPhonetic
getCellPhonetic(row: number, col: number): string | undefined
row: number
col: number
methodgetWorkbookCellPhonetic
getWorkbookCellPhonetic(sheetName: string, row: number, col: number): string | undefined
sheetName: string
row: number
col: number
interfaceFormulaPivotDataQuerysource ↗
interface FormulaPivotDataQuery

Query passed to a host-owned pivot data provider.

propertydataField
readonly dataField: string
propertyfilters
readonly filters: readonly { field: string; item: string }[]
propertypivotReference
readonly pivotReference: string
interfaceFormulaPivotDataServicesource ↗
interface FormulaPivotDataService

Host service used by GETPIVOTDATA.

methodgetData
getData(query: FormulaPivotDataQuery): FormulaValue
query: FormulaPivotDataQuery
interfaceFormulaRangeCellsource ↗
interface FormulaRangeCell

One range cell with optional visibility and source metadata.

propertycol
readonly col: number
propertyfiltered
readonly filtered?: boolean
propertyformulaName
readonly formulaName?: string
propertyhidden
readonly hidden?: boolean
propertyrow
readonly row: number
propertysource
readonly source?: "value" | "empty" | "formula"
propertyvalue
readonly value: FormulaValue
interfaceFormulaRangeMovesource ↗
interface FormulaRangeMove

Inclusive source bounds and displacement for reference-preserving cell movement.

propertycolumnOffset
readonly columnOffset: number
propertyend
readonly end: readonly [number, number]
propertyincludeUnqualified
readonly includeUnqualified?: boolean

False when inspecting qualified references from a different sheet.

propertyrowOffset
readonly rowOffset: number
propertysheetName
readonly sheetName?: string

When supplied, qualified references to this sheet also follow the move.

propertystart
readonly start: readonly [number, number]
interfaceFormulaRecalculationCompletedEventsource ↗
interface FormulaRecalculationCompletedEvent extends FormulaCalculationTraceEventBase

Event emitted when one recalculation generation completes.

propertybatchCount
readonly batchCount: number
propertyflushedCellCount
readonly flushedCellCount: number
propertygeneration
readonly generation: number
propertypendingCount
readonly pendingCount: 0
propertysequenceinherited
readonly sequence: number
propertytype
readonly type: "formula.recalculationCompleted"
interfaceFormulaReferenceArgumentsource ↗
interface FormulaReferenceArgument

A function argument that intentionally retains reference identity.

propertykind
readonly kind: "reference"
propertyreference
readonly reference: ResolvedFormulaRange
interfaceFormulaReferenceResolutionOptionssource ↗
interface FormulaReferenceResolutionOptions

Options used when resolving text, names, or dynamic references.

propertycurrentCell
readonly currentCell?: FormulaCellPosition
propertystyle
readonly style?: FormulaReferenceStyle
interfaceFormulaReferenceResolversource ↗
interface FormulaReferenceResolver

Host-owned resolver for names and text references.

methodresolve
resolve(referenceText: string, options?: FormulaReferenceResolutionOptions): FormulaError | ResolvedFormulaRange
referenceText: string
options: FormulaReferenceResolutionOptions
interfaceFormulaReferenceValuesource ↗
interface FormulaReferenceValue

Reference identity returned by reference-preserving functions.

propertykind
readonly kind: "reference"
propertyreference
readonly reference: ResolvedFormulaRange
interfaceFormulaRegisteredAddInCallsource ↗
interface FormulaRegisteredAddInCall

Invokes a procedure previously resolved by REGISTER.ID.

propertyarguments
readonly arguments: readonly FormulaValue[]
propertykind
readonly kind: "registered"
propertyregistrationId
readonly registrationId: number
interfaceFormulaRtdKeysource ↗
interface FormulaRtdKey

Stable key used to read one RTD subscription.

propertyprogId
readonly progId: string
propertyserver
readonly server?: string
propertytopics
readonly topics: readonly string[]
interfaceFormulaRtdServicesource ↗
interface FormulaRtdService

Host-owned RTD service.

methodload
load(key: FormulaRtdKey): Promise<void>
key: FormulaRtdKey
methodread
read(key: FormulaRtdKey): FormulaServiceCacheResult<FormulaValue>
key: FormulaRtdKey
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
interfaceFormulaSheetMetadatasource ↗
interface FormulaSheetMetadata

Stable workbook sheet identity and one-based display position.

propertyid
readonly id: string
propertyindex
readonly index: number
propertyname
readonly name: string
propertyvisible
readonly visible?: boolean
interfaceFormulaStockHistoryRequestsource ↗
interface FormulaStockHistoryRequest

Normalized request key for a historical market-data lookup.

propertyendDate
readonly endDate?: number
propertyheaders
readonly headers: 0 | 1 | 2
propertyinterval
readonly interval: 0 | 1 | 2
propertyproperties
readonly properties: readonly number[]
propertystartDate
readonly startDate: number
propertystock
readonly stock: string
interfaceFormulaStockHistoryServicesource ↗
interface FormulaStockHistoryService

Synchronous view over historical market data loaded outside formula evaluation.

methodread
read(request: FormulaStockHistoryRequest): FormulaServiceCacheResult<FormulaError | FormulaValue[][]>
request: FormulaStockHistoryRequest
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
interfaceFormulaStructureMoveOptionssource ↗
interface FormulaStructureMoveOptions

Selects the reference namespace rewritten by a structure permutation.

propertyincludeUnqualified
readonly includeUnqualified?: boolean
propertysheetName
readonly sheetName?: string
interfaceFormulaTextsource ↗
interface FormulaText

Text value carrying an explicit numeric coercion policy.

propertykind
kind: "text"
propertynumericCoercion
numericCoercion: "allow" | "deny"
propertyvalue
value: string
interfaceFormulaTextLocalesource ↗
interface FormulaTextLocale

Locale-specific byte and width transforms for legacy text functions.

propertycurrencySymbol
readonly currencySymbol?: string
propertylocale
readonly locale: string
methodbyteLength
byteLength(text: string): number
text: string
methodcalculationModeLabel
calculationModeLabel(mode: "Automatic" | "Manual"): string
mode: "Automatic" | "Manual"
methodcharacterCode
characterCode(text: string): number
text: string
methodcharacterFromCode
characterFromCode(code: number): string | undefined
code: number
methodcompareText
compareText(left: string, right: string): number
left: string
right: string
methodfindByBytes
findByBytes(text: string, search: string, startByte: number, caseSensitive: boolean): number
text: string
search: string
startByte: number
caseSensitive: boolean
methodformatCurrency
formatCurrency(number: number, decimals: number): string
number: number
decimals: number
methodreplaceByBytes
replaceByBytes(text: string, startByte: number, byteLength: number, replacement: string): string
text: string
startByte: number
byteLength: number
replacement: string
methodsliceByBytes
sliceByBytes(text: string, startByte: number, byteLength: number): string
text: string
startByte: number
byteLength: number
methodtoFullWidth
toFullWidth(text: string): string
text: string
methodtoHalfWidth
toHalfWidth(text: string): string
text: string
methodtoJis
toJis(text: string): string
text: string
interfaceFormulaTupleValuesource ↗
interface FormulaTupleValue

Tuple expression preserving the identity of its items.

propertyitems
readonly items: readonly FormulaValue[]
propertykind
readonly kind: "tuple"
interfaceFormulaWebServicesource ↗
interface FormulaWebService

Synchronous view of HTTP response text loaded explicitly by the host.

methodread
read(url: string): FormulaServiceCacheResult<string | FormulaError>
url: string
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
interfaceFormulaWorkbookMetadatasource ↗
interface FormulaWorkbookMetadata

Read-only workbook facts consumed by information formulas.

propertycurrentSheetId
readonly currentSheetId?: string
propertycurrentSheetName
readonly currentSheetName?: string
propertysheets
readonly sheets: readonly FormulaSheetMetadata[]
interfaceIAggregationCachesource ↗
interface IAggregationCache

Public contract for IAggregationCache.

methodclear
clear(): void

Clears all caches.

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

Binds cache writes to the owning editor command dispatch after initialization.

isCommandExecuting: (): boolean
methodgetCount
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.

startRow: number
startCol: number
endRow: number
endCol: number
methodgetSum
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: number
Start row (0-based).
startCol: number
Start column (0-based).
endRow: number
End row (0-based).
endCol: number
End column (0-based).
methodonCellChanged
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: number
Changed row (0-based).
col: number
Changed column (0-based).
oldVal: FormulaValue
Previous value.
newVal: FormulaValue
New value.
methodonStructureChanged
onStructureChanged(): void

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.

methodsetCount
setCount(startRow: number, startCol: number, endRow: number, endCol: number, count: number): void

Stores a successfully calculated COUNT for a rectangular range.

startRow: number
startCol: number
endRow: number
endCol: number
count: number
methodsetSum
setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): void

Stores a successfully calculated SUM for a rectangular range.

startRow: number
startCol: number
endRow: number
endCol: number
sum: number
interfaceIDependencyGraphsource ↗
interface IDependencyGraph

Public contract for IDependencyGraph.

propertypendingCount
readonly pendingCount: number

Number of dirty formulas still waiting for evaluation.

propertysize
readonly size: number

Total number of formula cells currently in the graph.

methodclear
clear(): void

Clears all graph data.

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

Binds mutations to the owning editor command dispatch after initialization.

isCommandExecuting: (): boolean
methodgetDependencies
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: number
CellKey for the formula cell.
methodgetDependents
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: number
CellKey for the referenced cell.
methodgetFormulaKeys
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.

methodgetLastCycleKeys
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.

methodgetNextReadyBatch
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: Set<number>
CellKeys currently inside the viewport.
maxCount: number
Maximum number of formulas to return.
methodisDirty
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: number
CellKey for the formula to inspect.
methodmarkClean
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: number
CellKey for the formula that has finished evaluating.
methodmarkDirty
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: number[]
CellKeys for cells whose values changed.
methodonStructureChanged
onStructureChanged(changes: StructureChange[]): void

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: StructureChange[]
Structural change list.
methodremoveCell
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)

formulaKey: number
methodupdateCell
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: number
CellKey for the formula cell.
deps: Dependency[]
Range-level Dependency list used by the formula.
interfaceIFormulaCalculationTraceProvidersource ↗
interface IFormulaCalculationTraceProvider

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.

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

Subscribes to formula calculation trace events for one editor instance.

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

listener: FormulaCalculationTraceListener
Callback invoked for future calculation trace events.
interfaceIFormulaDateSystemProvidersource ↗
interface IFormulaDateSystemProvider

Editor-local source for the workbook date serial system.

methodgetDateSystem
getDateSystem(): FormulaDateSystem
interfaceIFormulaEvaluatorsource ↗
interface IFormulaEvaluator

Public contract for IFormulaEvaluator.

methodevaluate
evaluate(ast: FormulaAST, context: EvalContext): FormulaValue

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: FormulaAST
Parsed formula AST.
context: EvalContext
Evaluation context that provides cell-value reads.
methodevaluateBatch
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: FormulaAST; key: number }[]
AST list to evaluate; each item contains a CellKey and its AST.
context: EvalContext
Evaluation context.
methodregisterFunction
registerFunction(fn: FormulaFunction): void

Registers a custom function.

After registration, formulas can call the function by name. For example,
registering AVERAGE allows =AVERAGE(A1:A10).

fn: FormulaFunction
interfaceIFormulaExternalServiceProvidersource ↗
interface IFormulaExternalServiceProvider extends FormulaExternalServiceReader

Editor-owned registry used by hosts to publish services and cache invalidation.

methoddestroy
destroy(ownerToken?: object): void
ownerToken: object
methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
isCommandExecuting: (): boolean
dispatchRemoval: (id: number): void
methodenforceTeardownBoundary
enforceTeardownBoundary(ownerToken: object): void
ownerToken: object
methodgetinherited
get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefined
definition: FormulaExternalServiceDefinition<T>
methodinvalidate
invalidate<T>(definition: FormulaExternalServiceDefinition<T>): void
definition: FormulaExternalServiceDefinition<T>
methodregister
register<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): void
definition: FormulaExternalServiceDefinition<T>
service: T
methodsubscribeInvalidation
subscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): void
listener: (serviceIds: readonly string[]): void
methodunregisterRegistration
unregisterRegistration(id: number): void
id: number
interfaceIFormulaIterationSettingsProvidersource ↗
interface IFormulaIterationSettingsProvider

Optional editor-local provider for circular formula calculation.

methodgetSettings
getSettings(): FormulaIterationSettings
interfaceIFormulaLocaleProvidersource ↗
interface IFormulaLocaleProvider

Editor-local locale provider consumed by formula evaluation hosts.

methodgetDateTimeLocale
getDateTimeLocale(): FormulaDateTimeLocale

Returns the current date/time locale strategy for formula functions.

methodgetTextLocale
getTextLocale(): FormulaTextLocale

Returns the current text byte/width locale strategy for formula functions.

interfaceIFormulaParsersource ↗
interface IFormulaParser

Public contract for IFormulaParser.

methodextractDependencies
extractDependencies(ast: FormulaAST): Dependency[]

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 }
]
ast: FormulaAST
methodparse
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: string
Formula string including the leading '='.
methodshiftReferences
shiftReferences(ast: FormulaAST, changes: StructureChange[]): FormulaAST

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!).
ast: FormulaAST
changes: StructureChange[]
interfaceIFormulaResultProvidersource ↗
interface IFormulaResultProvider

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.

methodforEachFormulaResultInRange
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.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodgetFormulaResult
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: number
Row index (0-based).
col: number
Column index (0-based).
interfaceIFormulaRichResultProvidersource ↗
interface IFormulaRichResultProvider

Read-only provider for non-text visual results produced by formula cells.

methodgetFormulaRichResult
getFormulaRichResult(row: number, col: number): FormulaRichResult | undefined
row: number
col: number
interfaceIFormulaSourceProvidersource ↗
interface IFormulaSourceProvider

Read-only provider for the formula source text shown while editing.

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

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

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

row: number
col: number
interfaceIFormulaStatusProvidersource ↗
interface IFormulaStatusProvider

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.

methodgetFormulaCellStatus
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: number
Row index (0-based).
col: number
Column index (0-based).
interfaceIFormulaTextServiceProvidersource ↗
interface IFormulaTextServiceProvider

Optional editor-local providers for metadata- and service-backed text formulas.

methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void
isCommandExecuting: (): boolean
dispatchRemoval: (id: number): void
methodgetLanguageService
getLanguageService(): FormulaLanguageService | undefined
methodgetPhoneticReader
getPhoneticReader(): FormulaPhoneticReader | undefined
methodregisterLanguageService
registerLanguageService(service: FormulaLanguageService): (): void
service: FormulaLanguageService
methodregisterPhoneticReader
registerPhoneticReader(reader: FormulaPhoneticReader): (): void
reader: FormulaPhoneticReader
methodsubscribeInvalidation
subscribeInvalidation(listener: (): void): (): void
listener: (): void
methodunregisterRegistration
unregisterRegistration(id: number): void
id: number
interfaceIFunctionRegistrysource ↗
interface IFunctionRegistry

Public contract for IFunctionRegistry.

methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Requires post-initialization writes to occur during the owning editor's command dispatch.

isCommandExecuting: (): boolean
dispatchRemoval: (id: number): void
methodget
get(name: string): FormulaFunction | undefined

Gets a function definition by name.

ReturnsFunction definition, or undefined when it is not registered.

name: string
Function name, case-insensitive.
methodhas
has(name: string): boolean

Checks whether a function has been registered.

name: string
Function name, case-insensitive.
methodlist
list(): string[]

Lists all registered function names.

ReturnsFunction names in uppercase.

methodregister
register(fn: FormulaFunction): (): void

Registers a formula function.

fn: FormulaFunction
Function definition; name is stored in uppercase automatically.
methodregisterMany
registerMany(functions: readonly FormulaFunction[]): (): void

Registers a group of formula functions and publishes one combined change notification.

functions: readonly FormulaFunction[]
Function definitions in registration precedence order.
methodsubscribe
subscribe(listener: (functionNames: readonly string[]): void): (): void

Subscribes to registrations and removals that can change formula results.

listener: (functionNames: readonly string[]): void
methodunregisterRegistration
unregisterRegistration(id: number): void

Removes one tokenized registration; disposal may dispatch an owner command.

id: number
interfaceResolvedFormulaRangesource ↗
interface ResolvedFormulaRange

Concrete finite range resolved against sheet bounds.

propertyendCol
readonly endCol: number
propertyendRow
readonly endRow: number
propertysource
readonly source: FormulaRangeSource
propertystartCol
readonly startCol: number
propertystartRow
readonly startRow: number
interfaceShiftedStructureCoordinatesource ↗
interface ShiftedStructureCoordinate

Result of shifting one coordinate through structure changes.

propertydeleted
readonly deleted: boolean
propertyvalue
readonly value: number
interfaceStructureMoveChangesource ↗
interface StructureMoveChange

Formula-aware row or column move.

propertyfromIndex
fromIndex: number
propertytoIndex
toIndex: number
propertytype
type: RowMove | ColMove
typeBinaryOpsource ↗
type BinaryOp = "+" | "-" | "*" | "/" | "^" | "&" | "=" | "<>" | "<" | ">" | "<=" | ">="

Supported binary formula operators.

typeCellKeysource ↗
type CellKey = number

Numeric key encoding one cell coordinate.

typeDependencysource ↗
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.

typeErrorCodesource ↗
type ErrorCode = FormulaErrorCode

Standard Excel-compatible error code.

typeFormulaAddInCallsource ↗
type FormulaAddInCall = FormulaRegisteredAddInCall | FormulaDirectAddInCall

Supported host add-in invocation request.

typeFormulaAddInRegistrationIdsource ↗
type FormulaAddInRegistrationId = number

Stable numeric handle for one host-authorized add-in procedure.

typeFormulaArgsource ↗
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.

typeFormulaArraysource ↗
type FormulaArray = FormulaValue[][]

Rectangular two-dimensional formula result represented as nested rows.

typeFormulaASTsource ↗
type FormulaAST = { kind: typeof FormulaNodeKind.Number; 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 } | { 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.

typeFormulaCalculationTraceEventsource ↗
type FormulaCalculationTraceEvent = FormulaBatchFlushedEvent | FormulaRecalculationCompletedEvent | FormulaErrorChangedEvent | FormulaDependenciesChangedEvent

Formula calculation trace event union.

typeFormulaCalculationTraceEventPayloadsource ↗
type FormulaCalculationTraceEventPayload = conditional

Trace event payload before the provider assigns its sequence number.

typeFormulaCalculationTraceListenersource ↗
type FormulaCalculationTraceListener = (event: FormulaCalculationTraceEvent): void

Listener invoked synchronously for calculation trace events.

typeFormulaCellSourcesource ↗
type FormulaCellSource = "empty" | "value" | "formula"

Origin of a persisted cell, kept distinct from its calculated value.

typeFormulaCubeKpiPropertysource ↗
type FormulaCubeKpiProperty = typeof FormulaCubeKpiProperty[keyof typeof FormulaCubeKpiProperty]

Type contract carried by the canonical FormulaCubeKpiProperty value.

typeFormulaCubeMemberExpressionsource ↗
type FormulaCubeMemberExpression = string | FormulaCubeMemberValue | readonly FormulaCubeMemberExpression[]

Serializable member or tuple expression accepted by CUBE services.

typeFormulaCubeQuerysource ↗
type FormulaCubeQuery = { caption?: string; connection: string; kind: "kpi-member"; kpiName: string; property: FormulaCubeKpiProperty } | { caption?: string; connection: string; expression: FormulaCubeMemberExpression; kind: "member" } | { connection: string; kind: "member-property"; member: FormulaCubeMemberExpression; property: string } | { caption?: string; connection: string; kind: "ranked-member"; rank: number; set: string | FormulaCubeSetValue } | { caption?: string; connection: string; expression: string; kind: "set"; sortBy?: string; sortOrder?: number } | { kind: "set-count"; set: FormulaCubeSetValue } | { connection: string; kind: "value"; members: readonly FormulaCubeMemberExpression[] }

Serializable query handled by a host-owned CUBE service.

typeFormulaCubeResultsource ↗
type FormulaCubeResult = FormulaValue | FormulaCubeMemberValue | FormulaCubeSetValue | FormulaError

Value returned from a host-owned CUBE service.

typeFormulaDateSystemsource ↗
type FormulaDateSystem = typeof FormulaDateSystem[keyof typeof FormulaDateSystem]

Workbook date serial systems supported by formula evaluation.

typeFormulaDynamicDependencyRegistrarsource ↗
type FormulaDynamicDependencyRegistrar = (reference: ResolvedFormulaRange): void

Callback used to publish dynamic formula dependency edges.

typeFormulaErrorCodesource ↗
type FormulaErrorCode = typeof FormulaErrorCode[keyof typeof FormulaErrorCode]

Type contract carried by the canonical FormulaErrorCode value.

typeFormulaFunctionArgumentKindsource ↗
type FormulaFunctionArgumentKind = "any" | "number" | "text" | "boolean" | "cell" | "range" | "array" | "reference" | "function" | "rich"

Coarse argument kinds stable across formula-engine implementations.

typeFormulaLanguageServiceResultsource ↗
type FormulaLanguageServiceResult = FormulaServiceCacheResult<string>

Synchronous result exposed by a host-managed language-service cache.

typeFormulaNodeKindsource ↗
type FormulaNodeKind = typeof FormulaNodeKind[keyof typeof FormulaNodeKind]

Type contract carried by the canonical FormulaNodeKind value.

typeFormulaRangeSourcesource ↗
type FormulaRangeSource = { kind: typeof FormulaRangeSourceKind.CurrentSheet } | { kind: typeof FormulaRangeSourceKind.WorkbookSheet; sheetName: string }

Source owner for a resolved formula range.

typeFormulaRangeSourceKindsource ↗
type FormulaRangeSourceKind = typeof FormulaRangeSourceKind[keyof typeof FormulaRangeSourceKind]

Type contract carried by the canonical FormulaRangeSourceKind value.

typeFormulaReferenceNodesource ↗
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.

typeFormulaReferenceStylesource ↗
type FormulaReferenceStyle = "A1" | "R1C1"

Reference notation accepted by a reference resolver.

typeFormulaRichResultsource ↗
type FormulaRichResult = FormulaHyperlinkResult | FormulaImageResult

Host-neutral result projected by a formula cell renderer.

typeFormulaServiceCacheResultsource ↗
type FormulaServiceCacheResult = { status: typeof FormulaServiceCacheStatus.Ready; value: T } | { status: typeof FormulaServiceCacheStatus.Pending | typeof FormulaServiceCacheStatus.Unavailable }

Synchronous cache result; asynchronous work stays outside formula evaluation.

typeFormulaValuesource ↗
type FormulaValue = null | number | string | boolean | FormulaText | FormulaError | FormulaReferenceValue | FormulaTupleValue | FormulaCubeMemberValue | FormulaCubeSetValue | FormulaValue[]

Scalar, collection, error, or reference result produced by formulas.

typeStructureChangesource ↗
type StructureChange = StructureInsertDeleteChange | StructureMoveChange

Public contract for one formula-aware structure change.

typeStructureChangeAxissource ↗
type StructureChangeAxis = typeof StructureChangeAxis[keyof typeof StructureChangeAxis]

Type contract carried by StructureChangeAxis.

typeStructureChangeKindsource ↗
type StructureChangeKind = typeof StructureChangeKind[keyof typeof StructureChangeKind]

Type contract carried by StructureChangeKind.

typeStructureChangeTypesource ↗
type StructureChangeType = MatrixOTActionName.RowInsert | MatrixOTActionName.RowDelete | MatrixOTActionName.RowMove | MatrixOTActionName.ColInsert | MatrixOTActionName.ColDelete | MatrixOTActionName.ColMove

Matrix structure action understood by formula reference transforms.

typeUnaryOpsource ↗
type UnaryOp = "-" | "+" | "%" | "NOT"

Supported unary formula operators.

variableFormulaAddInServiceDefinitionsource ↗
FormulaAddInServiceDefinition: FormulaExternalServiceDefinition<FormulaAddInService>

Typed identity used to publish a host-specific add-in implementation.

variableFormulaBatchFlushedEventTypesource ↗
FormulaBatchFlushedEventType: "formula.batchFlushed"

Stable event id for a formula batch flush.

variableFormulaCalculationTraceEventTypesource ↗
FormulaCalculationTraceEventType: { BatchFlushed: "formula.batchFlushed"; DependenciesChanged: "formula.dependenciesChanged"; ErrorChanged: "formula.errorChanged"; RecalculationCompleted: "formula.recalculationCompleted" }

Stable formula calculation trace event ids.

variableFormulaCubeKpiPropertysource ↗
FormulaCubeKpiProperty: { KPICurrentTimeMember: 6; KPIGoal: 2; KPIStatus: 3; KPITrend: 4; KPIValue: 1; KPIWeight: 5 }

Stable CUBE KPI property identifiers.

variableFormulaCubeServiceDefinitionsource ↗
FormulaCubeServiceDefinition: FormulaExternalServiceDefinition<FormulaCubeService>

Typed identity used to publish a host-specific CUBE implementation.

variableFormulaDateSystemsource ↗
FormulaDateSystem: { Excel1900: 1900; Excel1904: 1904 }

Workbook date serial systems supported by formula evaluation.

variableFormulaDependenciesChangedEventTypesource ↗
FormulaDependenciesChangedEventType: "formula.dependenciesChanged"

Stable event id for a formula dependency transition.

variableFormulaErrorChangedEventTypesource ↗
FormulaErrorChangedEventType: "formula.errorChanged"

Stable event id for a formula error transition.

variableFormulaErrorCodesource ↗
FormulaErrorCode: { DivisionByZero: "#DIV/0!"; Name: "#NAME?"; NotAvailable: "#N/A"; NullIntersection: "#NULL!"; Number: "#NUM!"; Reference: "#REF!"; Spill: "#SPILL!"; Value: "#VALUE!" }

Canonical Excel-compatible formula error code values.

variableFormulaGoogleServiceDefinitionsource ↗
FormulaGoogleServiceDefinition: FormulaExternalServiceDefinition<FormulaGoogleService>

Host-neutral service identity shared by Google-compatible cached formulas.

variableFormulaHyperlinkServiceDefinitionsource ↗
FormulaHyperlinkServiceDefinition: FormulaExternalServiceDefinition<FormulaHyperlinkService>

Typed identity for the host hyperlink service.

variableFormulaImageServiceDefinitionsource ↗
FormulaImageServiceDefinition: FormulaExternalServiceDefinition<FormulaImageService>

Typed identity for the host image service.

variableFormulaLanguageServiceDefinitionsource ↗
FormulaLanguageServiceDefinition: FormulaExternalServiceDefinition<FormulaLanguageService>

Canonical service identity used by cached language formulas and their hosts.

variableFormulaNodeKindsource ↗
FormulaNodeKind: { Array: "array"; Binary: "binary"; Boolean: "boolean"; Call: "call"; Cell: "cell"; ColumnRange: "columnRange"; Error: "error"; Intersection: "intersection"; … }

Stable discriminants used by formula AST nodes.

variableFormulaPivotDataServiceDefinitionsource ↗
FormulaPivotDataServiceDefinition: FormulaExternalServiceDefinition<FormulaPivotDataService>

Typed identity for the host pivot-data service.

variableFormulaRangeSourceKindsource ↗
FormulaRangeSourceKind: { CurrentSheet: "currentSheet"; WorkbookSheet: "workbookSheet" }

Stable source kinds for resolved formula ranges.

variableFormulaRecalculationCompletedEventTypesource ↗
FormulaRecalculationCompletedEventType: "formula.recalculationCompleted"

Stable event id for formula recalculation completion.

variableFormulaRtdServiceDefinitionsource ↗
FormulaRtdServiceDefinition: FormulaExternalServiceDefinition<FormulaRtdService>

Typed identity for the host RTD service.

variableFormulaServiceCacheStatussource ↗
FormulaServiceCacheStatus: { Pending: "pending"; Ready: "ready"; Unavailable: "unavailable" }

Canonical states of a host-managed formula service cache.

variableFormulaStockHistoryServiceDefinitionsource ↗
FormulaStockHistoryServiceDefinition: FormulaExternalServiceDefinition<FormulaStockHistoryService>

Stable external-service identity used by STOCKHISTORY and host caches.

variableFormulaStructureChangeActionNamessource ↗
FormulaStructureChangeActionNames: readonly StructureChangeType[]

Matrix OT action names that participate in formula reference rebasing.

variableFormulaWebLimitssource ↗
FormulaWebLimits: Readonly<{ textLength: 32767; urlLength: 2048 }>

Excel limits applied independently of the host's transport/security policy.

variableFormulaWebServiceDefinitionsource ↗
FormulaWebServiceDefinition: FormulaExternalServiceDefinition<FormulaWebService>

Shared identity for WEBSERVICE cache registration and recalculation.

variableStructureChangeAxissource ↗
StructureChangeAxis: { Col: "col"; Row: "row" }

Axis affected by one formula structure change.

variableStructureChangeKindsource ↗
StructureChangeKind: { Delete: "delete"; Insert: "insert"; Move: "move" }

Semantic kind of one formula structure change.

functionassertSupportedStructureChangesource ↗
assertSupportedStructureChange(change: StructureChange): void

Validates indices on a formula structure change before rebasing.

change: StructureChange
functioncreateFormulaErrorsource ↗
createFormulaError<T>(code: T): FormulaError & { code: T }

Creates a validated serializable formula error value.

code: T
functiondefineFormulaExternalServicesource ↗
defineFormulaExternalService<T>(id: string, options?: Pick<FormulaExternalServiceDefinition<T>, "subscribeInvalidation">): FormulaExternalServiceDefinition<T>

Creates a stable external-service definition shared by hosts and plugins.

id: string
options: Pick<FormulaExternalServiceDefinition<T>, "subscribeInvalidation">
functiongetStructureChangeAxissource ↗
getStructureChangeAxis(change: StructureChange): StructureChangeAxis | undefined

Returns the axis affected by one structure change.

change: StructureChange
functiongetStructureChangeKindsource ↗
getStructureChangeKind(change: StructureChange): StructureChangeKind | undefined

Returns whether one structure change inserts, deletes, or moves coordinates.

change: StructureChange
functionisFormulaArgumentKindsource ↗
isFormulaArgumentKind<K>(arg: FormulaArgumentLike | null | undefined, ...kinds: readonly K[]): arg

Narrows a formula argument to one or more discriminant kinds.

arg: FormulaArgumentLike | null | undefined
kinds: readonly K[]
functionisFormulaErrorsource ↗
isFormulaError(value: unknown): value

Returns whether a formula value is an error value.

value: unknown
functionisFormulaErrorCodesource ↗
isFormulaErrorCode(code: unknown): code

Reports whether a runtime value is a canonical formula error code.

code: unknown
functionmapFormulaReferenceNodessource ↗
mapFormulaReferenceNodes(ast: FormulaAST, map: (node: FormulaReferenceNode): FormulaAST): FormulaAST

Traverses expression containers while preserving unchanged node identities.

ast: FormulaAST
map: (node: FormulaReferenceNode): FormulaAST
functionmatrixOperationsToStructureChangessource ↗
matrixOperationsToStructureChanges(operations: readonly OTOperation[]): StructureChange[]

Converts Matrix OT operations into formula structure changes.

operations: readonly OTOperation[]
functionmatrixOperationToStructureChangesource ↗
matrixOperationToStructureChange(operation: OTOperation): StructureChange | null

Converts one Matrix OT structure operation into a formula structure change.

operation: OTOperation
functionmoveFormulaReferencessource ↗
moveFormulaReferences(ast: FormulaAST, move: FormulaRangeMove): FormulaAST

Moves referenced identities, including absolute references, without rebasing unrelated references.

ast: FormulaAST
move: FormulaRangeMove
functionreorderFormulaReferencessource ↗
reorderFormulaReferences(ast: FormulaAST, changes: readonly StructureMoveChange[], options?: FormulaStructureMoveOptions): FormulaAST

Reorders reference identities (including absolute references) through the entire permutation.

ast: FormulaAST
changes: readonly StructureMoveChange[]
options: FormulaStructureMoveOptions
functionshiftStructureCoordinatesource ↗
shiftStructureCoordinate(input: { absolute?: boolean; axis: StructureChangeAxis; changes: readonly StructureChange[]; coordinate: number }): ShiftedStructureCoordinate

Shifts one coordinate through formula structure changes.

input: { absolute?: boolean; axis: StructureChangeAxis; changes: readonly StructureChange[]; coordinate: number }
variableFormulaCubeKpiPropertyValuesource ↗
FormulaCubeKpiPropertyValue: { KPICurrentTimeMember: 6; KPIGoal: 2; KPIStatus: 3; KPITrend: 4; KPIValue: 1; KPIWeight: 5 }

Stable CUBE KPI property identifiers.

Package

@searsuite/sear-domain-matrix

17 exports

Sparse matrix storage, structural row and column operations, dimensions, and serialization.

classColumnShapeDimensionsCSRMatrixsource ↗
class ColumnShapeDimensionsCSRMatrix extends DimensionsCSRMatrix

Specialized subclass of DimensionsCSRMatrix for tracking column widths.

constructorconstructor
ColumnShapeDimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]): ColumnShapeDimensionsCSRMatrix

Constructs a DimensionsCSRMatrix instance.

args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]
Same parameters as CSRMatrix constructor
propertyname
name: string

Stable matrix name used in diagnostics and serialized metadata.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, column: number | null[]): this

Inserts a column while omitting values equal to the configured default dimension.

targetIndex: number
column: number | null[]
methodaddIteminherited
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: number
Matrix row receiving the dimension value.
col: number
Matrix column receiving the dimension value.
value: number
Requested dimension size.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: number | null[]): this

Inserts a row while omitting values equal to the configured default dimension.

targetIndex: number
row: number | null[]
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: number): number): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: number): number
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): ColumnShapeDimensionsCSRMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): ColumnShapeDimensionsCSRMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<number>[]): ColumnShapeDimensionsCSRMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<number>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: number | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: number | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: number, 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).

callback: (value: number, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: number, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: number, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: number, col: number): void
methodfromDenseinherited
fromDense(denseArray: number | null[][]): ColumnShapeDimensionsCSRMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: number | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): number | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetDimensionLeftBoundaryByIndexinherited
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: number
The column index (0-based)
methodgetDimensionRightBoundaryByIndexinherited
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: number
The column index (0-based)
methodgetDimensionsMapinherited
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]
methodgetIteminherited
getItem(row: number, col: 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: number
The row index.
col: number
The column index.
methodgetLeftBoundaryColIndexByDimensioninherited
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: number
The cumulative dimension value to search for
methodgetRightBoundaryColIndexByDimensioninherited
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: number
The cumulative dimension value to search for
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): ColumnShapeDimensionsCSRMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: number): void

Sets the dimension fallback and removes matching entries so only overrides remain stored.

value: number
Default row height or column width returned for absent entries.
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): ColumnShapeDimensionsCSRMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): ColumnShapeDimensionsCSRMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): number[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classCSRMatrixsource ↗
class CSRMatrix<T> extends SparseMatrix<T>

A Compressed Sparse Row (CSR) matrix implementation.

constructorconstructor
CSRMatrix<T>(data?: { data: T[]; indices: number[]; indptr: number[] }, shape?: [number, number]): CSRMatrix<T>

Constructs a CSRMatrix instance.

data: { data: T[]; indices: number[]; indptr: number[] }
The data for the matrix.
shape: [number, number]
The shape of the matrix as [numRows, numCols].
propertyname
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumn
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: number
The index where the new column should be inserted.
col: T | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
col: number
The column index.
value: T
The value to add.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRow
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: number
The index at which to add the row.
row: T | null[]
The row to add.
methodclone
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedView
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetached
cloneDetached(cloneValue: (value: T): T): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: T): T
methodcloneForStaging
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumns
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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRows
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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatch
dispatch(operations: MatrixOTOperation<T>[]): CSRMatrix<T>

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<T>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: T | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: T | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStored
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).

callback: (value: T, row: number, col: number): void
methodforEachStoredInRange
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.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: T, row: number, column: number): void
methodforEachStoredInRow
forEachStoredInRow(row: number, callback: (value: T, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: T, col: number): void
methodfromDense
fromDense(denseArray: T | null[][]): CSRMatrix<T>

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: T | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): T | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetItem
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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutations
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveItem
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: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: T): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: T
The default value to return for missing elements
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumn
swapColumn(targetIndex: number, sourceIndex: number): CSRMatrix<T>

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRow
swapRow(targetIndex: number, sourceIndex: number): CSRMatrix<T>

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArray
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.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classDimensionsCSRMatrixsource ↗
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
constructorconstructor
DimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]): DimensionsCSRMatrix

Constructs a DimensionsCSRMatrix instance.

args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]
Same parameters as CSRMatrix constructor
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumn
addColumn(targetIndex: number, column: number | null[]): this

Inserts a column while omitting values equal to the configured default dimension.

targetIndex: number
column: number | null[]
methodaddItem
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: number
Matrix row receiving the dimension value.
col: number
Matrix column receiving the dimension value.
value: number
Requested dimension size.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRow
addRow(targetIndex: number, row: number | null[]): this

Inserts a row while omitting values equal to the configured default dimension.

targetIndex: number
row: number | null[]
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: number): number): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: number): number
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): DimensionsCSRMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): DimensionsCSRMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<number>[]): DimensionsCSRMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<number>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: number | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: number | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: number, 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).

callback: (value: number, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: number, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: number, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: number, col: number): void
methodfromDenseinherited
fromDense(denseArray: number | null[][]): DimensionsCSRMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: number | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): number | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetDimensionLeftBoundaryByIndex
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: number
The column index (0-based)
methodgetDimensionRightBoundaryByIndex
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: number
The column index (0-based)
methodgetDimensionsMap
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]
methodgetIteminherited
getItem(row: number, col: 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: number
The row index.
col: number
The column index.
methodgetLeftBoundaryColIndexByDimension
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: number
The cumulative dimension value to search for
methodgetRightBoundaryColIndexByDimension
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: number
The cumulative dimension value to search for
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): DimensionsCSRMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValue
setDefaultValue(value: number): void

Sets the dimension fallback and removes matching entries so only overrides remain stored.

value: number
Default row height or column width returned for absent entries.
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): DimensionsCSRMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): DimensionsCSRMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): number[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classMatrixSerializationErrorsource ↗
class MatrixSerializationError extends SearError

Error thrown when a persisted sparse matrix payload cannot be decoded.

constructorconstructor
MatrixSerializationError(code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT", message: string, details?: SearErrorDetails): MatrixSerializationError

Creates a MatrixSerializationError instance.

code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT"
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT"

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classRowShapeDimensionsCSRMatrixsource ↗
class RowShapeDimensionsCSRMatrix extends DimensionsCSRMatrix

Specialized subclass of DimensionsCSRMatrix for tracking row heights.

constructorconstructor
RowShapeDimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]): RowShapeDimensionsCSRMatrix

Constructs a DimensionsCSRMatrix instance.

args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]
Same parameters as CSRMatrix constructor
propertyname
name: string

Stable matrix name used in diagnostics and serialized metadata.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, column: number | null[]): this

Inserts a column while omitting values equal to the configured default dimension.

targetIndex: number
column: number | null[]
methodaddIteminherited
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: number
Matrix row receiving the dimension value.
col: number
Matrix column receiving the dimension value.
value: number
Requested dimension size.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: number | null[]): this

Inserts a row while omitting values equal to the configured default dimension.

targetIndex: number
row: number | null[]
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: number): number): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: number): number
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): RowShapeDimensionsCSRMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): RowShapeDimensionsCSRMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<number>[]): RowShapeDimensionsCSRMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<number>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: number | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: number | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: number, 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).

callback: (value: number, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: number, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: number, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: number, col: number): void
methodfromDenseinherited
fromDense(denseArray: number | null[][]): RowShapeDimensionsCSRMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: number | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): number | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetDimensionLeftBoundaryByIndexinherited
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: number
The column index (0-based)
methodgetDimensionRightBoundaryByIndexinherited
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: number
The column index (0-based)
methodgetDimensionsMapinherited
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]
methodgetIteminherited
getItem(row: number, col: 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: number
The row index.
col: number
The column index.
methodgetLeftBoundaryColIndexByDimensioninherited
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: number
The cumulative dimension value to search for
methodgetRightBoundaryColIndexByDimensioninherited
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: number
The cumulative dimension value to search for
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): RowShapeDimensionsCSRMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: number): void

Sets the dimension fallback and removes matching entries so only overrides remain stored.

value: number
Default row height or column width returned for absent entries.
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): RowShapeDimensionsCSRMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): RowShapeDimensionsCSRMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): number[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

interfaceISheetStatesource ↗
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(...)
};
propertycolumnSizes
columnSizes: ColumnShapeDimensionsCSRMatrix

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

propertyrowSizes
rowSizes: RowShapeDimensionsCSRMatrix

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

propertysheetData
sheetData: CSRMatrix<T>

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

interfaceMatrixMoveRangesource ↗
interface MatrixMoveRange

Inclusive bounds used by matrix range movement.

propertyend
readonly end: readonly [number, number]
propertystart
readonly start: readonly [number, number]
interfaceSerializedSparseMatrixsource ↗
interface SerializedSparseMatrix<TValue>

Sparse matrix payload used by package-level serializers.

propertydefaultValue
readonly defaultValue?: TValue

Optional sparse fallback value returned by the runtime matrix for absent entries.

propertyentries
readonly entries: readonly SerializedSparseMatrixEntry<TValue>[]

Stored non-default entries.

propertyshape
readonly shape: readonly [number, number]

Matrix shape as [rows, columns].

interfaceSerializedSparseMatrixEntrysource ↗
interface SerializedSparseMatrixEntry<TValue>

Sparse matrix entry stored independently from the runtime CSR implementation.

propertycol
readonly col: number

Zero-based column coordinate.

propertyrow
readonly row: number

Zero-based row coordinate.

propertyvalue
readonly value: TValue

Persisted value at the coordinate.

typeMatrixSerializationErrorCodesource ↗
type MatrixSerializationErrorCode = typeof MatrixSerializationErrorCode[keyof typeof MatrixSerializationErrorCode]

Machine-readable matrix serialization error code type.

variableMatrixSerializationErrorCodesource ↗
MatrixSerializationErrorCode: { invalidFormat: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT" }

Stable machine-readable error codes owned by matrix serialization helpers.

functioncreateMatrixRangeMoveOperationssource ↗
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.

matrix: CSRMatrix<T>
source: MatrixMoveRange
destination: MatrixMoveRange
mapValue: (value: NonNullable<T>, row: number, column: number): T
functioncreateMatrixRangeReorderOperationssource ↗
createMatrixRangeReorderOperations<T>(matrix: CSRMatrix<T>, range: { end: readonly [number, number]; start: readonly [number, number] }, destinationOf: (row: number): number): UpdateCellOTOperation<T | null>[]

Reorders only stored cells and clears vacated coordinates from the original snapshot.

matrix: CSRMatrix<T>
range: { end: readonly [number, number]; start: readonly [number, number] }
destinationOf: (row: number): number
functiondeserializeSparseMatrixsource ↗
deserializeSparseMatrix<TValue, TMatrix>(payload: unknown, MatrixClass: SparseMatrixFactory<TMatrix, TValue>, path: string): TMatrix

Deserializes a generic sparse matrix payload into the requested runtime matrix class.

payload: unknown
MatrixClass: SparseMatrixFactory<TMatrix, TValue>
path: string
functionhasMatrixRangeMoveConflictsource ↗
hasMatrixRangeMoveConflict<T>(matrix: CSRMatrix<T>, source: MatrixMoveRange, destination: MatrixMoveRange): boolean

Tests for explicit destination entries not already owned by the source range.

matrix: CSRMatrix<T>
source: MatrixMoveRange
destination: MatrixMoveRange
functionserializeSparseMatrixsource ↗
serializeSparseMatrix<TValue>(matrix: RuntimeSparseMatrix<TValue>): SerializedSparseMatrix<TValue>

Serializes a sparse runtime matrix without depending on CSR internals.

matrix: RuntimeSparseMatrix<TValue>
variableMatrixSerializationErrorCodeValuesource ↗
MatrixSerializationErrorCodeValue: { invalidFormat: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT" }

Stable machine-readable error codes owned by matrix serialization helpers.

Package

@searsuite/sear-domain-ot

66 exports

Operational-transformation primitives for matrices, rectangles, and rich documents.

enumMatrixOTActionNamesource ↗
enum MatrixOTActionName

Compact command keys persisted in matrix OT payloads.

enum memberColDelete
ColDelete: "cd"
enum memberColInsert
ColInsert: "ci"
enum memberColMove
ColMove: "cm"
enum memberResizeCol
ResizeCol: "rc"
enum memberResizeRow
ResizeRow: "rr"
enum memberRowDelete
RowDelete: "rd"
enum memberRowInsert
RowInsert: "ri"
enum memberRowMove
RowMove: "rm"
enum memberUpdateCell
UpdateCell: "uc"
enumOTTransformPrioritysource ↗
enum OTTransformPriority

Tie-break direction used when two concurrent operations target the same position.

enum memberLEFT
LEFT: "left"
enum memberRIGHT
RIGHT: "right"
enumRectOTActionNamesource ↗
enum RectOTActionName

Compact command keys persisted in rectangle OT payloads.

enum memberUpdateRect
UpdateRect: "ur"
enumRichDocOTActionNamesource ↗
enum RichDocOTActionName

Compact operation keys persisted in rich-document OT payloads.

enum memberNodeDelete
NodeDelete: "nd"
enum memberNodeInsert
NodeInsert: "ni"
enum memberNodeMove
NodeMove: "nm"
enum memberStringDelete
StringDelete: "sd"
enum memberStringInsert
StringInsert: "si"
enum memberUpdateAttrs
UpdateAttrs: "ua"
classBaseOTsource ↗
class BaseOT

Base class for Operational Transformation implementations.

Concrete domains provide the actual apply, append, compose, and transform
semantics while sharing validation and creation helpers here.

constructorconstructor
BaseOT(name: string): BaseOT

Constructs an OT implementation descriptor.

name: string
Stable implementation name.
propertyname
readonly name: string

Human-readable OT implementation name for diagnostics and debugging.

methodappendstatic
append(destination: OTOperation[], current: OTOperation): void

Appends one operation into a composed destination list.

ThrowsSearError until implemented by a concrete OT class.

destination: OTOperation[]
current: OTOperation
methodapplystatic
apply(snapshot: unknown, operations: OTOperation[]): void

Applies operations to a domain snapshot.

ThrowsSearError until implemented by a concrete OT class.

snapshot: unknown
operations: OTOperation[]
methodcheckValidOpstatic
checkValidOp(operations: OTOperation[]): void

Validates the structural contract common to all operations.

ThrowsSearError when an operation is missing its path.

operations: OTOperation[]
Operations that must each carry an array path.
methodcomposestatic
compose(operation1: OTOperation[], operation2: OTOperation[]): OTOperation[]

Composes two sequential operation lists into one equivalent list.

ThrowsSearError until implemented by a concrete OT class.

operation1: OTOperation[]
operation2: OTOperation[]
methodcreatestatic
create(data?: OTOperation[]): OTOperation[]

Creates an operation list snapshot.

ReturnsA mutable operation list detached from the caller's array.

data: OTOperation[]
Optional operations to clone into the new list.
methodtransformstatic
transform(operation: OTOperation[], otherOperation: OTOperation[], type: OTTransformPriority): OTOperation[]

Transforms an operation list against concurrent operations.

ThrowsSearError until implemented by a concrete OT class.

operation: OTOperation[]
otherOperation: OTOperation[]
type: OTTransformPriority
classMatrixOTsource ↗
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.

constructorconstructor
MatrixOT(): MatrixOT

Creates a MatrixOT descriptor for diagnostics and shared OT registries.

propertynameinherited
readonly name: string

Human-readable OT implementation name for diagnostics and debugging.

methodappendstatic
append<U>(destination: MatrixOTOperation<U>[], current: MatrixOTOperation<U>): void

Appends one component into a composed matrix operation list.

destination: MatrixOTOperation<U>[]
Composition destination mutated in place.
current: MatrixOTOperation<U>
Operation to append.
methodapplystatic
apply<U, S>(snapshot: S, operations: MatrixOTOperation<U>[]): S

Applies operations to a CSR matrix snapshot.

ReturnsThe same snapshot instance after mutation.

snapshot: S
Mutable CSR-backed state.
operations: MatrixOTOperation<U>[]
Matrix operations to apply.
methodcheckValidOpstaticinherited
checkValidOp(operations: OTOperation[]): void

Validates the structural contract common to all operations.

ThrowsSearError when an operation is missing its path.

operations: OTOperation[]
Operations that must each carry an array path.
methodcommonLengthForOpsstatic
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: MatrixOTOperation<U>
First operation whose parent path is compared.
operation2: MatrixOTOperation<U>
Second operation whose parent path is compared.
methodcomposestatic
compose<U>(operation1: MatrixOTOperation<U>[], operation2: MatrixOTOperation<U>[]): MatrixOTOperation<U>[]

Composes two sequential matrix operation lists.

ReturnsEquivalent composed operation list.

operation1: MatrixOTOperation<U>[]
Earlier operation list.
operation2: MatrixOTOperation<U>[]
Later operation list.
methodcreatestaticinherited
create(data?: OTOperation[]): OTOperation[]

Creates an operation list snapshot.

ReturnsA mutable operation list detached from the caller's array.

data: OTOperation[]
Optional operations to clone into the new list.
methodinvertstatic
invert<U>(operations: MatrixOTOperation<U>[]): MatrixOTOperation<U>[]

Inverts an operation list in rollback order.

ReturnsOperations that undo the input when applied in order.

operations: MatrixOTOperation<U>[]
Forward operations to invert.
methodinvertComponentstatic
invertComponent<U>(currentOperation: MatrixOTOperation<U>): MatrixOTOperation<U>

Builds the inverse of one matrix component.

ReturnsA component that restores the previous matrix state.

currentOperation: MatrixOTOperation<U>
Component to invert.
methodtransformstatic
transform<U>(operation: MatrixOTOperation<U>[], otherOperation: MatrixOTOperation<U>[], type: OTTransformPriority): MatrixOTOperation<U>[]

Transforms concurrent Matrix OT operations into a convergent pair.

operation: MatrixOTOperation<U>[]
otherOperation: MatrixOTOperation<U>[]
type: OTTransformPriority
methodtransformComponentstatic
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: MatrixOTOperation<U>[]
Output list receiving the transformed component or no-op.
currentOperation: MatrixOTOperation<U>
Operation being rebased.
otherOperation: MatrixOTOperation<U>
Concurrent operation already applied on the target branch.
type: OTTransformPriority
Tie-break side for equal-position edits.
methodtransformComponentXstatic
transformComponentX<U>(left: MatrixOTOperation<U>, right: MatrixOTOperation<U>, destLeft: MatrixOTOperation<U>[], destRight: MatrixOTOperation<U>[]): void

Transforms one Matrix OT component against another concurrent component.

left: MatrixOTOperation<U>
right: MatrixOTOperation<U>
destLeft: MatrixOTOperation<U>[]
destRight: MatrixOTOperation<U>[]
methodtransformXstatic
transformX<U>(leftOperation: MatrixOTOperation<U>[], rightOperation: MatrixOTOperation<U>[]): MatrixOTOperation<U>[][]

Transforms one Matrix OT operation against a concurrent operation.

leftOperation: MatrixOTOperation<U>[]
rightOperation: MatrixOTOperation<U>[]
classRectOTsource ↗
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.

constructorconstructor
RectOT(): RectOT

Creates a RectOT descriptor for diagnostics and shared OT registries.

propertynameinherited
readonly name: string

Human-readable OT implementation name for diagnostics and debugging.

methodappendstaticinherited
append(destination: OTOperation[], current: OTOperation): void

Appends one operation into a composed destination list.

ThrowsSearError until implemented by a concrete OT class.

destination: OTOperation[]
current: OTOperation
methodapplystatic
apply<U>(snapshot: Rect, operations: RectOTOperation[]): Rect

Applies rectangle operations to a mutable Rect snapshot.

ReturnsThe same rectangle after mutation.

snapshot: Rect
Rectangle to mutate.
operations: RectOTOperation[]
Operations to apply in order.
methodcheckValidOpstaticinherited
checkValidOp(operations: OTOperation[]): void

Validates the structural contract common to all operations.

ThrowsSearError when an operation is missing its path.

operations: OTOperation[]
Operations that must each carry an array path.
methodcomposestaticinherited
compose(operation1: OTOperation[], operation2: OTOperation[]): OTOperation[]

Composes two sequential operation lists into one equivalent list.

ThrowsSearError until implemented by a concrete OT class.

operation1: OTOperation[]
operation2: OTOperation[]
methodcreatestaticinherited
create(data?: OTOperation[]): OTOperation[]

Creates an operation list snapshot.

ReturnsA mutable operation list detached from the caller's array.

data: OTOperation[]
Optional operations to clone into the new list.
methodinvertstatic
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: RectOTOperation[]
Forward operations to invert.
beforeRect: Rect
Rectangle state before any forward operations are applied.
methodinvertComponentstatic
invertComponent(currentOperation: RectOTOperation, beforeRect?: Rect): RectOTOperation

Builds the inverse of one rectangle operation.

ReturnsAn operation that restores the previous rectangle state.

currentOperation: RectOTOperation
Operation to invert.
beforeRect: Rect
Rectangle state before the forward update operation.
methodtransformstaticinherited
transform(operation: OTOperation[], otherOperation: OTOperation[], type: OTTransformPriority): OTOperation[]

Transforms an operation list against concurrent operations.

ThrowsSearError until implemented by a concrete OT class.

operation: OTOperation[]
otherOperation: OTOperation[]
type: OTTransformPriority
classRichDocOTsource ↗
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.

constructorconstructor
RichDocOT(): RichDocOT

Creates a RichDocOT descriptor for diagnostics and shared OT registries.

propertynameinherited
readonly name: string

Human-readable OT implementation name for diagnostics and debugging.

methodappendstatic
append(destination: RichDocOTOperation[], current: RichDocOTOperation): void

Appends one rich-document operation into a composed destination list.

destination: RichDocOTOperation[]
Composition destination mutated in place.
current: RichDocOTOperation
Operation to append.
methodapplystatic
apply(snapshot: NodeSchema, operations: RichDocOTOperation[]): NodeSchema

Applies rich-document operations to a mutable node snapshot.

ReturnsThe same snapshot instance after mutation.

snapshot: NodeSchema
Root node to mutate.
operations: RichDocOTOperation[]
Operations to apply in order.
methodcheckValidOpstaticinherited
checkValidOp(operations: OTOperation[]): void

Validates the structural contract common to all operations.

ThrowsSearError when an operation is missing its path.

operations: OTOperation[]
Operations that must each carry an array path.
methodcomposestatic
compose(operation1: RichDocOTOperation[], operation2: RichDocOTOperation[]): RichDocOTOperation[]

Composes two sequential rich-document operation lists.

ReturnsEquivalent composed operation list.

operation1: RichDocOTOperation[]
Earlier operation list.
operation2: RichDocOTOperation[]
Later operation list.
methodcreatestatic
create(data?: RichDocOTOperation[]): RichDocOTOperation[]

Creates a detached rich-document operation list.

ReturnsA mutable operation list owned by the caller.

data: RichDocOTOperation[]
Optional operation list to clone.
methodinvertstatic
invert(operations: RichDocOTOperation[]): RichDocOTOperation[]

Creates the inverse operation list for a committed rich-document change.

operations: RichDocOTOperation[]
methodtransformstatic
transform(operation: RichDocOTOperation[], otherOperation: RichDocOTOperation[], type: OTTransformPriority): RichDocOTOperation[]

Transforms one rich-document operation list against concurrent operations.

ReturnsThe operation list rebased over otherOperation.

operation: RichDocOTOperation[]
Operation list being rebased.
otherOperation: RichDocOTOperation[]
Concurrent operation list already applied on the target branch.
type: OTTransformPriority
Tie-break side for equal-position edits.
classTransactionOTErrorsource ↗
class TransactionOTError extends SearError

Public error for invalid or unavailable transaction OT behavior.

constructorconstructor
TransactionOTError(code: TransactionOTErrorCode, message: string, details?: SearErrorDetails): TransactionOTError
code: TransactionOTErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: TransactionOTErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classTransactionOTRegistrysource ↗
class TransactionOTRegistry

Local registry of versioned OT families and explicit pair transformations.

constructorconstructor
TransactionOTRegistry(): TransactionOTRegistry
methoddecode
decode(id: string, version: number, payload: unknown): OTOperation[]

Decodes a wire payload through its registered family definition.

id: string
version: number
payload: unknown
methoddestroy
destroy(): void

Permanently clears the registry.

methodencode
encode<OperationType>(definition: TransactionOTDefinition<OperationType>, operations: readonly OperationType[]): OTEncodedValue

Encodes and validates one operation family payload.

definition: TransactionOTDefinition<OperationType>
operations: readonly OperationType[]
methodinvert
invert<OperationType>(definition: TransactionOTDefinition<OperationType>, operations: readonly OperationType[]): OperationType[]

Inverts operations through their family definition.

definition: TransactionOTDefinition<OperationType>
operations: readonly OperationType[]
methodregisterIndependent
registerIndependent(left: TransactionOTDefinition, right: TransactionOTDefinition): (): void

Registers two families as independent, so pair transformation is explicit identity.

left: TransactionOTDefinition
right: TransactionOTDefinition
methodregisterRelation
registerRelation<Left, Right>(relation: OTTransformRelation<Left, Right>): (): void

Registers one explicit relation. Reverse lookup uses the same implementation with swapped branches.

relation: OTTransformRelation<Left, Right>
methodregisterType
registerType<OperationType>(definition: TransactionOTDefinition<OperationType>): (): void

Registers one operation family and returns an idempotent disposer.

definition: TransactionOTDefinition<OperationType>
methodrequireType
requireType(id: string, version: number): TransactionOTDefinition

Resolves a registered operation family.

id: string
version: number
methodtransformPair
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.

leftDefinition: TransactionOTDefinition<Left>
leftOperations: readonly Left[]
rightDefinition: TransactionOTDefinition<Right>
rightOperations: readonly Right[]
priority: OTTransformPriority
interfaceDeleteColOTOperationsource ↗
interface DeleteColOTOperation<T> extends OTOperation

Deletes one column and carries the deleted column payload for inversion.

propertycd
cd: T | null[]
propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

interfaceDeleteNodeOTOperationsource ↗
interface DeleteNodeOTOperation extends OTOperation

Deletes a node and carries the removed payload for inversion.

propertynd
nd: NodeSchema

Deleted node payload.

propertyp
p: OTOperationPath

Target node path.

interfaceDeleteRowOTOperationsource ↗
interface DeleteRowOTOperation<T> extends OTOperation

Deletes one row and carries the deleted row payload for inversion.

propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

propertyrd
rd: T | null[]
interfaceDeleteStringOTOperationsource ↗
interface DeleteStringOTOperation extends OTOperation

Deletes text from a leaf text node and carries the removed string.

propertyp
p: OTOperationPath

Path ending in the string offset.

propertysd
sd: string

Deleted string payload.

interfaceInsertColOTOperationsource ↗
interface InsertColOTOperation<T> extends OTOperation

Inserts one column at the target column index.

propertyci
ci: T | null[]
propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

interfaceInsertNodeOTOperationsource ↗
interface InsertNodeOTOperation extends OTOperation

Inserts a node into a parent content array.

propertyni
ni: NodeSchema

Node payload inserted at the target path.

propertyp
p: OTOperationPath

Target insertion path.

interfaceInsertRowOTOperationsource ↗
interface InsertRowOTOperation<T> extends OTOperation

Inserts one row at the target row index.

propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

propertyri
ri: T | null[]
interfaceInsertStringOTOperationsource ↗
interface InsertStringOTOperation extends OTOperation

Inserts text into a leaf text node.

propertyp
p: OTOperationPath

Path ending in the string offset.

propertysi
si: string

String inserted at the offset.

interfaceMoveColOTOperationsource ↗
interface MoveColOTOperation<T> extends OTOperation

Exchanges the column at the path index with the column index encoded by cm.

propertycm
cm: MatrixOTOperationPath
propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

interfaceMoveNodeOTOperationsource ↗
interface MoveNodeOTOperation extends OTOperation

Moves a node within its parent content array.

propertynm
nm: [number]

Destination sibling index.

propertyp
p: OTOperationPath

Source node path.

interfaceMoveRowOTOperationsource ↗
interface MoveRowOTOperation<T> extends OTOperation

Exchanges the row at the path index with the row index encoded by rm.

propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

propertyrm
rm: MatrixOTOperationPath
interfaceOTOperationsource ↗
interface OTOperation

Minimal operation contract shared by every domain OT implementation.

propertyp
p: OTOperationPath

Path locating the operation target inside the snapshot.

interfaceOTTransformPairsource ↗
interface OTTransformPair<Left, Right>

Pair transformation result preserving both concurrent branches.

propertyleft
readonly left: Left[]
propertyright
readonly right: Right[]
interfaceOTTransformRelationsource ↗
interface OTTransformRelation<Left, Right>

Domain-specific transformation relation between two operation families.

propertyleft
readonly left: TransactionOTDefinition<Left>
propertyright
readonly right: TransactionOTDefinition<Right>
methodtransformPair
transformPair(left: readonly Left[], right: readonly Right[], priority: OTTransformPriority): OTTransformPair<Left, Right>
left: readonly Left[]
right: readonly Right[]
priority: OTTransformPriority
interfaceReplaceNodeOTOperationsource ↗
interface ReplaceNodeOTOperation extends OTOperation

Replaces one node in a content array while retaining both sides for OT inversion.

propertynd
nd: NodeSchema

Node payload removed from the target path.

propertyni
ni: NodeSchema

Node payload inserted at the target path.

propertyp
p: OTOperationPath

Target node path.

interfaceResizeColOTOperationsource ↗
interface ResizeColOTOperation extends OTOperation

Updates one column dimension in a dimension matrix.

propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

propertyrc
rc: { prev: number | null; value: number | null }
interfaceResizeRowOTOperationsource ↗
interface ResizeRowOTOperation extends OTOperation

Updates one row dimension in a dimension matrix.

propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

propertyrr
rr: { prev: number | null; value: number | null }
interfaceTransactionOTDefinitionsource ↗
interface TransactionOTDefinition<OperationType>

Stable, versioned operation family shared by history and collaboration.

propertyid
readonly id: string
propertyversion
readonly version: number
methoddecode
decode(payload: unknown): OperationType[]
payload: unknown
methodencode
encode(operations: readonly OperationType[]): OTEncodedValue
operations: readonly OperationType[]
methodinvert
invert(operations: readonly OperationType[]): OperationType[]
operations: readonly OperationType[]
methodisOperation
isOperation(operation: OTOperation): operation
operation: OTOperation
interfaceUpdateAttrsOTOperationsource ↗
interface UpdateAttrsOTOperation extends OTOperation

Updates one node attribute and carries both previous and next values.

propertyp
p: OTOperationPath

Path ending in the attribute key.

propertyua
ua: { prev: unknown; value: unknown }

New attribute value and previous attribute value.

interfaceUpdateCellOTOperationsource ↗
interface UpdateCellOTOperation<T> extends OTOperation

Updates a single cell and carries both forward and previous values.

propertyp
p: MatrixOTOperationPath

Path locating the operation target inside the snapshot.

propertyuc
uc: { intent?: "relocation"; prev: T | null; value: T | null }
interfaceUpdateRectOTOperationsource ↗
interface UpdateRectOTOperation extends OTOperation

Replaces a rectangle's two corner points.

propertyp
p: MatrixOTOperationPath

Target rectangle path or matrix coordinate path.

propertyur
ur: [Point, Point]

New rectangle range as [startPoint, endPoint].

typeMatrixCellUpdateIntentsource ↗
type MatrixCellUpdateIntent = typeof MatrixCellUpdateIntent[keyof typeof MatrixCellUpdateIntent]

Distinguishes ordinary replacement from relocation that preserves independently owned cell state.

typeMatrixOTOperationsource ↗
type MatrixOTOperation = InsertRowOTOperation<T> | DeleteRowOTOperation<T> | UpdateCellOTOperation<T> | MoveRowOTOperation<T> | InsertColOTOperation<T> | DeleteColOTOperation<T> | MoveColOTOperation<T> | ResizeRowOTOperation | ResizeColOTOperation

Every operation understood by MatrixOT and matrix-backed sheet state.

typeMatrixStructureOTOperationsource ↗
type MatrixStructureOTOperation = InsertRowOTOperation<T> | DeleteRowOTOperation<T> | MoveRowOTOperation<T> | InsertColOTOperation<T> | DeleteColOTOperation<T> | MoveColOTOperation<T>

Structural matrix operations that shift row or column coordinates.

typeOperationsource ↗
type Operation = MatrixOTOperation<unknown> | UpdateRectOTOperation | RichDocOTOperation

Built-in operation union. Third-party callers use OTOperation as their open base contract.

typeOTEncodedValuesource ↗
type OTEncodedValue = null | boolean | number | string | readonly OTEncodedValue[] | { }

JSON-compatible values accepted by collaboration transports.

typeRichDocOTOperationsource ↗
type RichDocOTOperation = InsertNodeOTOperation | DeleteNodeOTOperation | ReplaceNodeOTOperation | MoveNodeOTOperation | InsertStringOTOperation | DeleteStringOTOperation | UpdateAttrsOTOperation

Every operation understood by RichDocOT.

typeRichDocOTOperationPathsource ↗
type RichDocOTOperationPath = OTOperationPath

Path into a rich-document tree; numeric segments address content arrays and string segments address attrs.

typeTransactionOTErrorCodesource ↗
type TransactionOTErrorCode = typeof TransactionOTErrorCode[keyof typeof TransactionOTErrorCode]

Stable errors raised by transaction OT definitions and registries.

variableMatrixCellUpdateIntentsource ↗
MatrixCellUpdateIntent: { Relocation: "relocation" }

Distinguishes ordinary replacement from relocation that preserves independently owned cell state.

variableMatrixTransactionOTsource ↗
MatrixTransactionOT: TransactionOTDefinition<MatrixOTOperation<unknown>>

Built-in MatrixOT family shared by matrix-backed transaction owners.

variableMatrixTransactionOTRelationsource ↗
MatrixTransactionOTRelation: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>

Matrix-to-matrix pair transformation used by every matrix-backed owner.

variableRichDocTransactionOTsource ↗
RichDocTransactionOT: TransactionOTDefinition<RichDocOTOperation>

Built-in rich-document operation family.

variableRichDocTransactionOTRelationsource ↗
RichDocTransactionOTRelation: OTTransformRelation<RichDocOTOperation, RichDocOTOperation>

Rich-document pair transformation.

variableTransactionOTErrorCodesource ↗
TransactionOTErrorCode: { InvalidDefinition: "SEAR_TRANSACTION_OT_INVALID_DEFINITION"; InvalidPayload: "SEAR_TRANSACTION_OT_INVALID_PAYLOAD"; InvertUnsupported: "SEAR_TRANSACTION_OT_INVERT_UNSUPPORTED"; RegistryDestroyed: "SEAR_TRANSACTION_OT_REGISTRY_DESTROYED"; RelationConflict: "SEAR_TRANSACTION_OT_RELATION_CONFLICT"; RelationNotRegistered: "SEAR_TRANSACTION_OT_RELATION_NOT_REGISTERED"; TypeConflict: "SEAR_TRANSACTION_OT_TYPE_CONFLICT"; TypeNotRegistered: "SEAR_TRANSACTION_OT_TYPE_NOT_REGISTERED" }

Stable errors raised by transaction OT definitions and registries.

functioncreateBuiltinTransactionOTRegistrysource ↗
createBuiltinTransactionOTRegistry(): TransactionOTRegistry

Creates an isolated registry containing all built-in OT definitions and relations.

functioncreateDeleteColOTOperationsource ↗
createDeleteColOTOperation<T>(path: readonly number[], values: readonly T | null[]): DeleteColOTOperation<T>

Creates a semantic column-delete operation carrying the deleted values required for inversion.

path: readonly number[]
values: readonly T | null[]
functioncreateDeleteRowOTOperationsource ↗
createDeleteRowOTOperation<T>(path: readonly number[], values: readonly T | null[]): DeleteRowOTOperation<T>

Creates a semantic row-delete operation carrying the deleted values required for inversion.

path: readonly number[]
values: readonly T | null[]
functioncreateInsertColOTOperationsource ↗
createInsertColOTOperation<T>(path: readonly number[], values: readonly T | null[]): InsertColOTOperation<T>

Creates a semantic column-insert operation without changing the MatrixOT wire shape.

path: readonly number[]
values: readonly T | null[]
functioncreateInsertRowOTOperationsource ↗
createInsertRowOTOperation<T>(path: readonly number[], values: readonly T | null[]): InsertRowOTOperation<T>

Creates a semantic row-insert operation without changing the MatrixOT wire shape.

path: readonly number[]
values: readonly T | null[]
functioncreateMoveColOTOperationsource ↗
createMoveColOTOperation(path: readonly number[], destination: readonly number[]): MoveColOTOperation<unknown>

Creates a semantic column-move operation.

path: readonly number[]
destination: readonly number[]
functioncreateMoveRowOTOperationsource ↗
createMoveRowOTOperation(path: readonly number[], destination: readonly number[]): MoveRowOTOperation<unknown>

Creates a semantic row-move operation.

path: readonly number[]
destination: readonly number[]
functioncreateResizeColOTOperationsource ↗
createResizeColOTOperation(path: readonly number[], value: number | null, previousValue: number | null): ResizeColOTOperation

Creates a semantic column-resize operation.

path: readonly number[]
value: number | null
previousValue: number | null
functioncreateResizeRowOTOperationsource ↗
createResizeRowOTOperation(path: readonly number[], value: number | null, previousValue: number | null): ResizeRowOTOperation

Creates a semantic row-resize operation.

path: readonly number[]
value: number | null
previousValue: number | null
functioncreateUpdateCellOTOperationsource ↗
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.

path: readonly number[]
value: T | null
previousValue: T | null
intent: "relocation"
functioncreateUpdateRectOTOperationsource ↗
createUpdateRectOTOperation(path: readonly number[], start: readonly [number, number], end: readonly [number, number]): UpdateRectOTOperation

Creates a semantic rectangle update without changing the RectOT wire shape.

path: readonly number[]
start: readonly [number, number]
end: readonly [number, number]
functiongetAllActionNamessource ↗
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.

functionisMatrixOperationsource ↗
isMatrixOperation(operation: OTOperation): operation

Narrows an operation to any operation understood by MatrixOT.

operation: OTOperation
functionisMatrixStructureOperationsource ↗
isMatrixStructureOperation<T>(operation: OTOperation): operation

Narrows an OT operation to one of the row or column structure operations.

operation: OTOperation
functionisResizeColOperationsource ↗
isResizeColOperation(operation: OTOperation): operation

Narrows an OT operation to a column-resize operation with a present action payload.

operation: OTOperation
functionisResizeRowOperationsource ↗
isResizeRowOperation(operation: OTOperation): operation

Narrows an OT operation to a row-resize operation with a present action payload.

operation: OTOperation
functionisUpdateCellOperationsource ↗
isUpdateCellOperation<T>(operation: OTOperation): operation

Narrows an OT operation to an update-cell operation with a present action payload.

operation: OTOperation
functionOTClonesource ↗
OTClone<T>(object: T): T

Deep-clones JSON-compatible OT payloads before mutation or composition.

object: T
functiontransactionOTTypeKeysource ↗
transactionOTTypeKey(definition: Pick<TransactionOTDefinition, "id" | "version">): string

Returns the wire identity of one versioned OT family.

definition: Pick<TransactionOTDefinition, "id" | "version">
interfaceNodeSchemasource ↗
interface NodeSchema

Persisted rich-document node schema shared by document runtime, commands, and OT.

propertyattrs
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

propertycontent
content?: Schema[]

Child rich-document nodes.

propertyid
id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytext
text?: string

Optional text content for leaf text nodes.

propertytype
type: string

Domain node type identifier.

interfaceTextSchemasource ↗
interface TextSchema extends NodeSchema

Persisted text-bearing rich-document node schema.

propertyattrsinherited
attrs?: Record<string, any>

Node attributes for styles, formatting, and feature-owned metadata.

propertycontentinherited
content?: Schema[]

Child rich-document nodes.

propertyidinherited
id?: string

Stable structural identity for layout, retained render nodes, and collaboration mapping.

propertytext
text: string

Optional text content for leaf text nodes.

propertytypeinherited
type: string

Domain node type identifier.

Package

@searsuite/sear-domain-state

1 exports

Typed data ownership, field projection, and state registry contracts.

classSearStatesource ↗
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.

constructorconstructor
SearState<T>(): SearState<T>
propertyname
name: string

Stable state name used when registering state in plugin/core maps.

methodaddListener
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methoddispatch
dispatch(operations: StateOperation[]): this

Applies OT operations to this state object.

ReturnsThe current state instance for chaining.

operations: StateOperation[]
Operations owned by the concrete state implementation.
methodgetItem
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: string | number
Row or first path coordinate.
col: string | number
Column or second path coordinate.
methodremoveListener
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.

Package

@searsuite/sear-domain-transaction

5 exports

The correctly spelled public entry point for SearSuite transaction contracts.

functioncreateTransactionsource ↗
createTransaction<OperationType>(pluginKey: TransactionPluginKey, operations?: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): Transaction<OperationType>

Creates a transaction with copied operations and metadata.

pluginKey: TransactionPluginKey
operations: readonly OperationType[]
meta: Readonly<Record<string, unknown>>
classTransactionsource ↗
class Transaction<OperationType>

Transaction public API.

propertymeta
readonly meta: Record<string, unknown>

Metadata attached to Transaction.

propertyoperations
readonly operations: OperationType[]

Operations carried by Transaction.

propertypluginKey
readonly pluginKey: TransactionPluginKey

Stable plugin key for Transaction.

methodaddOperation
addOperation(operations: OperationType[]): void

Adds the operation.

operations: OperationType[]
methodgetMeta
getMeta<T>(key: string): T | undefined

Returns the meta.

key: string
methodsetMeta
setMeta(key: string, value: unknown): this

Updates the meta.

key: string
value: unknown
variableTRANSACTION_ORIGIN_META_KEYsource ↗
TRANSACTION_ORIGIN_META_KEY: "transaction:origin"

Metadata key describing where a transaction originated.

enumTransactionOriginsource ↗
enum TransactionOrigin

Stable transaction origins observed by cross-cutting runtime features.

enum memberHistory
History: "history"
enum memberLocal
Local: "local"
enum memberRemote
Remote: "remote"
interfaceTransactionPluginKeysource ↗
interface TransactionPluginKey

Stable owner key accepted by a transaction.

propertykey
readonly key: string

String identity for the plugin or state owner receiving this transaction.

Package

@searsuite/sear-domain-transation

5 exports

Legacy compatibility entry point for transaction pipelines and operation ownership.

enumTransactionOriginsource ↗
enum TransactionOrigin

Stable transaction origins observed by cross-cutting runtime features.

enum memberHistory
History: "history"
enum memberLocal
Local: "local"
enum memberRemote
Remote: "remote"
classTransactionsource ↗
class Transaction<OperationType>

Transaction public API.

propertymeta
readonly meta: Record<string, unknown>

Metadata attached to Transaction.

propertyoperations
readonly operations: OperationType[]

Operations carried by Transaction.

propertypluginKey
readonly pluginKey: TransactionPluginKey

Stable plugin key for Transaction.

methodaddOperation
addOperation(operations: OperationType[]): void

Adds the operation.

operations: OperationType[]
methodgetMeta
getMeta<T>(key: string): T | undefined

Returns the meta.

key: string
methodsetMeta
setMeta(key: string, value: unknown): this

Updates the meta.

key: string
value: unknown
interfaceTransactionPluginKeysource ↗
interface TransactionPluginKey

Stable owner key accepted by a transaction.

propertykey
readonly key: string

String identity for the plugin or state owner receiving this transaction.

variableTRANSACTION_ORIGIN_META_KEYsource ↗
TRANSACTION_ORIGIN_META_KEY: "transaction:origin"

Metadata key describing where a transaction originated.

functioncreateTransactionsource ↗
createTransaction<OperationType>(pluginKey: TransactionPluginKey, operations?: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): Transaction<OperationType>

Creates a transaction with copied operations and metadata.

pluginKey: TransactionPluginKey
operations: readonly OperationType[]
meta: Readonly<Record<string, unknown>>

Package

@searsuite/sear-domain-workbook

56 exports

Stable workbook and Sheet identities, structure, and document-state contracts.

classWorkbookErrorsource ↗
class WorkbookError extends SearError

Error thrown when workbook state or workbook references violate their domain contract.

constructorconstructor
WorkbookError(code: WorkbookErrorCode, message: string, details?: SearErrorDetails): WorkbookError

Creates a WorkbookError instance.

code: WorkbookErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: WorkbookErrorCode

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
interfaceAddWorkbookSheetInputsource ↗
interface AddWorkbookSheetInput<SheetState>

Input accepted by addWorkbookSheet.

propertyindex
readonly index?: number

Optional insertion index; defaults to appending after the current last sheet.

propertysheet
readonly sheet: WorkbookSheetDescriptor

Descriptor for the sheet being inserted.

propertysheetState
readonly sheetState: SheetState

Initial state payload for the inserted sheet.

interfaceCreateWorkbookDocumentStateInputsource ↗
interface CreateWorkbookDocumentStateInput<SheetState>

Input accepted by createWorkbookDocumentState.

propertyid
readonly id: string

Stable workbook id used by persistence and collaboration rooms.

propertymetadata
readonly metadata?: Readonly<Record<string, unknown>>

Extension-owned serializable metadata copied onto the workbook state.

propertysheets
readonly sheets: readonly WorkbookSheetDescriptor[]

Ordered sheet descriptors.

propertysheetStates
readonly sheetStates: WorkbookSheetStateMap<SheetState>

Per-sheet state payloads keyed by sheet id.

interfaceMoveWorkbookSheetInputsource ↗
interface MoveWorkbookSheetInput

Input accepted by moveWorkbookSheet.

propertysheetId
readonly sheetId: string

Sheet id to move.

propertytoIndex
readonly toIndex: number

Destination index in WorkbookDocumentState.sheets.

interfaceParsedWorkbookFormulaReferencesource ↗
interface ParsedWorkbookFormulaReference

Parsed workbook formula reference bound to a stable sheet id.

propertyrange
readonly range: WorkbookRangeReference

Normalized workbook range. Single-cell references use the same start and end coordinate.

propertysheetId
readonly sheetId: string

Stable sheet id resolved from the user-facing formula sheet name.

interfaceRemoveWorkbookSheetInputsource ↗
interface RemoveWorkbookSheetInput

Input accepted by removeWorkbookSheet.

propertysheetId
readonly sheetId: string

Sheet id to remove.

interfaceRenameWorkbookSheetInputsource ↗
interface RenameWorkbookSheetInput

Input accepted by renameWorkbookSheet.

propertyname
readonly name: string

New user-facing sheet name.

propertysheetId
readonly sheetId: string

Sheet id to rename.

interfaceSetWorkbookSheetHiddenInputsource ↗
interface SetWorkbookSheetHiddenInput

Input accepted by setWorkbookSheetHidden.

propertyhidden
readonly hidden: boolean

Whether the sheet should be hidden.

propertysheetId
readonly sheetId: string

Sheet id whose hidden flag should change.

interfaceUpdateWorkbookSheetStateInputsource ↗
interface UpdateWorkbookSheetStateInput<SheetState>

Input accepted by updateWorkbookSheetState.

propertysheetId
readonly sheetId: string

Sheet id whose state payload should be replaced.

propertysheetState
readonly sheetState: SheetState

Replacement sheet state payload.

interfaceWorkbookCellReferencesource ↗
interface WorkbookCellReference

Qualified cell reference used by workbook-level formulas and dependency graphs.

propertycol
readonly col: number

Zero-based column index.

propertyrow
readonly row: number

Zero-based row index.

propertysheetId
readonly sheetId: string

Stable sheet id containing the referenced cell.

interfaceWorkbookColumnRangeReferencesource ↗
interface WorkbookColumnRangeReference

Qualified whole-column range reference used by workbook-level formulas.

propertyendCol
readonly endCol: number

Zero-based end column index.

propertysheetId
readonly sheetId: string

Stable sheet id containing the referenced columns.

propertystartCol
readonly startCol: number

Zero-based start column index.

interfaceWorkbookDocumentStatesource ↗
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.

propertyid
readonly id: string

Stable workbook id used by persistence and collaboration rooms.

propertymetadata
readonly metadata?: Readonly<Record<string, unknown>>

Extension-owned serializable metadata that does not affect core workbook semantics.

propertysheets
readonly sheets: readonly WorkbookSheetDescriptor[]

Ordered sheet descriptors; array order is the persisted tab order.

propertysheetStates
readonly sheetStates: WorkbookSheetStateMap<SheetState>

Per-sheet state payloads keyed by stable sheet id.

interfaceWorkbookRangeReferencesource ↗
interface WorkbookRangeReference

Qualified rectangular range reference used by workbook-level formulas.

propertyend
readonly end: readonly [number, number]

Zero-based bottom-right coordinate.

propertysheetId
readonly sheetId: string

Stable sheet id containing the referenced range.

propertystart
readonly start: readonly [number, number]

Zero-based top-left coordinate.

interfaceWorkbookRowRangeReferencesource ↗
interface WorkbookRowRangeReference

Qualified whole-row range reference used by workbook-level formulas.

propertyendRow
readonly endRow: number

Zero-based end row index.

propertysheetId
readonly sheetId: string

Stable sheet id containing the referenced rows.

propertystartRow
readonly startRow: number

Zero-based start row index.

interfaceWorkbookSheetDescriptorsource ↗
interface WorkbookSheetDescriptor

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.

propertycolor
readonly color?: string

Optional UI tab color owned by the workbook host.

propertyhidden
readonly hidden?: boolean

Whether the sheet is hidden from normal tab navigation.

propertyid
readonly id: string

Stable sheet id used by workbook state, collaboration envelopes, and formula dependencies.

propertymetadata
readonly metadata?: Readonly<Record<string, unknown>>

Extension-owned serializable metadata that does not affect core workbook semantics.

propertyname
readonly name: string

Unique user-facing sheet name used when displaying formula references.

typeWorkbookCellKeysource ↗
type WorkbookCellKey = string

Serialized key for a workbook-qualified formula cell.

typeWorkbookCoordinateAxissource ↗
type WorkbookCoordinateAxis = typeof WorkbookCoordinateAxis[keyof typeof WorkbookCoordinateAxis]

Stable workbook coordinate axis-name type.

typeWorkbookErrorCodesource ↗
type WorkbookErrorCode = typeof WorkbookErrorCode[keyof typeof WorkbookErrorCode]

Machine-readable workbook error code type.

typeWorkbookFormulaReferencesource ↗
type WorkbookFormulaReference = WorkbookCellReference | WorkbookRangeReference | WorkbookColumnRangeReference | WorkbookRowRangeReference

Any workbook-qualified formula reference supported by the workbook protocol.

typeWorkbookIdsource ↗
type WorkbookId = string

Stable workbook identifier used by host-level workbook registries.

typeWorkbookReferenceDiagnosticFieldsource ↗
type WorkbookReferenceDiagnosticField = WorkbookReferenceField | templateLiteral | templateLiteral

Diagnostic field path emitted by workbook reference validation errors.

typeWorkbookReferenceFieldsource ↗
type WorkbookReferenceField = typeof WorkbookReferenceField[keyof typeof WorkbookReferenceField]

Stable workbook reference property-name type.

typeWorkbookSheetIdsource ↗
type WorkbookSheetId = string

Stable sheet identifier used inside workbook metadata and cross-sheet references.

typeWorkbookSheetStateMapsource ↗
type WorkbookSheetStateMap = Readonly<Record<WorkbookSheetId, SheetState>>

Map from workbook sheet id to the host-selected sheet state payload.

variableWorkbookCoordinateAxissource ↗
WorkbookCoordinateAxis: { col: "col"; row: "row" }

Stable coordinate axis names used by tuple-backed workbook range references.

variableWorkbookCoordinateIndexsource ↗
WorkbookCoordinateIndex: { col: 1; row: 0 }

Tuple positions for workbook range coordinates.

variableWorkbookErrorCodesource ↗
WorkbookErrorCode: { cannotHideAllSheets: "SEAR_WORKBOOK_CANNOT_HIDE_ALL_SHEETS"; cannotRemoveLastSheet: "SEAR_WORKBOOK_CANNOT_REMOVE_LAST_SHEET"; duplicateSheetId: "SEAR_WORKBOOK_DUPLICATE_SHEET_ID"; duplicateSheetName: "SEAR_WORKBOOK_DUPLICATE_SHEET_NAME"; invalidCellKey: "SEAR_WORKBOOK_INVALID_CELL_KEY"; invalidReference: "SEAR_WORKBOOK_INVALID_REFERENCE"; invalidSheetIndex: "SEAR_WORKBOOK_INVALID_SHEET_INDEX"; invalidSheetName: "SEAR_WORKBOOK_INVALID_SHEET_NAME"; … }

Stable machine-readable error codes owned by the workbook domain package.

variableWorkbookReferenceFieldsource ↗
WorkbookReferenceField: { col: "col"; end: "end"; endCol: "endCol"; endRow: "endRow"; row: "row"; sheetId: "sheetId"; start: "start"; startCol: "startCol"; … }

Stable property names used by workbook-qualified formula references.

functionaddWorkbookSheetsource ↗
addWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: AddWorkbookSheetInput<SheetState>): WorkbookDocumentState<SheetState>

Adds a sheet descriptor and its initial state payload without mutating the source workbook.

state: WorkbookDocumentState<SheetState>
input: AddWorkbookSheetInput<SheetState>
functioncreateWorkbookCellKeysource ↗
createWorkbookCellKey(reference: WorkbookCellReference): string

Creates a stable string key for a workbook-qualified cell reference.

reference: WorkbookCellReference
functioncreateWorkbookDocumentStatesource ↗
createWorkbookDocumentState<SheetState>(input: CreateWorkbookDocumentStateInput<SheetState>): WorkbookDocumentState<SheetState>

Creates a validated workbook state using array order as the sheet tab order.

input: CreateWorkbookDocumentStateInput<SheetState>
functionformatParsedWorkbookFormulaReferencesource ↗
formatParsedWorkbookFormulaReference(reference: ParsedWorkbookFormulaReference, sheets: readonly WorkbookSheetDescriptor[]): string

Formats a parsed workbook formula reference with the current user-facing sheet name.

reference: ParsedWorkbookFormulaReference
sheets: readonly WorkbookSheetDescriptor[]
functionformatWorkbookCellReferencesource ↗
formatWorkbookCellReference(reference: WorkbookCellReference, sheetName: string): string

Formats a workbook-qualified cell reference using a caller-provided sheet name.

reference: WorkbookCellReference
sheetName: string
functionformatWorkbookRangeReferencesource ↗
formatWorkbookRangeReference(reference: WorkbookRangeReference, sheetName: string): string

Formats a workbook-qualified rectangular range reference using a caller-provided sheet name.

reference: WorkbookRangeReference
sheetName: string
functiongetWorkbookSheetDescriptorsource ↗
getWorkbookSheetDescriptor<SheetState>(state: WorkbookDocumentState<SheetState>, sheetId: string): WorkbookSheetDescriptor | null

Returns the descriptor for a sheet id, or null when the sheet is absent.

state: WorkbookDocumentState<SheetState>
sheetId: string
functiongetWorkbookSheetStatesource ↗
getWorkbookSheetState<SheetState>(state: WorkbookDocumentState<SheetState>, sheetId: string): SheetState | null

Returns one sheet state payload, or null when the sheet is absent.

state: WorkbookDocumentState<SheetState>
sheetId: string
functionisValidWorkbookReferencesource ↗
isValidWorkbookReference(reference: unknown): reference

Reports whether an unknown value is any valid workbook-qualified formula reference.

reference: unknown
functionisWorkbookCellReferencesource ↗
isWorkbookCellReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified cell reference.

reference: unknown
functionisWorkbookColumnRangeReferencesource ↗
isWorkbookColumnRangeReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified whole-column range reference.

reference: unknown
functionisWorkbookRangeReferencesource ↗
isWorkbookRangeReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified rectangular range reference.

reference: unknown
functionisWorkbookRowRangeReferencesource ↗
isWorkbookRowRangeReference(reference: unknown): reference

Reports whether an unknown value is a valid workbook-qualified whole-row range reference.

reference: unknown
functionmoveWorkbookSheetsource ↗
moveWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: MoveWorkbookSheetInput): WorkbookDocumentState<SheetState>

Moves a sheet descriptor to a new tab index without mutating the source workbook.

state: WorkbookDocumentState<SheetState>
input: MoveWorkbookSheetInput
functionnormalizeWorkbookColumnRangeReferencesource ↗
normalizeWorkbookColumnRangeReference(reference: WorkbookColumnRangeReference): WorkbookColumnRangeReference

Normalizes a whole-column reference so the start column is before the end column.

reference: WorkbookColumnRangeReference
functionnormalizeWorkbookRangeReferencesource ↗
normalizeWorkbookRangeReference(reference: WorkbookRangeReference): WorkbookRangeReference

Normalizes a range reference so start is top-left and end is bottom-right.

reference: WorkbookRangeReference
functionnormalizeWorkbookRowRangeReferencesource ↗
normalizeWorkbookRowRangeReference(reference: WorkbookRowRangeReference): WorkbookRowRangeReference

Normalizes a whole-row reference so the start row is before the end row.

reference: WorkbookRowRangeReference
functionparseWorkbookCellKeysource ↗
parseWorkbookCellKey(key: string): WorkbookCellReference

Parses a string produced by createWorkbookCellKey back into a cell reference.

key: string
functionparseWorkbookFormulaReferencesource ↗
parseWorkbookFormulaReference(reference: string, sheets: readonly WorkbookSheetDescriptor[]): ParsedWorkbookFormulaReference

Parses a displayed workbook reference such as Sheet2!A1 or Sheet2!A1:B5 into a stable sheet-id range.

reference: string
sheets: readonly WorkbookSheetDescriptor[]
functionquoteWorkbookSheetNamesource ↗
quoteWorkbookSheetName(name: string): string

Returns a formula-safe display name for a workbook sheet.

name: string
functionremoveWorkbookSheetsource ↗
removeWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: RemoveWorkbookSheetInput): WorkbookDocumentState<SheetState>

Removes a sheet descriptor and its state payload without mutating the source workbook.

state: WorkbookDocumentState<SheetState>
input: RemoveWorkbookSheetInput
functionrenameWorkbookSheetsource ↗
renameWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: RenameWorkbookSheetInput): WorkbookDocumentState<SheetState>

Renames a workbook sheet without mutating the source workbook.

state: WorkbookDocumentState<SheetState>
input: RenameWorkbookSheetInput
functionsetWorkbookSheetHiddensource ↗
setWorkbookSheetHidden<SheetState>(state: WorkbookDocumentState<SheetState>, input: SetWorkbookSheetHiddenInput): WorkbookDocumentState<SheetState>

Sets the hidden flag for a sheet without mutating the source workbook.

state: WorkbookDocumentState<SheetState>
input: SetWorkbookSheetHiddenInput
functionupdateWorkbookSheetStatesource ↗
updateWorkbookSheetState<SheetState>(state: WorkbookDocumentState<SheetState>, input: UpdateWorkbookSheetStateInput<SheetState>): WorkbookDocumentState<SheetState>

Replaces one sheet state payload without mutating the source workbook.

state: WorkbookDocumentState<SheetState>
input: UpdateWorkbookSheetStateInput<SheetState>
functionvalidateWorkbookDocumentStatesource ↗
validateWorkbookDocumentState<SheetState>(state: WorkbookDocumentState<SheetState>): void

Validates the workbook structural invariants shared by commands and persistence.

state: WorkbookDocumentState<SheetState>
variableWorkbookCoordinateAxisValuesource ↗
WorkbookCoordinateAxisValue: { col: "col"; row: "row" }

Stable coordinate axis names used by tuple-backed workbook range references.

variableWorkbookErrorCodeValuesource ↗
WorkbookErrorCodeValue: { cannotHideAllSheets: "SEAR_WORKBOOK_CANNOT_HIDE_ALL_SHEETS"; cannotRemoveLastSheet: "SEAR_WORKBOOK_CANNOT_REMOVE_LAST_SHEET"; duplicateSheetId: "SEAR_WORKBOOK_DUPLICATE_SHEET_ID"; duplicateSheetName: "SEAR_WORKBOOK_DUPLICATE_SHEET_NAME"; invalidCellKey: "SEAR_WORKBOOK_INVALID_CELL_KEY"; invalidReference: "SEAR_WORKBOOK_INVALID_REFERENCE"; invalidSheetIndex: "SEAR_WORKBOOK_INVALID_SHEET_INDEX"; invalidSheetName: "SEAR_WORKBOOK_INVALID_SHEET_NAME"; … }

Stable machine-readable error codes owned by the workbook domain package.

variableWorkbookReferenceFieldValuesource ↗
WorkbookReferenceFieldValue: { col: "col"; end: "end"; endCol: "endCol"; endRow: "endRow"; row: "row"; sheetId: "sheetId"; start: "start"; startCol: "startCol"; … }

Stable property names used by workbook-qualified formula references.

Package

@searsuite/sear-foundation-common

7 exports

Small dependency-free values and contracts shared across SearSuite packages.

enumBuildInStateNamesource ↗
enum BuildInStateName

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.

enum memberCOLUMN_SHAPE_STATE
COLUMN_SHAPE_STATE: "COLUMN_SHAPE_STATE"

State managing column dimensions and visual shape properties

enum memberCORE_STATE
CORE_STATE: "CORE_STATE"

Core state managing the fundamental document structure and content

enum memberROW_SHAPE_STATE
ROW_SHAPE_STATE: "ROW_SHAPE_STATE"

State managing row dimensions and visual shape properties

enumSearDocumentTypesource ↗
enum SearDocumentType

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

enum memberSEAR_DOC
SEAR_DOC: 1

General document type (text processor)

enum memberSEAR_FLOW
SEAR_FLOW: 6

Flowchart and diagram document type

enum memberSEAR_MIND
SEAR_MIND: 5

Mind map document type for hierarchical visualization

enum memberSEAR_SHEET
SEAR_SHEET: 2

Spreadsheet document type with cell-based data

enum memberSEAR_SLIDE
SEAR_SLIDE: 4

Slide presentation document type

enum memberSEAR_TABLE
SEAR_TABLE: 3

Table document type for structured tabular data

enum memberUNKNOWN
UNKNOWN: 0

Unknown or unspecified document type

classQuadTreesource ↗
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

constructorconstructor
QuadTree<T>(rootNode: IQuadTreeNode<T>): QuadTree<T>

Creates a new QuadTree instance with a specified root node.

rootNode: IQuadTreeNode<T>
The root node defining the initial boundary and capacity.
Typically created as: new QuadTreeNode({ x: 0, y: 0, width: 800, height: 600 }, 4)
propertyroot
root: IQuadTreeNode<T>

The root node of the quadtree.

methodinsert
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: Point
The 2D coordinates where the value should be stored.
value: T
The data to associate with this point.
methodquery
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: { height: number; width: number; x: number; y: number }
The query rectangle (x, y, width, height).
methodremove
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: Point
The exact coordinates of the point to remove.
classQuadTreeNodesource ↗
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).

constructorconstructor
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: { height: number; width: number; x: number; y: number }
The rectangular area this node covers.
capacity: number
Maximum points before node subdivides (typically 4).
propertyboundary
boundary: { height: number; width: number; x: number; y: number }

The rectangular boundary of this node in 2D space.

propertycapacity
capacity: number

Maximum number of points this node can hold before subdividing.

propertydivided
divided: boolean

Flag indicating whether this node has been subdivided into children.

propertynortheast
northeast: IQuadTreeNode<T> | null

Northeast child node (upper-right quadrant).

propertynorthwest
northwest: IQuadTreeNode<T> | null

Northwest child node (upper-left quadrant).

propertypoints
points: NodeData<T>[]

Array of data points stored in this node (before subdivision).

propertysoutheast
southeast: IQuadTreeNode<T> | null

Southeast child node (lower-right quadrant).

propertysouthwest
southwest: IQuadTreeNode<T> | null

Southwest child node (lower-left quadrant).

methodcontains
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: { height: number; width: number; x: number; y: number }
The rectangle to check against.
point: Point
The point to test.
methodinsert
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: NodeData<T>
The point and value to insert.
methodintersects
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: { height: number; width: number; x: number; y: number }
First rectangle.
b: { height: number; width: number; x: number; y: number }
Second rectangle.
methodquery
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: { height: number; width: number; x: number; y: number }
The rectangular area to query.
found: NodeData<T>[]
Accumulator array (for recursion, default empty array).
methodremove
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: Point
The exact coordinates of the point to remove.
methodsubdivide
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

classSearKeysource ↗
class SearKey

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;
constructorconstructor
SearKey(key?: string): SearKey

Creates a new SearKey instance with a unique identifier.

key: string
The base name for this key (default: 'plugin').
Should be descriptive and represent the purpose of this key.
propertykey
key: string

The unique key string generated for this instance.
Format: '{baseName}#39; for the first instance, '{baseName}${count}' for subsequent ones.

functionprintNameAndVersionsource ↗
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: string
The name of the plugin or component (e.g., 'sear-editor', 'sear-table')
version: string
The version string of the plugin (e.g., '1.0.0', '2.1.5-beta')
variableCommandExecutionPhasesource ↗
CommandExecutionPhase: { Completed: "completed"; Failed: "failed"; Started: "started" }

Stable lifecycle phases emitted by Sheet, Doc, and Workbook command buses.

Package

@searsuite/sear-foundation-di

7 exports

Editor-scoped dependency injection with explicit ownership and borrowed instances.

enumScopesource ↗
enum Scope

Enumerates Scope values.

enum memberPrototype
Prototype: 1
enum memberSingleton
Singleton: 0
classContainersource ↗
class Container

Dependency container.

Composition roots create and own explicit instances. Stateful runtimes must
never share a process-wide container because resetting or rebinding one
runtime would otherwise affect every other live runtime.

constructorconstructor
Container(): Container
propertytypes
readonly types: Map<any, any>

Registered dependency tokens owned by this container.

methodaddDependency
addDependency(parent: symbol, dependency: string | symbol): void

Adds the dependency.

parent: symbol
dependency: string | symbol
methodcreateLazy
createLazy<T>(identifier: string): (): T

Creates the lazy.

identifier: string
methoddestroy
destroy(): void
methoddispose
dispose(): void
methodgetDependency
getDependency(): void

Returns the dependency.

methodgetDependencyGraphText
getDependencyGraphText(): void

Returns the dependency graph text.

methodhasBinding
hasBinding(identifier: string | symbol): boolean

Returns whether this container has an explicit local binding for an identifier.

identifier: string | symbol
methodhasSingleton
hasSingleton(identifier: string | symbol): boolean

Returns whether a singleton has already been materialized for an identifier.

identifier: string | symbol
methodregister
register<T>(identifier: Identifier<T>, clazz: Constructor<T>, scope?: Scope): void

Registers the value.

identifier: Identifier<T>
clazz: Constructor<T>
scope: Scope
methodregisterBorrowedInstance
registerBorrowedInstance<T>(identifier: Identifier<T>, instance: T): void

Binds a parent-owned instance without acquiring its teardown responsibility.

identifier: Identifier<T>
instance: T
methodregisterFactory
registerFactory<T>(identifier: Identifier<T>, factory: FactoryFunction<T>, scope?: Scope): void

Registers the factory.

identifier: Identifier<T>
factory: FactoryFunction<T>
scope: Scope
methodregisterInstance
registerInstance<T>(identifier: Identifier<T>, instance: T): void

Registers the instance.

identifier: Identifier<T>
instance: T
methodregisterTypes
registerTypes(module: symbol, types: { }): void

Registers the types.

module: symbol
types: { }
methodreset
reset(): void

Releases created resources and removes every registration from this container.

methodresolve
resolve<T>(identifier: string | symbol): T

Resolves a dependency from this container and its parent scope.

identifier: string | symbol
variableINJECT_METADATA_KEYsource ↗
INJECT_METADATA_KEY: typeof INJECT_METADATA_KEY

Metadata key storing constructor parameter injection tokens.

variableINJECTABLE_METADATA_KEYsource ↗
INJECTABLE_METADATA_KEY: typeof INJECTABLE_METADATA_KEY

Metadata key that marks a class as resolvable by the DI container.

functionInjectsource ↗
Inject(identifier: unknown): ParameterDecorator

Records the DI token that should satisfy one constructor parameter.

ReturnsParameter decorator used on constructor arguments.

identifier: unknown
Token registered in the DI container.
functionInjectablesource ↗
Injectable(): ClassDecorator

Marks a class as injectable by the DI container.

ReturnsClass decorator that records injectable metadata.

functionSingletonsource ↗
Singleton(): ClassDecorator

Marks a class as injectable and singleton-scoped.

ReturnsClass decorator that records singleton and injectable metadata.

Package

@searsuite/sear-foundation-error

2 exports

Structured public errors with stable codes and diagnostic details.

classSearErrorsource ↗
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.

constructorconstructor
SearError(message: string, details?: SearErrorDetails, options?: ErrorOptions): SearError

Creates a SearError instance.

message: string
details: SearErrorDetails
options: ErrorOptions
propertycauseinherited
cause?: unknown
propertycode
readonly code: string

Stable machine-readable identifier for this error category.

propertydetails
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreport
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
typeSearErrorDetailssource ↗
type SearErrorDetails = Readonly<Record<string, unknown>>

Machine-readable context attached to framework errors.

Package

@searsuite/sear-foundation-keymap

1 exports

Portable keyboard key values, chords, and binding contracts.

enumKeyboardKeysource ↗
enum KeyboardKey

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.

enum memberArrowDown
ArrowDown: "ArrowDown"
enum memberArrowLeft
ArrowLeft: "ArrowLeft"
enum memberArrowRight
ArrowRight: "ArrowRight"
enum memberArrowUp
ArrowUp: "ArrowUp"
enum memberBackspace
Backspace: "Backspace"
enum memberBold
Bold: "b"
enum memberDelete
Delete: "Delete"
enum memberEnd
End: "End"
enum memberEnter
Enter: "Enter"
enum memberEqual
Equal: "="
enum memberEscape
Escape: "Escape"
enum memberHome
Home: "Home"
enum memberHyphen
Hyphen: "-"
enum memberItalic
Italic: "i"
enum memberMinus
Minus: "_"
enum memberPlus
Plus: "+"
enum memberRedo
Redo: "y"
enum memberSelectAll
SelectAll: "a"
enum memberStrikethrough
Strikethrough: "x"
enum memberTab
Tab: "Tab"
enum memberToggleReference
ToggleReference: "F4"
enum memberUnderline
Underline: "u"
enum memberUndo
Undo: "z"
enum memberZero
Zero: "0"

Package

@searsuite/sear-foundation-platform

28 exports

Injectable timing, events, view geometry, identifiers, and host diagnostics.

classBrowserPlatformsource ↗
class BrowserPlatform extends Platform

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.

constructorconstructor
BrowserPlatform(): BrowserPlatform
propertysymbolstatic
readonly symbol: symbol

DI token for resolving BrowserPlatform.

methodaddEventListener
addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): void

Registers a host event listener and returns an idempotent disposer.

target: unknown
type: string
listener: (event: unknown): void
options: PlatformEventListenerOptions
methodcancelAnimationFrame
cancelAnimationFrame(handle: number): void

Cancels a previously scheduled host animation frame.

handle: number
methodclearInterval
clearInterval(handle: number): void

Cancels a repeating host timer.

handle: number
methodclearTimeout
clearTimeout(handle: number): void

Cancels a one-shot host timer.

handle: number
methodcreateId
createId(prefix?: string): string

Creates a Web-platform client/runtime identifier.

prefix: string
methodcurrentDateTime
currentDateTime(): number

Returns the host wall-clock time as Unix milliseconds.

methodnow
now(): number

Returns the host's monotonic time in milliseconds.

methodobserveResize
observeResize(target: unknown, callback: (size: { height: number; width: number }): void): (): void

Observes host-view size changes and returns an idempotent disposer.

target: unknown
callback: (size: { height: number; width: number }): void
methodqueueMicrotask
queueMicrotask(callback: (): void): void

Schedules a callback in the host microtask queue.

callback: (): void
methodreadViewOffset
readViewOffset(target: unknown): PlatformViewOffset

Reads an element's document-relative viewport offset.

target: unknown
methodrequestAnimationFrame
requestAnimationFrame(callback: PlatformFrameRequestCallback): number

Schedules a callback for the next host animation frame.

callback: PlatformFrameRequestCallback
methodsetInterval
setInterval(callback: (): void, ms: number): number

Updates the interval.

callback: (): void
ms: number
methodsetTimeout
setTimeout(callback: (): void, ms: number): number

Updates the timeout.

callback: (): void
ms: number
methodtoLowerCaseinherited
toLowerCase(value: string): string

Converts text to lowercase without consulting the host's locale.

value: string
methodwarn
warn(message: string, ...details: unknown[]): void

Reports a non-fatal diagnostic through the host warning channel.

message: string
details: unknown[]
classFileDownloadsource ↗
class FileDownload

Replaceable host capability for saving generated files.

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

Token for host composition roots that register the capability through DI.

methoddestroy
destroy(): void

Releases pending host resources, idempotently.

methoddownload
download(request: FileDownloadRequest): void

Initiates one host file save.

request: FileDownloadRequest
classHeadlessPlatformsource ↗
class HeadlessPlatform extends Platform

Platform adapter for Node and other environments without a UI surface.

constructorconstructor
HeadlessPlatform(): HeadlessPlatform
propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessPlatform.

methodaddEventListener
addEventListener(_target: unknown, _type: string, _listener: (event: unknown): void): (): void

Registers a host event listener and returns an idempotent disposer.

_target: unknown
_type: string
_listener: (event: unknown): void
methodcancelAnimationFrame
cancelAnimationFrame(handle: number): void

Cancels a previously scheduled host animation frame.

handle: number
methodclearInterval
clearInterval(handle: number): void

Cancels a repeating host timer.

handle: number
methodclearTimeout
clearTimeout(handle: number): void

Cancels a one-shot host timer.

handle: number
methodcreateId
createId(prefix?: string): string

Creates a deterministic process-local runtime identifier.

prefix: string
methodcurrentDateTime
currentDateTime(): number

Returns the host wall-clock time as Unix milliseconds.

methodnow
now(): number

Returns the host's monotonic time in milliseconds.

methodobserveResize
observeResize(_target: unknown, _callback: (size: { height: number; width: number }): void): (): void

Observes host-view size changes and returns an idempotent disposer.

_target: unknown
_callback: (size: { height: number; width: number }): void
methodqueueMicrotask
queueMicrotask(callback: (): void): void

Schedules a callback in the host microtask queue.

callback: (): void
methodreadViewOffset
readViewOffset(_target: unknown): PlatformViewOffset

Headless targets have no host-space offset.

_target: unknown
methodrequestAnimationFrame
requestAnimationFrame(callback: PlatformFrameRequestCallback): number

Schedules a callback for the next host animation frame.

callback: PlatformFrameRequestCallback
methodsetInterval
setInterval(callback: (): void, ms: number): number

Updates the interval.

callback: (): void
ms: number
methodsetTimeout
setTimeout(callback: (): void, ms: number): number

Updates the timeout.

callback: (): void
ms: number
methodtoLowerCaseinherited
toLowerCase(value: string): string

Converts text to lowercase without consulting the host's locale.

value: string
methodwarn
warn(message: string, ...details: unknown[]): void

Reports a non-fatal diagnostic through the host warning channel.

message: string
details: unknown[]
classHeadlessWebServiceClientsource ↗
class HeadlessWebServiceClient extends WebServiceClient

Node/headless fetch adapter. Hosts remain responsible for SSRF and network policy.

constructorconstructor
HeadlessWebServiceClient(): HeadlessWebServiceClient
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the editor-local web-service adapter.

methodrequest
request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>

Performs one request; callers own caching, cancellation, and invalidation.

url: string
options: WebServiceRequestOptions
classPlatformsource ↗
class Platform
constructorconstructor
Platform(): Platform
propertysymbolstatic
readonly symbol: symbol

DI token for resolving Platform.

methodaddEventListener
addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): void

Adds a platform event listener and returns its disposer.

target: unknown
type: string
listener: (event: unknown): void
options: PlatformEventListenerOptions
methodcancelAnimationFrame
cancelAnimationFrame(handle: number): void

Cancels a previously scheduled host animation frame.

handle: number
methodclearInterval
clearInterval(handle: number): void

Cancels a repeating host timer.

handle: number
methodclearTimeout
clearTimeout(handle: number): void

Cancels a one-shot host timer.

handle: number
methodcreateId
createId(prefix?: string): string

Creates a process- or session-unique identifier for runtime protocols.

prefix: string
methodcurrentDateTime
currentDateTime(): number

Returns the host wall-clock time as Unix milliseconds.

methodnow
now(): number

Returns the host's monotonic time in milliseconds.

methodobserveResize
observeResize(target: unknown, callback: (size: { height: number; width: number }): void): (): void

Observes the CSS-pixel size of a platform render target.

target: unknown
callback: (size: { height: number; width: number }): void
methodqueueMicrotask
queueMicrotask(callback: (): void): void

Schedules a callback in the host microtask queue.

callback: (): void
methodreadViewOffset
readViewOffset(target: unknown): PlatformViewOffset

Reads a render target's offset in host view coordinates.

target: unknown
methodrequestAnimationFrame
requestAnimationFrame(callback: PlatformFrameRequestCallback): number

Schedules a callback for the next host animation frame.

callback: PlatformFrameRequestCallback
methodsetInterval
setInterval(callback: (): void, ms: number): number

Updates the interval.

callback: (): void
ms: number
methodsetTimeout
setTimeout(callback: (): void, ms: number): number

Updates the timeout.

callback: (): void
ms: number
methodtoLowerCase
toLowerCase(value: string): string

Converts text to lowercase without consulting the host's locale.

value: string
methodwarn
warn(message: string, ...details: unknown[]): void

Reports a non-fatal platform warning.

message: string
details: unknown[]
classUnavailableFileDownloadsource ↗
class UnavailableFileDownload extends FileDownload

Explicit fallback for hosts that do not provide file saving.

constructorconstructor
UnavailableFileDownload(): UnavailableFileDownload
propertysymbolstaticinherited
readonly symbol: typeof symbol

Token for host composition roots that register the capability through DI.

methoddestroy
destroy(): void

Releases pending host resources, idempotently.

methoddownload
download(_request: FileDownloadRequest): void

Initiates one host file save.

_request: FileDownloadRequest
classWebFetchServiceClientsource ↗
class WebFetchServiceClient extends WebServiceClient

Browser fetch adapter. CORS and host security policy remain browser-owned concerns.

constructorconstructor
WebFetchServiceClient(): WebFetchServiceClient
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the editor-local web-service adapter.

methodrequest
request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>

Performs one request; callers own caching, cancellation, and invalidation.

url: string
options: WebServiceRequestOptions
classWebFileDownloadsource ↗
class WebFileDownload extends FileDownload

Web file-save adapter; native elements and object URLs never enter the neutral contract.

constructorconstructor
WebFileDownload(platform: Platform): WebFileDownload

Receives the owning host's timer adapter explicitly.

platform: Platform
propertysymbolstaticinherited
readonly symbol: typeof symbol

Token for host composition roots that register the capability through DI.

methoddestroy
destroy(): void

Cancels pending release callbacks and revokes every retained object URL.

methoddownload
download(request: FileDownloadRequest): void

Initiates a native file save and tracks its delayed resource release.

request: FileDownloadRequest
classWebServiceClientsource ↗
class WebServiceClient

Platform-neutral asynchronous HTTP boundary for service-backed formulas.

constructorconstructor
WebServiceClient(): WebServiceClient
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the editor-local web-service adapter.

methodrequest
request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>

Performs one request; callers own caching, cancellation, and invalidation.

url: string
options: WebServiceRequestOptions
classWebServiceErrorsource ↗
class WebServiceError extends SearError

Public error raised by a web-service adapter.

constructorconstructor
WebServiceError(message: string, details?: Readonly<Record<string, unknown>>): WebServiceError
message: string
details: Readonly<Record<string, unknown>>
propertycauseinherited
cause?: unknown
propertycode
readonly code: "WEB_SERVICE_REQUEST_FAILED"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classWebXmlXPathEvaluatorsource ↗
class WebXmlXPathEvaluator extends XmlXPathEvaluator

Browser-native XML/XPath adapter backed by DOMParser and XPathEvaluator.

constructorconstructor
WebXmlXPathEvaluator(): WebXmlXPathEvaluator
propertysymbolstatic
readonly symbol: symbol

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

methodevaluateinherited
evaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluation

Evaluates an XPath expression against one XML document.

xml: string
xpath: string
options: XmlXPathOptions
classXmlXPathErrorsource ↗
class XmlXPathError extends SearError

Public failure raised by XML/XPath adapters.

constructorconstructor
XmlXPathError(code: XmlXPathErrorCode, message: string, details?: Readonly<Record<string, unknown>>): XmlXPathError
code: XmlXPathErrorCode
message: string
details: Readonly<Record<string, unknown>>
propertycauseinherited
cause?: unknown
propertycodeinherited
readonly code: XmlXPathErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classXmlXPathEvaluatorsource ↗
class XmlXPathEvaluator

Platform-neutral XML/XPath execution boundary used by formula adapters.

constructorconstructor
XmlXPathEvaluator(): XmlXPathEvaluator
propertysymbolstatic
readonly symbol: symbol

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

methodevaluate
evaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluation

Evaluates an XPath expression against one XML document.

xml: string
xpath: string
options: XmlXPathOptions
interfaceFileDownloadRequestsource ↗
interface FileDownloadRequest

Host-neutral request to save an in-memory file.

propertydata
readonly data: string | Uint8Array<ArrayBufferLike>

Text or binary file contents.

propertymediaType
readonly mediaType: string

File media type.

propertyname
readonly name: string

Suggested file name.

interfacePlatformEventListenerOptionssource ↗
interface PlatformEventListenerOptions

Event-routing options supported by host adapters.

propertycapture
readonly capture?: boolean

Receives propagated events before target handlers can consume them.

interfacePlatformViewOffsetsource ↗
interface PlatformViewOffset
propertyx
readonly x: number
propertyy
readonly y: number
interfaceWebServiceCancellationsource ↗
interface WebServiceCancellation

Host-neutral request cancellation.

propertycancelled
readonly cancelled: boolean
methodsubscribe
subscribe(listener: (): void): (): void
listener: (): void
interfaceWebServiceRequestOptionssource ↗
interface WebServiceRequestOptions
propertycancellation
readonly cancellation?: WebServiceCancellation
propertyheaders
readonly headers?: Readonly<Record<string, string>>
interfaceWebServiceResponsesource ↗
interface WebServiceResponse

Fully consumed response; platform-native response objects never escape an adapter.

propertyok
readonly ok: boolean
propertystatus
readonly status: number
propertytext
readonly text: string
interfaceXmlXPathEvaluationsource ↗
interface XmlXPathEvaluation

Result values in document order; selected nodes contribute their string values.

propertyvalues
readonly values: readonly string[]
interfaceXmlXPathOptionssource ↗
interface XmlXPathOptions

Explicit prefix bindings used by an XPath expression.

propertynamespaces
readonly namespaces?: Readonly<Record<string, string>>
typePlatformFrameRequestCallbacksource ↗
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.

typeWebServiceErrorCodesource ↗
type WebServiceErrorCode = typeof WebServiceErrorCode[keyof typeof WebServiceErrorCode]
typeXmlXPathErrorCodesource ↗
type XmlXPathErrorCode = typeof XmlXPathErrorCode[keyof typeof XmlXPathErrorCode]
variablePlatformEventNamesource ↗
PlatformEventName: { Click: "click"; MouseDown: "mousedown"; MouseMove: "mousemove"; MouseUp: "mouseup" }

Canonical event names understood by platform event adapters.

variableWebServiceErrorCodesource ↗
WebServiceErrorCode: { RequestFailed: "WEB_SERVICE_REQUEST_FAILED" }
variableXmlXPathErrorCodesource ↗
XmlXPathErrorCode: { InvalidXml: "XML_INVALID"; InvalidXPath: "XPATH_INVALID"; UnsupportedResult: "XPATH_UNSUPPORTED_RESULT" }
functionisHttpWebServiceUrlsource ↗
isHttpWebServiceUrl(url: string): boolean

Validates absolute HTTP(S) URL syntax without enforcing host-owned network access policy.

url: string

Package

@searsuite/sear-foundation-range

1 exports

Range primitives and normalization helpers used by Sheet and Doc domains.

classRangesource ↗
class Range

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.

constructorconstructor
Range(range: string): Range

Constructs a range from an A1-style string.

range: string
Range string in the form A1:B2.
memberrange
range: unknown
membershape
shape: unknown
methodcontains
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: number
One-based column coordinate.
y: number
One-based row coordinate.
methodtoString
toString(): string

Serializes the range back to A1 notation.

methodcolumnToNumberstatic
columnToNumber(column: string): number

Converts an Excel-style column label to a one-based column number.

ReturnsOne-based column number.

column: string
Column label such as A or AA.
methodnumberToColumnstatic
numberToColumn(number: number): string

Converts a one-based column number to an Excel-style label.

ReturnsColumn label such as A or AA.

number: number
One-based column number.

Package

@searsuite/sear-foundation-rect

10 exports

Immutable rectangle geometry and intersection utilities.

classPositionRectsource ↗
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.

constructorconstructor
PositionRect<T>(x: number, y: number, width: number, height: number): PositionRect<T>

Creates a positioned rectangle from its origin and size.

x: number
Horizontal origin.
y: number
Vertical origin.
width: number
Rectangle width.
height: number
Rectangle height.
propertyheight
readonly height: number

The rectangle height measured from y.

propertykey
key: T | undefined

Optional external identifier associated with this rectangle.

propertywidth
readonly width: number

The rectangle width measured from x.

propertyx
x: number

Horizontal origin of the rectangle.

propertyy
y: number

Vertical origin of the rectangle.

methodgetBounds
getBounds(): [number, number, number, number]

Returns rectangle bounds as [left, right, top, bottom].

methodgetPosition
getPosition(): [number, number]

Returns the rectangle origin as [x, y].

methodgetSize
getSize(): [number, number]

Returns the rectangle size as [width, height].

methodinRect
inRect(x: number, y: number): boolean

Checks whether a point lies inside the rectangle, including its edges.

x: number
Horizontal coordinate to test.
y: number
Vertical coordinate to test.
methodtoJSON
toJSON(): { height: number; key: T | undefined; width: number; x: number; y: number }

Serializes the rectangle and its optional key to a plain object.

methodupdatePosition
updatePosition(newX: number, newY: number): void

Moves the rectangle without changing its size.

newX: number
New horizontal origin.
newY: number
New vertical origin.
methodhasDominantAxisSpanstatic
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: PositionRect<U>
The first rectangle.
positionRect2: PositionRect<U>
The second rectangle.
methodintersectionstatic
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: PositionRect<U>
The first rectangle.
positionRect2: PositionRect<U>
The second rectangle.
methodmergestatic
merge<U>(rect1: PositionRect<U>, rect2: PositionRect<U>): PositionRect<U>

Creates the smallest rectangle that covers both inputs.

rect1: PositionRect<U>
The first rectangle.
rect2: PositionRect<U>
The second rectangle.
classPositionRectManagersource ↗
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.

constructorconstructor
PositionRectManager<PositionRectKeyType>(): PositionRectManager<PositionRectKeyType>

Creates a PositionRectManager instance.

memberlength
length: unknown
methodaddPositionRect
addPositionRect(positionRect: PositionRect<PositionRectKeyType>): void

Registers a rectangle with the manager.

positionRect: PositionRect<PositionRectKeyType>
Rectangle instance to track.
methodupdatePosition
updatePosition(newX: number, newY: number): void

Moves every managed rectangle to the same new origin.

newX: number
New horizontal origin.
newY: number
New vertical origin.
classRangeRectsource ↗
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.

constructorconstructor
RangeRect<T>(rect: [number, number, number, number], value: T): RangeRect<T>

Creates a range/value pair.

rect: [number, number, number, number]
Rectangle coordinates as [startRow, endRow, startCol, endCol].
value: T
Value associated with every cell inside the rectangle.
propertyrect
rect: [number, number, number, number]

Inclusive rectangle bounds encoded as
[startRow, endRow, startCol, endCol].

propertyvalue
value: T

Value returned for every cell covered by the range.

membershape
shape: unknown
methodaddCol
addCol(colIndex: number): this

Extends the range to the right when a column is inserted inside it.

colIndex: number
Inserted column index.
methodaddRow
addRow(rowIndex: number): this

Extends the range downward when a row is inserted inside the current span.

rowIndex: number
Inserted row index.
methodclone
clone(): RangeRect<T>

Creates an independent copy of this value and its mutable data.

methodforEach
forEach(callbackfn: (rowIndex: number, colIndex: number, value: T): void): void

Iterates through every covered cell and yields the stored value.

callbackfn: (rowIndex: number, colIndex: number, value: T): void
Called once for each covered cell.
methodgetValue
getValue(rowIndex: number, colIndex: number): T | null

Returns the stored value when the requested cell lies inside the range.

rowIndex: number
Row index to query.
colIndex: number
Column index to query.
methodremoveCol
removeCol(colIndex: number): this

Contracts the range when a column is removed from inside it.

colIndex: number
Removed column index.
methodremoveRow
removeRow(rowIndex: number): this

Contracts the range when a row is removed from inside the current span.

rowIndex: number
Removed row index.
methodtoJSON
toJSON(): { rect: [number, number, number, number]; value: T }

Serializes the range and its associated value.

classRangeRectManagersource ↗
class RangeRectManager<T>

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.

constructorconstructor
RangeRectManager<T>(): RangeRectManager<T>
memberlength
length: unknown
methodaddRange
addRange(range: RangeRect<T>): void

Adds a range to the manager.

range: RangeRect<T>
Range definition to register.
methodgetValue
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: number
Row index to query.
col: number
Column index to query.
methodtoJSON
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.

classRectsource ↗
class Rect

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.

constructorconstructor
Rect(rect?: [Point, Point]): Rect

Creates a rectangle from two corner points.

rect: [Point, Point]
The rectangle bounds as [[startRow, startCol], [endRow, endCol]].
membershape
shape: unknown
memberEmptystatic
Empty: unknown
methodaddCol
addCol(colIndex: number): this

Expands or shifts the rectangle after a column insertion.

colIndex: number
The inserted column index.
methodaddRow
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: number
The inserted row index.
methodclone
clone(): Rect

Creates an independent copy of this value and its mutable data.

methodforEach
forEach(callbackfn: (rowIndex: number, colIndex: number): void): void

Iterates through every cell coordinate covered by the rectangle.

callbackfn: (rowIndex: number, colIndex: number): void
Called once for each (rowIndex, colIndex) pair.
methodgetPoint
getPoint(index: 0 | 1): Point

Returns one of the stored corner points.

index: 0 | 1
0 for the start point, 1 for the end point.
methodlockMutations
lockMutations(): void

Prevents changes through methods or coordinates retained from a committed state.

methodremoveCol
removeCol(colIndex: number): this

Shrinks or shifts the rectangle after a column removal.

colIndex: number
The removed column index.
methodremoveRow
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: number
The removed row index.
methodtoJSON
toJSON(): { rect: [Point, Point] }

Serializes the rectangle to a plain object.

methodupdate
update(rect: [Point, Point]): Rect

Replaces the rectangle with a new set of bounds.

rect: [Point, Point]
The new rectangle coordinates.
methodcontainsstatic
contains(rectA: Rect, rectB: Rect): boolean

Checks whether rectA fully contains rectB.

rectA: Rect
The outer candidate rectangle.
rectB: Rect
The inner candidate rectangle.
methodfindBoundingRectanglestatic
findBoundingRectangle(rects: Rect[]): Rect

Computes the smallest rectangle that encloses all provided rectangles.

rects: Rect[]
The rectangles to merge into a bounding box.
interfacePositionRectPropssource ↗
interface PositionRectProps

Plain-object shape of a rectangle in pixel or layout coordinates.

propertyheight
height: number
propertywidth
width: number
propertyx
x: number
propertyy
y: number
typePointsource ↗
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.

variableemptyPositionRectsource ↗
emptyPositionRect: PositionRectProps

Zero-sized rectangle used as the default empty layout region.

functioncreateEmptyRectsource ↗
createEmptyRect(): Rect

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.

functioncreateEmptyRectShapesource ↗
createEmptyRectShape(): [Point, Point]

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.

Package

@searsuite/sear-foundation-storage

4 exports

Abstract key-value storage contracts and in-memory adapters.

classDataStoragesource ↗
class DataStorage<U, T, S>

DataStorage public API.

constructorconstructor
DataStorage<U, T, S>(storage: S): DataStorage<U, T, S>

Creates a DataStorage instance.

storage: S
propertysymbolstatic
readonly symbol: symbol

DI token for resolving DataStorage.

methoddelete
delete(key: U): void

Deletes the requested entry.

key: U
methodget
get(key: U): T | undefined

Returns the value.

key: U
methodset
set(key: U, value: T): void

Updates the value.

key: U
value: T
classDataStorageFactorysource ↗
class DataStorageFactory<T>

Factory contract for creating data storage instances.

constructorconstructor
DataStorageFactory<T>(): DataStorageFactory<T>
methodcreate
create(): T

Creates the value.

classMapDataStoragesource ↗
class MapDataStorage<U, T> extends DataStorage<U, T, Map<U, T>>

Map-backed DataStorage implementation.

constructorconstructor
MapDataStorage<U, T>(): MapDataStorage<U, T>

Creates a MapDataStorage instance.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving DataStorage.

methoddelete
delete(key: U): void

Deletes the requested entry.

key: U
methodget
get(key: U): T | undefined

Returns the value.

key: U
methodset
set(key: U, value: T): void

Updates the value.

key: U
value: T
classMapDataStorageFactorysource ↗
class MapDataStorageFactory<U, T> extends DataStorageFactory<MapDataStorage<U, T>>

MapDataStorageFactory public API.

constructorconstructor
MapDataStorageFactory<U, T>(): MapDataStorageFactory<U, T>
methodcreate
create(): MapDataStorage<U, T>

Creates the value.

Package

@searsuite/sear-foundation-subscription

14 exports

Idempotent subscription ownership and reverse-order disposal utilities.

classObservationErrorsource ↗
class ObservationError extends SearError

Public error raised when an observation definition or registry lifecycle contract is violated.

constructorconstructor
ObservationError(code: ObservationErrorCode, message: string, details?: SearErrorDetails): ObservationError

Creates an observation contract error with structured diagnostic details.

code: ObservationErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: ObservationErrorCode

Stable observation-specific error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classObservationRegistrysource ↗
class ObservationRegistry

Editor-local typed observation registry exposed to plugins and third-party hosts.

constructorconstructor
ObservationRegistry(platform?: Platform): ObservationRegistry

Creates a registry that reports isolated host listener failures through the platform.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

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

methoddestroy
destroy(): void

Disposes every active host subscription and removes all registered sources.

methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void, runListener?: ObservationListenerScope, detachValue?: (value: unknown, definition: ObservationDefinition<unknown>): unknown): void

Requires editor command dispatch for source registration changes after assembly.

assertWrite: (): void
runListener: ObservationListenerScope
detachValue: (value: unknown, definition: ObservationDefinition<unknown>): unknown
methodgetRegisteredObservations
getRegisteredObservations(): readonly ObservationDefinition<unknown>[]

Returns a stable snapshot of registered observation definitions sorted by id.

methodgetSnapshot
getSnapshot<Value>(definition: StateObservationDefinition<Value>): Value

Returns the current snapshot for a state observation without subscribing.

definition: StateObservationDefinition<Value>
methodhas
has(definition: string | ObservationDefinition<unknown>): boolean

Returns whether an observation id is registered in this editor instance.

definition: string | ObservationDefinition<unknown>
methodregister
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.

definition: EventObservationDefinition<Value>
source: ObservationSource<Value>
methodsubscribe
subscribe<Value>(definition: ObservationDefinition<Value>, listener: (value: Value): void): (): void

Subscribes to a typed observation and returns an idempotent disposer.

definition: ObservationDefinition<Value>
listener: (value: Value): void
classSubscriptionManagersource ↗
class SubscriptionManager

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.

constructorconstructor
SubscriptionManager(platform: Platform): SubscriptionManager

Creates a SubscriptionManager instance.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SubscriptionManager.

methoddestroy
destroy(): void

Releases resources owned by SubscriptionManager.

methodobserveResize
observeResize(target: unknown, callback: (size: { height: number; width: number }): void): (): void

Observes host-view size changes and returns an idempotent disposer.

target: unknown
callback: (size: { height: number; width: number }): void
methodtrack
track(dispose: (): void): (): void

Tracks an arbitrary subscription cleanup function and returns an idempotent disposer.

dispose: (): void
interfaceEventObservationDefinitionsource ↗
interface EventObservationDefinition<Value> extends ObservationDefinition<Value>

Definition for an event-only observation stream.

propertyidinherited
readonly id: string

Stable globally unique id used for registration diagnostics.

propertykind
readonly kind: "event"

Event observations have no current snapshot.

propertyvalueTypeinherited
readonly valueType?: Value

Compile-time value carrier; never populated at runtime.

interfaceObservationDefinitionsource ↗
interface ObservationDefinition<Value>

Typed identity imported by publishers and consumers of one observation.

propertyid
readonly id: string

Stable globally unique id used for registration diagnostics.

propertykind
readonly kind: ObservationKind

Delivery model that determines whether a current snapshot is available.

propertyvalueType
readonly valueType?: Value

Compile-time value carrier; never populated at runtime.

interfaceObservationSourcesource ↗
interface ObservationSource<Value>

Produces future values for an event or state observation.

methodsubscribe
subscribe(listener: (value: Value): void): (): void

Registers a listener for future values and returns an idempotent disposer.

listener: (value: Value): void
interfaceStateObservationDefinitionsource ↗
interface StateObservationDefinition<Value> extends ObservationDefinition<Value>

Definition for an observation stream backed by a current state snapshot.

propertyidinherited
readonly id: string

Stable globally unique id used for registration diagnostics.

propertykind
readonly kind: "state"

State observations expose a current snapshot.

propertyvalueTypeinherited
readonly valueType?: Value

Compile-time value carrier; never populated at runtime.

interfaceStateObservationSourcesource ↗
interface StateObservationSource<Value> extends ObservationSource<Value>

Produces a current snapshot plus future values for a state observation.

methodgetSnapshot
getSnapshot(): Value

Returns the current immutable state snapshot.

methodsubscribeinherited
subscribe(listener: (value: Value): void): (): void

Registers a listener for future values and returns an idempotent disposer.

listener: (value: Value): void
typeObservationErrorCodesource ↗
type ObservationErrorCode = typeof ObservationErrorCode[keyof typeof ObservationErrorCode]

Machine-readable observation error code.

typeObservationKindsource ↗
type ObservationKind = typeof ObservationKind[keyof typeof ObservationKind]

Supported observation delivery models.

variableObservationErrorCodesource ↗
ObservationErrorCode: { AlreadyRegistered: "SEAR_OBSERVATION_ALREADY_REGISTERED"; DefinitionMismatch: "SEAR_OBSERVATION_DEFINITION_MISMATCH"; InvalidDefinition: "SEAR_OBSERVATION_INVALID_DEFINITION"; NotRegistered: "SEAR_OBSERVATION_NOT_REGISTERED"; RegistryDestroyed: "SEAR_OBSERVATION_REGISTRY_DESTROYED"; SnapshotUnavailable: "SEAR_OBSERVATION_SNAPSHOT_UNAVAILABLE" }

Stable machine-readable error codes for the observation extension surface.

variableObservationKindsource ↗
ObservationKind: { Event: "event"; State: "state" }

Distinguishes snapshot-backed state observations from event-only streams.

functiondefineEventObservationsource ↗
defineEventObservation<Value>(id: string): EventObservationDefinition<Value>

Creates a typed identity for an event-only observation stream.

id: string
functiondefineStateObservationsource ↗
defineStateObservation<Value>(id: string): StateObservationDefinition<Value>

Creates a typed identity for a snapshot-backed state observation stream.

id: string

Package

@searsuite/sear-foundation-theme

0 exports

Typed theme tokens and editor-local theme access.

Package

@searsuite/sear-foundation-user-interaction

3 exports

Portable interaction-state contracts for host input and editor behavior.

classUserInteractionServicesource ↗
class UserInteractionService

Host-provided, editor-local requests for a user's decision.

constructorconstructor
UserInteractionService(): UserInteractionService
propertysymbolstatic
readonly symbol: symbol
methodconfirm
confirm(request: UserConfirmationRequest): Promise<boolean>

Resolves true only when the user explicitly confirms.

request: UserConfirmationRequest
methoddestroy
destroy(): void

Cancels pending requests and releases host resources.

classWebUserInteractionServicesource ↗
class WebUserInteractionService extends UserInteractionService

Browser dialog adapter for explicit user confirmations.

constructorconstructor
WebUserInteractionService(documentRef?: Pick<Document, "body" | "createElement">): WebUserInteractionService
documentRef: Pick<Document, "body" | "createElement">
propertysymbolstaticinherited
readonly symbol: symbol
methodconfirm
confirm(request: UserConfirmationRequest): Promise<boolean>

Resolves true only when the user explicitly confirms.

request: UserConfirmationRequest
methoddestroy
destroy(): void

Cancels pending requests and releases host resources.

interfaceUserConfirmationRequestsource ↗
interface UserConfirmationRequest

A host-owned confirmation with explicit, localizable presentation text.

propertycancelLabel
readonly cancelLabel: string
propertyconfirmLabel
readonly confirmLabel: string
propertymessage
readonly message: string
propertytitle
readonly title: string

Package

@searsuite/sear-foundation-utils

13 exports

General-purpose algorithms and guards without editor-domain ownership.

typeHexColorsource ↗
type HexColor = templateLiteral

Type contract for HexColor.

variableStandardColorsource ↗
StandardColor: { Black: "#000000" }

Standard opaque colors shared by renderers and host adapters.

functioncolumnIndexToLabelsource ↗
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'
columnIndex: number
functioncolumnLabelToIndexsource ↗
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
label: string
functionerfsource ↗
erf(value: number): number

Evaluates erf without the error floor of short polynomial approximations.

value: number
functionerfcsource ↗
erfc(value: number): number

Evaluates erfc directly in the positive tail to preserve small probabilities.

value: number
functiongetRandomColorsource ↗
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.

functionisFormulaErrorsource ↗
isFormulaError<T>(value: T): value

Type guard for formula error-shaped values.

value: T
functionisFormulaTextsource ↗
isFormulaText<T>(value: T): value

Returns whether a value carries text-specific formula coercion semantics.

value: T
functionisNumbersource ↗
isNumber(value: unknown): value

Returns whether a value is a JavaScript number.

value: unknown
functionreleaseColorsource ↗
releaseColor(color: templateLiteral): boolean

Release a color back to the available pool

color: templateLiteral
functiontoNumberOrErrorsource ↗
toNumberOrError(value: unknown): number | { code: "#VALUE!"; kind: "error" }

Converts a value for scalar arithmetic, returning an Excel #VALUE! error when invalid.

value: unknown
functiontoNumberOrZerosource ↗
toNumberOrZero(value: unknown): number

Converts a formula value for aggregate functions; non-numeric values are 0.

value: unknown

Package

@searsuite/sear-plugin-alignment

28 exports

Sheet horizontal and vertical alignment state, commands, rendering projections, and persistence.

classAlignmentMatrixsource ↗
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.

constructorconstructor
AlignmentMatrix(data?: AlignmentMatrixData, shape?: [number, number]): AlignmentMatrix

Creates an alignment matrix and compacts explicit left-alignment entries.

data: AlignmentMatrixData
Optional serialized CSR entries from persisted state.
shape: [number, number]
Declared row and column count; empty cells resolve to left alignment.
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

propertydefaultAlignmentstatic
readonly defaultAlignment: Left

Default horizontal alignment returned for cells without an explicit override.

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: string | null[]): AlignmentMatrix

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: number
The index where the new column should be inserted.
col: string | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
Zero-based row receiving the override.
col: number
Zero-based column receiving the override.
value: string
Requested horizontal alignment.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: string | null[]): AlignmentMatrix

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: number
The index at which to add the row.
row: string | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: string): string): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: string): string
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): AlignmentMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): AlignmentMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<string>[]): AlignmentMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<string>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: string | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: string | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: string, 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).

callback: (value: string, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: string, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: string, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: string, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: string, col: number): void
methodfromDenseinherited
fromDense(denseArray: string | null[][]): AlignmentMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: string | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): string | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): string | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): AlignmentMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: string): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: string
The default value to return for missing elements
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): AlignmentMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): AlignmentMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): string[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetAlignmentPluginsource ↗
class SheetAlignmentPlugin extends Plugin<unknown, CellProperties, SheetAlignmentPluginState>

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.

constructorconstructor
SheetAlignmentPlugin(state: SheetAlignmentPluginState): SheetAlignmentPlugin

Constructs the alignment plugin.

state: SheetAlignmentPluginState
Shared alignment state.
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetAlignmentPluginState, SheetAlignmentPluginState>

SheetAlignmentPlugin owns the persisted alignment export module.

propertyinterestedIn
interestedIn: string[]

Alignment reacts to direct cell updates and sheet-structure changes.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Alignment transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Alignment data is state-only; duplicate render/event depth diagnostics do not apply.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetAlignmentPluginState, SheetAlignmentPluginState>

Document-state export contribution for persisted cell alignments.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all alignment plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the alignment plugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: SheetAlignmentPluginState, transaction: Transaction): SheetAlignmentPluginState | null

Applies alignment operations to the alignment matrix.

ReturnsUpdated plugin state, or null when the transaction has no relevant operations.

pluginState: SheetAlignmentPluginState
Current alignment state.
transaction: Transaction
Transaction containing direct or derived MatrixOT-compatible operations.
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Alignment data has no render-time configuration.

methodgetStateinherited
getState(): SheetAlignmentPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetAlignmentPluginState): void

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

state: SheetAlignmentPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

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

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

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

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetAlignmentPluginState, 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.

state: SheetAlignmentPluginState
transaction: Transaction
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): void

Contributes horizontal alignment to the shared Sheet cell visual pipeline.

registry: SheetCellVisualReaderRegistry
context: SheetCellVisualReaderRegistrationContext
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the horizontal alignment command owned by this plugin.

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

Registers default configuration values owned by this plugin.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

registry: SheetFormatTransferRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): AlignmentMatrix; viewKey: string }[] }; key: PluginKey; state: SheetAlignmentPluginState }

Registers alignment state for commands, projections, and collaboration.

methodrender
render(): Node<CellProperties>[]

Alignment data does not render scene nodes directly.

ReturnsAn empty node list.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: SheetAlignmentPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetAlignmentPluginState
commitToken: object
classSheetVerticalAlignmentPluginsource ↗
class SheetVerticalAlignmentPlugin extends Plugin<unknown, CellProperties, SheetVerticalAlignmentPluginState>

Plugin that owns vertical cell alignment data, commands, and structural projections.

constructorconstructor
SheetVerticalAlignmentPlugin(state: SheetVerticalAlignmentPluginState): SheetVerticalAlignmentPlugin

Constructs the vertical alignment plugin around a shared sparse matrix.

state: SheetVerticalAlignmentPluginState
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetVerticalAlignmentPluginState, SheetVerticalAlignmentPluginState>

SheetVerticalAlignmentPlugin owns its persisted export module.

propertyinterestedIn
interestedIn: string[]

Vertical alignment follows direct updates and all sheet structure changes.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Vertical alignment transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Alignment state is data-only and does not use render-depth diagnostics.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetVerticalAlignmentPluginState, SheetVerticalAlignmentPluginState>

Document-state export contribution for persisted vertical alignments.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all vertical alignment plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the vertical alignment plugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: SheetVerticalAlignmentPluginState, transaction: Transaction): SheetVerticalAlignmentPluginState | null

Applies direct vertical alignment and structural matrix operations.

pluginState: SheetVerticalAlignmentPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Vertical alignment data has no render-time configuration.

methodgetStateinherited
getState(): SheetVerticalAlignmentPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetVerticalAlignmentPluginState): void

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

state: SheetVerticalAlignmentPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

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

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

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

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetVerticalAlignmentPluginState, 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.

state: SheetVerticalAlignmentPluginState
transaction: Transaction
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): void

Contributes vertical alignment to the shared Sheet cell visual pipeline.

registry: SheetCellVisualReaderRegistry
context: SheetCellVisualReaderRegistrationContext
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the vertical alignment command owned by this plugin.

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

Registers default configuration values owned by this plugin.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

registry: SheetFormatTransferRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): VerticalAlignmentMatrix; viewKey: string }[] }; key: PluginKey; state: SheetVerticalAlignmentPluginState }

Registers vertical alignment state for commands, projections, and collaboration.

methodrender
render(): Node<CellProperties>[]

Vertical alignment data does not render scene nodes directly.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: SheetVerticalAlignmentPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetVerticalAlignmentPluginState
commitToken: object
classVerticalAlignmentMatrixsource ↗
class VerticalAlignmentMatrix extends CSRMatrix<string>

Sparse vertical-alignment matrix whose absent cells resolve to centered alignment.

constructorconstructor
VerticalAlignmentMatrix(data?: VerticalAlignmentMatrixData, shape?: [number, number]): VerticalAlignmentMatrix

Creates a matrix and compacts explicit default-alignment entries.

data: VerticalAlignmentMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

propertydefaultAlignmentstatic
readonly defaultAlignment: Center

Default vertical alignment returned for cells without an explicit override.

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: string | null[]): VerticalAlignmentMatrix

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: number
The index where the new column should be inserted.
col: string | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
addItem(row: number, col: number, value: string): this

Stores an explicit non-default override, or removes it for centered alignment.

row: number
col: number
value: string
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: string | null[]): VerticalAlignmentMatrix

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: number
The index at which to add the row.
row: string | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: string): string): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: string): string
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): VerticalAlignmentMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): VerticalAlignmentMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<string>[]): VerticalAlignmentMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<string>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: string | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: string | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: string, 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).

callback: (value: string, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: string, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: string, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: string, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: string, col: number): void
methodfromDenseinherited
fromDense(denseArray: string | null[][]): VerticalAlignmentMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: string | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): string | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): string | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): VerticalAlignmentMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: string): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: string
The default value to return for missing elements
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): VerticalAlignmentMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): VerticalAlignmentMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): string[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

interfaceAlignmentMatrixDatasource ↗
interface AlignmentMatrixData

Serialized sparse entries accepted by AlignmentMatrix.

propertydata
data: string[]

Explicit non-default alignment values.

propertyindices
indices: number[]

CSR row pointers.

propertyindptr
indptr: number[]

CSR column indices.

interfaceSheetAlignmentPluginStatesource ↗
interface SheetAlignmentPluginState

State owned by SheetAlignmentPlugin.

propertycellAlignments
cellAlignments: AlignmentMatrix

Sparse matrix containing non-left or cell-type-derived horizontal alignment overrides.

interfaceSheetHorizontalAlignmentCommandDataSourcesource ↗
interface SheetHorizontalAlignmentCommandDataSource extends AlignmentCommandRangeDataSource

State access required by the horizontal alignment command.

propertytarget
readonly target: PluginKey
methodgetColumnCountinherited
getColumnCount(): number
methodgetRowCountinherited
getRowCount(): number
methodreadCellAlignment
readCellAlignment(row: number, column: number): SheetHorizontalAlignment | null
row: number
column: number
interfaceSheetSetRangeAlignmentInputsource ↗
interface SheetSetRangeAlignmentInput extends SheetRangeInput

Public input for setting horizontal alignment in a range.

propertyalignment
readonly alignment: SheetHorizontalAlignment
propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

interfaceSheetSetRangeVerticalAlignmentInputsource ↗
interface SheetSetRangeVerticalAlignmentInput extends SheetRangeInput

Public input for setting vertical alignment in a range.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertyverticalAlignment
readonly verticalAlignment: SheetVerticalAlignment
interfaceSheetVerticalAlignmentCommandDataSourcesource ↗
interface SheetVerticalAlignmentCommandDataSource extends AlignmentCommandRangeDataSource

State access required by the vertical alignment command.

propertytarget
readonly target: PluginKey
methodgetColumnCountinherited
getColumnCount(): number
methodgetRowCountinherited
getRowCount(): number
methodreadCellVerticalAlignment
readCellVerticalAlignment(row: number, column: number): SheetVerticalAlignment | null
row: number
column: number
interfaceSheetVerticalAlignmentPluginStatesource ↗
interface SheetVerticalAlignmentPluginState

State owned by SheetVerticalAlignmentPlugin.

propertycellVerticalAlignments
cellVerticalAlignments: VerticalAlignmentMatrix

Sparse matrix containing non-centered vertical alignment overrides.

interfaceVerticalAlignmentMatrixDatasource ↗
interface VerticalAlignmentMatrixData

Serialized sparse entries accepted by VerticalAlignmentMatrix.

propertydata
data: string[]

Explicit non-default alignment values.

propertyindices
indices: number[]

CSR row pointers.

propertyindptr
indptr: number[]

CSR column indices.

variableSetRangeAlignmentCommandsource ↗
SetRangeAlignmentCommand: SheetCommandDefinition<SheetSetRangeAlignmentInput, SheetCommandResult>

Public command for setting horizontal alignment in a range.

variableSetRangeVerticalAlignmentCommandsource ↗
SetRangeVerticalAlignmentCommand: SheetCommandDefinition<SheetSetRangeVerticalAlignmentInput, SheetCommandResult>

Public command for setting vertical alignment in a range.

variableSheetHorizontalAlignmentFieldKeysource ↗
SheetHorizontalAlignmentFieldKey: "sheet.alignment.horizontal"

DataEngine field owned by SheetAlignmentPlugin.

variableSheetVerticalAlignmentFieldKeysource ↗
SheetVerticalAlignmentFieldKey: "sheet.alignment.vertical"

DataEngine field owned by SheetVerticalAlignmentPlugin.

functioncreateSetRangeAlignmentOperationssource ↗
createSetRangeAlignmentOperations(input: SheetSetRangeAlignmentInput, dataSource: SheetHorizontalAlignmentReader): UpdateCellOTOperation<SheetHorizontalAlignment>[]

Creates sparse UpdateCell operations for horizontal alignment.

input: SheetSetRangeAlignmentInput
dataSource: SheetHorizontalAlignmentReader
functioncreateSetRangeVerticalAlignmentOperationssource ↗
createSetRangeVerticalAlignmentOperations(input: SheetSetRangeVerticalAlignmentInput, dataSource: SheetVerticalAlignmentReader): UpdateCellOTOperation<SheetVerticalAlignment>[]

Creates sparse UpdateCell operations for vertical alignment.

input: SheetSetRangeVerticalAlignmentInput
dataSource: SheetVerticalAlignmentReader
functionreadSheetCellAlignmentssource ↗
readSheetCellAlignments(dataEngine: DataEngine): AlignmentMatrix | null

Reads horizontal cell alignment published by SheetAlignmentPlugin.

dataEngine: DataEngine
functionreadSheetCellVerticalAlignmentssource ↗
readSheetCellVerticalAlignments(dataEngine: DataEngine): VerticalAlignmentMatrix | null

Reads vertical cell alignment published by SheetVerticalAlignmentPlugin.

dataEngine: DataEngine
functionregisterSheetHorizontalAlignmentCommandsource ↗
registerSheetHorizontalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetHorizontalAlignmentCommandDataSource): void

Registers the horizontal alignment command owned by SheetAlignmentPlugin.

commands: SheetCommandBus
dataSource: SheetHorizontalAlignmentCommandDataSource
functionregisterSheetVerticalAlignmentCommandsource ↗
registerSheetVerticalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetVerticalAlignmentCommandDataSource): void

Registers the vertical alignment command owned by SheetVerticalAlignmentPlugin.

commands: SheetCommandBus
dataSource: SheetVerticalAlignmentCommandDataSource
functionassertSheetHorizontalAlignmentsource ↗
assertSheetHorizontalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet horizontal alignments.

value: unknown
functionassertSheetVerticalAlignmentsource ↗
assertSheetVerticalAlignment(value: unknown): value

Asserts that a value is one of the supported Sheet vertical alignments.

value: unknown
functionisSheetHorizontalAlignmentsource ↗
isSheetHorizontalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet horizontal alignment.

value: unknown
functionisSheetVerticalAlignmentsource ↗
isSheetVerticalAlignment(value: unknown): value

Returns whether an unknown value is a supported Sheet vertical alignment.

value: unknown
enumSheetHorizontalAlignmentsource ↗
enum SheetHorizontalAlignment

Horizontal alignment values supported by the built-in Sheet alignment feature.

enum memberCenter
Center: "center"
enum memberLeft
Left: "left"
enum memberRight
Right: "right"
enumSheetVerticalAlignmentsource ↗
enum SheetVerticalAlignment

Vertical alignment values supported by the built-in Sheet alignment feature.

enum memberBottom
Bottom: "bottom"
enum memberCenter
Center: "center"
enum memberTop
Top: "top"

Package

@searsuite/sear-plugin-cell-border

20 exports

Independent Sheet cell borders, commands, rendering, history and collaboration.

classCellBorderErrorsource ↗
class CellBorderError extends SearError

Typed error for invalid border commands or document values.

constructorconstructor
CellBorderError(message: string, details?: Record<string, unknown>): CellBorderError
message: string
details: Record<string, unknown>
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_CELL_BORDER_INVALID"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classCellBorderMatrixsource ↗
class CellBorderMatrix extends CSRMatrix<SheetCellBorder | null>

Feature-owned sparse matrix; empty edge records are represented by absence.

constructorconstructor
CellBorderMatrix(data?: CellBorderMatrixData, shape?: [number, number]): CellBorderMatrix
data: CellBorderMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]): CellBorderMatrix

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: number
The index where the new column should be inserted.
col: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
column: number
value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null
The value to add.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]): CellBorderMatrix

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: number
The index at which to add the row.
row: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]
The row to add.
methodclone
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: Readonly<Partial<unknown>> | null): Readonly<Partial<Record<unknown, unknown>>> | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): CellBorderMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): CellBorderMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<Readonly<Partial<Record<unknown, unknown>>> | null>[]): CellBorderMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: Readonly<Partial<unknown>> | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: Readonly<Partial<unknown>> | null, 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).

callback: (value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: Readonly<Partial<unknown>> | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: Readonly<Partial<unknown>> | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: Readonly<Partial<Record<unknown, unknown>>> | null[][]): CellBorderMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetItem
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: number
The row index.
column: number
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): CellBorderMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): this

Stores an isolated edge record or clears its sparse entry.

row: number
column: number
value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): CellBorderMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): CellBorderMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetCellBorderPluginsource ↗
class SheetCellBorderPlugin extends Plugin<SearCoreSheet, CellProperties, SheetCellBorderPluginState>

Plugin that owns cell border data, commands, structural projections, and export.

constructorconstructor
SheetCellBorderPlugin(state: SheetCellBorderPluginState): SheetCellBorderPlugin

Constructs the plugin around its independently owned sparse border matrix.

state: SheetCellBorderPluginState
propertydepth
readonly depth: 2

Border nodes are painted after base cells and merged-cell backgrounds.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>

SheetCellBorderPlugin owns its persisted state module.

propertyinterestedIn
interestedIn: string[]

Border follows direct updates and all sheet structure changes.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Border transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Multiple extension layers may share the same depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>

Document-state export contribution for cell borders.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all cell-border plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the cell-border plugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: SheetCellBorderPluginState, transaction: Transaction): SheetCellBorderPluginState | null

Applies direct border and structural matrix operations.

pluginState: SheetCellBorderPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Cell-border data has no render-time configuration.

methodgetStateinherited
getState(): SheetCellBorderPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetCellBorderPluginState): void

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

state: SheetCellBorderPluginState
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

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

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

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

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetCellBorderPluginState, 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.

state: SheetCellBorderPluginState
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the cell-border command owned by this plugin.

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

Registers default configuration values owned by this plugin.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

registry: SheetFormatTransferRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Publishes the border owner's typed read-only queries.

queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellBorderMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellBorderPluginState }

Registers border state for commands, projections, and collaboration.

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

Contributes custom strokes without teaching the grid about border state.

core: SearCoreSheet
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: SheetCellBorderPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetCellBorderPluginState
commitToken: object
interfaceBorderLinePaintsource ↗
interface BorderLinePaint

Paint projection of one persisted border style.

propertydash
readonly dash: readonly number[]
propertydouble
readonly double?: boolean
propertyslanted
readonly slanted?: boolean
propertywidth
readonly width: number
interfaceCellBorderMatrixDatasource ↗
interface CellBorderMatrixData

Serialized sparse border entries.

propertydata
readonly data: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetBorderStrokesource ↗
interface SheetBorderStroke

One explicit persisted border stroke.

propertycolor
readonly color: string
propertystyle
readonly style: SheetBorderLineStyle
interfaceSheetCellBorderPluginStatesource ↗
interface SheetCellBorderPluginState

State owned by SheetCellBorderPlugin.

propertycellBorders
cellBorders: CellBorderMatrix

Sparse matrix containing explicit per-cell edge strokes.

interfaceSheetSetRangeCellBorderInputsource ↗
interface SheetSetRangeCellBorderInput extends SheetRangeInput

Public range-border input.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertypreset
readonly preset: SheetBorderPreset
propertystroke
readonly stroke: SheetBorderStroke
typeSheetBorderLineStylesource ↗
type SheetBorderLineStyle = typeof SheetBorderLineStyle[keyof typeof SheetBorderLineStyle]

Border line style input contract.

typeSheetBorderPresetsource ↗
type SheetBorderPreset = typeof SheetBorderPreset[keyof typeof SheetBorderPreset]

Border preset input contract.

typeSheetBorderSidesource ↗
type SheetBorderSide = typeof SheetBorderSide[keyof typeof SheetBorderSide]

Cell border edge contract.

typeSheetCellBordersource ↗
type SheetCellBorder = Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>>

Explicit edges belonging to one cell; omitted edges have no custom border.

variableBorderLinePaintsource ↗
BorderLinePaint: Readonly<Record<SheetBorderLineStyle, BorderLinePaint>>

Shared style projection used by scene nodes and host previews.

variableReadSheetCellBorderQuerysource ↗
ReadSheetCellBorderQuery: SheetQueryDefinition<{ column: number; row: number }, Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null>

Typed read of the explicit edges at one cell.

variableSetRangeCellBorderCommandsource ↗
SetRangeCellBorderCommand: SheetCommandDefinition<SheetSetRangeCellBorderInput, SheetCommandResult>

Range-border command; all neighbor changes belong to the same transaction.

variableSheetBorderLineStylesource ↗
SheetBorderLineStyle: { DashDot: "dashDot"; DashDotDot: "dashDotDot"; Dashed: "dashed"; Dotted: "dotted"; Double: "double"; Hair: "hair"; Medium: "medium"; MediumDashDot: "mediumDashDot"; … }

Persisted line styles, shared by commands, rendering and hosts.

variableSheetBorderPresetsource ↗
SheetBorderPreset: { All: "all"; Bottom: "bottom"; Horizontal: "horizontal"; Inside: "inside"; Left: "left"; None: "none"; Outside: "outside"; Right: "right"; … }

Supported border presets for an inclusive Sheet range.

variableSheetBorderSidesource ↗
SheetBorderSide: { Bottom: "bottom"; Left: "left"; Right: "right"; Top: "top" }

Canonical edge names stored in a cell border record.

variableSheetCellBorderFieldKeysource ↗
SheetCellBorderFieldKey: "sheet.cellBorder"

Stable data-view field owned by the border plugin.

functionreadSheetCellBorderssource ↗
readSheetCellBorders(dataEngine: DataEngine): CellBorderMatrix | null

Reads the border owner's projection, when that plugin is installed.

dataEngine: DataEngine

Package

@searsuite/sear-plugin-cell-editor

57 exports

Sheet cell-edit sessions, text input, selection, and embedded-editor coordination.

enumSheetCellEditorExitReasonsource ↗
enum SheetCellEditorExitReason

Enumerates SheetCellEditorExitReason values.

enum memberCancel
Cancel: "cancel"
enum memberCommit
Commit: "commit"
enum memberOutsideClick
OutsideClick: "outside-click"
enumSheetCellEditorInteractionNamesource ↗
enum SheetCellEditorInteractionName

Enumerates SheetCellEditorInteractionName values.

enum memberSessionEnded
SessionEnded: "edit-session-ended"
enum memberSessionStarted
SessionStarted: "edit-session-started"
enumSheetCellEditorKindsource ↗
enum SheetCellEditorKind

Enumerates SheetCellEditorKind values.

enum memberCell
Cell: "cell"
enumSheetCellEditorPipelineNamesource ↗
enum SheetCellEditorPipelineName

Observable pipeline and step names owned by the Cell Editor module.

enum memberCancelEdit
CancelEdit: "cell-editor.cancel-edit"
enum memberCommitEdit
CommitEdit: "cell-editor.commit-edit"
enum memberEditExitAndSelect
EditExitAndSelect: "cell-editor.exit-and-select"
enum memberEndEditSession
EndEditSession: "cell-editor.end-edit-session"
enum memberEnterEditMode
EnterEditMode: "cell-editor.enter-edit-mode"
enum memberStartEditSession
StartEditSession: "cell-editor.start-edit-session"
enumSheetCellEditorPipelineStepNamesource ↗
enum SheetCellEditorPipelineStepName

Enumerates SheetCellEditorPipelineStepName values.

enum memberCommitValue
CommitValue: "cell-editor.commit-value"
enum memberEndEditSession
EndEditSession: "cell-editor.end-edit-session"
enum memberExitEditMode
ExitEditMode: "cell-editor.exit-edit-mode"
enum memberOpenEditor
OpenEditor: "cell-editor.open"
enum memberSelectCell
SelectCell: "cell-editor.select-cell"
enum memberStartEditSession
StartEditSession: "cell-editor.start-edit-session"
classFormulaReferenceHighlightersource ↗
class FormulaReferenceHighlighter extends Highlighter

Formula implementation of the editor's generic Highlighter contract.

constructorconstructor
FormulaReferenceHighlighter(parser: IFormulaParser, configEngine: ConfigEngine): FormulaReferenceHighlighter

Creates a FormulaReferenceHighlighter instance.

parser: IFormulaParser
configEngine: ConfigEngine
propertysymbolstatic
readonly symbol: symbol

DI token for resolving FormulaReferenceHighlighter.

methodclear
clear(): void

Releases any session-scoped resources. Stateless highlighters need not override this.

methodhighlight
highlight(formula: string, context?: HighlightContext): Highlighting

Returns highlighted segments for the supplied source range.

formula: string
context: HighlightContext
classFormulaReferencePickServicesource ↗
class FormulaReferencePickService

Optional workbook-owned bridge for references picked on another sheet.

constructorconstructor
FormulaReferencePickService(): FormulaReferencePickService
propertysymbolstatic
readonly symbol: typeof symbol
methodcancelPendingPick
cancelPendingPick(): void
methodhasPendingPick
hasPendingPick(): boolean
methodpick
pick(start: Point, end: Point): void
start: Point
end: Point
classHighlightersource ↗
class Highlighter

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.

constructorconstructor
Highlighter(): Highlighter
propertysymbolstatic
readonly symbol: symbol

DI token for resolving Highlighter.

methodclear
clear(): void

Releases any session-scoped resources. Stateless highlighters need not override this.

methodhighlight
highlight(text: string, context?: HighlightContext): Highlighting

Returns highlighted segments for the supplied source range.

text: string
context: HighlightContext
classSheetCellEditorPluginsource ↗
class SheetCellEditorPlugin extends Plugin<SearCoreSheet, CellProperties, EditorState>

Coordinates Sheet cell edit sessions, text input, and embedded editors.

constructorconstructor
SheetCellEditorPlugin(mergePlugin: SheetCellMergePlugin, selectionPlugin: SheetSelectionPlugin, textInput: TextInput, keyboardRouter: KeyboardRouter, pointerCapture: PointerCapture, cursorRegistry: CursorRegistry, cursorEngine: CursorEngine, platform: Platform, commitStrategies: CellCommitStrategyRegistry, highlighter: Highlighter, coordinates: CoordinateTransformer, interactionReducers: SheetInteractionReducerRegistry, embeddedEditor?: unknown, commands?: SheetCommandBus, formulaSourceProvider?: IFormulaSourceProvider, textShaper?: TextShaper, cellFormatLocaleProvider?: ICellFormatLocaleProvider, queries?: SheetQueryRegistry, formulaParser?: IFormulaParser, inputValidation?: SheetCellInputValidationRegistry): SheetCellEditorPlugin

Creates a SheetCellEditorPlugin instance.

mergePlugin: SheetCellMergePlugin
selectionPlugin: SheetSelectionPlugin
textInput: TextInput
keyboardRouter: KeyboardRouter
pointerCapture: PointerCapture
cursorRegistry: CursorRegistry
cursorEngine: CursorEngine
platform: Platform
commitStrategies: CellCommitStrategyRegistry
highlighter: Highlighter
coordinates: CoordinateTransformer
interactionReducers: SheetInteractionReducerRegistry
embeddedEditor: unknown
commands: SheetCommandBus
formulaSourceProvider: IFormulaSourceProvider
textShaper: TextShaper
cellFormatLocaleProvider: ICellFormatLocaleProvider
queries: SheetQueryRegistry
formulaParser: IFormulaParser
inputValidation: SheetCellInputValidationRegistry
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<EditorState, object> | readonly PluginDocumentStateContribution<EditorState, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: string[]

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

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydefaultConfigstatic
readonly defaultConfig: SheetCellEditorConfig

Default visual configuration for the inline cell editor.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetCellEditorPlugin.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetCellEditorPlugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: EditorState, transaction: Transaction): EditorState | null

Applies a transaction to SheetCellEditorPlugin state.

pluginState: EditorState
transaction: Transaction
methodbindCore
bindCore(core: SearCoreSheet): void

Binds this plugin to the core owned by its editor-local container.

core: SearCoreSheet
methodbindFormulaRegistry
bindFormulaRegistry(registry: IFunctionRegistry): void

Binds the editor-local registry after formula services have been assembled.

registry: IFunctionRegistry
methodbindReferencePickService
bindReferencePickService(service: FormulaReferencePickService): void

Binds the optional parent-workbook reference picker.

service: FormulaReferencePickService
methodbindRuntimeServices
bindRuntimeServices(container: Container): void

Explicitly binds services for isolated plugin tests or custom local assembly.

container: Container
methodcancelEdit
cancelEdit(searCore: SearCoreSheet): void

Cancels the active cell edit session without committing its draft.

searCore: SearCoreSheet
methodcommitEdit
commitEdit(searCore: SearCoreSheet, fillSelection?: boolean): boolean

Commits the active cell edit session through its owning command.

searCore: SearCoreSheet
fillSelection: boolean
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetDocumentSelection
getDocumentSelection(): DocSelection

Returns the active document selection for host diagnostics and adapters.

methodgetPluginConfig
getPluginConfig(_searCore: SearCoreSheet): null

Returns the plugin config.

_searCore: SearCoreSheet
methodgetStateinherited
getState(): EditorState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedState
lockCommittedState(state: EditorState): void

Locks committed editor selection rectangles while staged clones stay writable.

state: EditorState
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClick
onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean

Handles a double-click pointer event.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

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

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

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

searCore: SearCoreSheet
methodonMouseDown
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp
onMouseUp(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

_searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

Synchronizes document selection only after the editor rectangle transaction
is committed, so a later failed pipeline step cannot alter the live editor
session.

transaction: Transaction
Successfully committed transaction.
methodprojectTransactioninherited
projectTransaction(state: EditorState, 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.

state: EditorState
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the commands.

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

Registers visual defaults for the inline cell editor.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Publishes formula authoring state through the editor's typed observation registry.

observations: ObservationRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Registers the read-only draft projection used during workbook sheet switching.

queries: SheetQueryRegistry
methodregisterState
registerState(): { key: PluginKey; state: EditorState }

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

methodrender
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders SheetCellEditorPlugin scene output.

searCore: SearCoreSheet
offset: { x: number; y: number }
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: EditorState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: EditorState
commitToken: object
methodregisterServicesstatic
registerServices(_context: { container: Container }): void

Registers rich-document node types used by the sheet cell editor.

_context: { container: Container }
interfaceCellRangeHighlightsource ↗
interface CellRangeHighlight

A sheet rectangle rendered as part of an editor highlight.

propertycolor
color: templateLiteral
propertyend
end: [number, number]
propertyfill
fill?: string

Optional translucent fill rendered beneath the range outline.

propertykind
kind?: "cellRange"
propertystart
start: [number, number]
interfaceEditSessionEndedInteractionSignalsource ↗
interface EditSessionEndedInteractionSignal extends SheetInteractionSignal

Public contract for EditSessionEndedInteractionSignal.

propertyreason
reason: SheetCellEditorExitReason
propertytype
type: SessionEnded
interfaceEditSessionStartedInteractionSignalsource ↗
interface EditSessionStartedInteractionSignal extends SheetInteractionSignal

Public contract for EditSessionStartedInteractionSignal.

propertyeditor
editor: SheetCellEditorKind
propertytarget
target: Point
propertytype
type: SessionStarted
interfaceFormulaEditDraftsource ↗
interface FormulaEditDraft

Transient formula draft retained while a workbook mounts another sheet.

propertyautoClosingParentheses
readonly autoClosingParentheses?: readonly number[]
propertycell
readonly cell: Point
propertyselectionEnd
readonly selectionEnd: number
propertyselectionStart
readonly selectionStart: number
propertytext
readonly text: string
interfaceFormulaInputAssistStatesource ↗
interface FormulaInputAssistState

Current formula-authoring suggestions and caret position in the host view.

propertyanchor
readonly anchor: { x: number; y: number } | null
propertydiagnostic
readonly diagnostic: FormulaInputDiagnostic | null
propertyselectedIndex
readonly selectedIndex: number
propertysignature
readonly signature: FormulaSignature | null
propertysuggestions
readonly suggestions: readonly FormulaSuggestion[]
interfaceHighlightContextsource ↗
interface HighlightContext

Generic editor state that can influence a highlighter's presentation.

propertycursorOffset
cursorOffset?: number

Zero-based cursor position in the editor's plain-text content.

interfaceHighlightingsource ↗
interface Highlighting

Presentation-only output shared by all editor highlighters.

propertycellRanges
cellRanges: SheetReferenceHighlight[]
propertytextAttributes
textAttributes: TextAttributeRange<Readonly<Record<string, unknown>>>[]
interfaceSheetBeginCellEditInputsource ↗
interface SheetBeginCellEditInput

Public input used to enter cell edit mode.

propertyanchor
readonly anchor: Point
propertyeditor
readonly editor: SheetCellEditorKind
propertyfocus
readonly focus: Point
interfaceSheetCancelCellEditInputsource ↗
interface SheetCancelCellEditInput

Public input used to cancel the active edit session.

propertyrestoreOriginalDocument
readonly restoreOriginalDocument?: boolean
interfaceSheetCellEditorPointerInputsource ↗
interface SheetCellEditorPointerInput

Pointer selection update inside an active embedded editor.

propertypoint
readonly point: { x: number; y: number }
propertytype
readonly type: "pointerDown" | "pointerMove"
interfaceSheetCellEditSelectionInputsource ↗
interface SheetCellEditSelectionInput

Optional selection change applied while committing an edit session.

propertyanchor
readonly anchor: Point
propertyfocus
readonly focus: Point
interfaceSheetCommitCellEditInputsource ↗
interface SheetCommitCellEditInput

Public input used to commit the active edit session.

propertyfillSelection
readonly fillSelection?: boolean

Applies the entered value to every cell in the current selected rectangle.

propertynextSelection
readonly nextSelection?: SheetCellEditSelectionInput
propertypipelineName
readonly pipelineName?: SheetCellEditorPipelineName
propertyreason
readonly reason?: SheetCellEditorExitReason
interfaceSheetDocumentCursorPositionInputsource ↗
interface SheetDocumentCursorPositionInput

Document cursor position inside the active cell editor session.

propertyoffset
readonly offset: number
propertypath
readonly path: readonly number[]
interfaceSheetDocumentSelectionCommandInputsource ↗
interface SheetDocumentSelectionCommandInput

Document selection input expressed as anchor/head coordinates.

propertyanchor
readonly anchor: readonly [number, number]

Selection anchor as [paragraphIndex, textOffset].

propertyhead
readonly head: readonly [number, number]

Selection head as [paragraphIndex, textOffset].

interfaceSheetFormulaBarStatesource ↗
interface SheetFormulaBarState

Source text and transient edit selection for the active Sheet cell.

propertycell
readonly cell: Point | null
propertyediting
readonly editing: boolean
propertyrange
readonly range: { end: Point; start: Point } | null
propertyselectionEnd
readonly selectionEnd: number
propertyselectionStart
readonly selectionStart: number
propertytext
readonly text: string
interfaceSheetFormulaReferenceReplacementInputsource ↗
interface SheetFormulaReferenceReplacementInput

Formula reference replacement while an edit session is active.

propertyend
readonly end: number
propertypickStart
readonly pickStart?: Point

Present when the replacement begins a pointer-based reference pick.

propertyreference
readonly reference: string
propertystart
readonly start: number
interfaceSheetInlineStyleCommandInputsource ↗
interface SheetInlineStyleCommandInput

Inline text-style patch applied to the active embedded cell editor.

propertyattrs
readonly attrs: Readonly<Record<string, unknown>>
interfaceSheetOpenCellEditorInputsource ↗
interface SheetOpenCellEditorInput

Cell target for opening an embedded edit session.

propertycolumn
readonly column: number
propertyreplaceContent
readonly replaceContent?: boolean
propertyrow
readonly row: number
interfaceSheetRangeTextStyleInputsource ↗
interface SheetRangeTextStyleInput
propertyattrs
readonly attrs: Readonly<Record<string, unknown>>
typeSheetDocumentInputCommandInputsource ↗
type SheetDocumentInputCommandInput = TextInputEvent | { kind: "delete" } | { direction: DocCursorDirection; kind: "arrow"; shiftKey: boolean } | { kind: "selectAll" } | { kind: "softEnter" } | { ctrlKey?: boolean; key: string; kind: "keyDown"; metaKey?: boolean; shiftKey?: boolean } | { anchor: SheetDocumentCursorPositionInput; head: SheetDocumentCursorPositionInput; kind: "setSelection" }

Local document input action run inside the command boundary.

variableAcceptFormulaSuggestionCommandsource ↗
AcceptFormulaSuggestionCommand: SheetCommandDefinition<{ name: string }, SheetCommandResult>

Accepts a registered function suggestion without committing the cell edit.

variableBeginCellEditCommandsource ↗
BeginCellEditCommand: SheetCommandDefinition<SheetBeginCellEditInput, SheetCommandResult>

Command that enters cell edit mode.

variableBeginCellEditorDragSelectionCommandsource ↗
BeginCellEditorDragSelectionCommand: SheetCommandDefinition<void, SheetCommandResult>

Starts the local text-selection drag after the pointer command succeeds.

variableCancelCellEditCommandsource ↗
CancelCellEditCommand: SheetCommandDefinition<void | SheetCancelCellEditInput, SheetCommandResult>

Command that cancels the active cell edit session.

variableCommitCellEditCommandsource ↗
CommitCellEditCommand: SheetCommandDefinition<void | SheetCommitCellEditInput, SheetCommandResult>

Command that commits the active cell edit session.

variableCycleFormulaReferenceCommandsource ↗
CycleFormulaReferenceCommand: SheetCommandDefinition<void, SheetCommandResult>

Cycles the reference at the formula caret through relative and absolute modes.

variableEndCellEditorDragSelectionCommandsource ↗
EndCellEditorDragSelectionCommand: SheetCommandDefinition<{ disposeCapture: boolean }, SheetCommandResult>

Ends the local text-selection drag and optionally releases pointer capture.

variableEndFormulaReferencePickCommandsource ↗
EndFormulaReferencePickCommand: SheetCommandDefinition<void, SheetCommandResult>

Ends a pointer-based formula reference pick without changing the draft.

variableFormulaInputAssistObservationsource ↗
FormulaInputAssistObservation: StateObservationDefinition<FormulaInputAssistState>
variableHandleCellEditorPointerCommandsource ↗
HandleCellEditorPointerCommand: SheetCommandDefinition<SheetCellEditorPointerInput, SheetCommandResult>

Updates the embedded editor's cursor or drag selection.

variableHandleDocumentInputCommandsource ↗
HandleDocumentInputCommand: SheetCommandDefinition<SheetDocumentInputCommandInput, SheetCommandResult>

Command that executes local document input while editing a cell.

variableIsCellEditingQuerysource ↗
IsCellEditingQuery: SheetQueryDefinition<void, boolean>

Reports whether an active cell edit must be committed before a host formatting action.

variableMoveFormulaSuggestionCommandsource ↗
MoveFormulaSuggestionCommand: SheetCommandDefinition<{ direction: -1 | 1 }, SheetCommandResult>

Moves the highlighted function suggestion by one item.

variableOpenCellEditorCommandsource ↗
OpenCellEditorCommand: SheetCommandDefinition<SheetOpenCellEditorInput, SheetCommandResult>

Command that opens the embedded editor and enters cell edit mode atomically.

variableReadFormulaEditDraftQuerysource ↗
ReadFormulaEditDraftQuery: SheetQueryDefinition<void, FormulaEditDraft | null>

Reads the active formula draft without changing the edit session.

variableReplaceFormulaReferenceCommandsource ↗
ReplaceFormulaReferenceCommand: SheetCommandDefinition<SheetFormulaReferenceReplacementInput, SheetCommandResult>

Replaces the picked formula reference in the active edit session.

variableRequestCellEditorRenderCommandsource ↗
RequestCellEditorRenderCommand: SheetCommandDefinition<void, SheetCommandResult>

Command that requests a render pass for the cell editor overlay.

variableRestoreFormulaEditDraftCommandsource ↗
RestoreFormulaEditDraftCommand: SheetCommandDefinition<{ draft: FormulaEditDraft; reference?: string }, SheetCommandResult>

Restores a formula draft after a workbook sheet switch.

variableSetCellInlineStyleCommandsource ↗
SetCellInlineStyleCommand: SheetCommandDefinition<SheetInlineStyleCommandInput, SheetCommandResult>

Command used by toolbar integrations to update rich-text inline styles.

variableSetFormulaBarDraftCommandsource ↗
SetFormulaBarDraftCommand: SheetCommandDefinition<{ selectionEnd: number; selectionStart: number; text: string }, SheetCommandResult>

Replaces the active edit-session text and synchronizes its caret range.

variableSetRangeCellTextStyleCommandsource ↗
SetRangeCellTextStyleCommand: SheetCommandDefinition<SheetRangeTextStyleInput, SheetCommandResult>

Applies text styles to the complete content of selected text cells.

variableSheetFormulaBarObservationsource ↗
SheetFormulaBarObservation: StateObservationDefinition<SheetFormulaBarState>
variableStartFormulaBarEditCommandsource ↗
StartFormulaBarEditCommand: SheetCommandDefinition<void, SheetCommandResult>

Opens the current cell's edit session for an external formula input surface.

variableUpdateCellEditorDocumentSelectionCommandsource ↗
UpdateCellEditorDocumentSelectionCommand: SheetCommandDefinition<SheetDocumentSelectionCommandInput, SheetCommandResult>

Command that updates the rich-document selection inside the cell editor.

variableUpdateFormulaAssistAnchorCommandsource ↗
UpdateFormulaAssistAnchorCommand: SheetCommandDefinition<{ x: number; y: number }, SheetCommandResult>

Updates the formula-assist anchor after editor layout changes.

functionformatPickedReferencesource ↗
formatPickedReference(start: Point, end: Point, sheetName?: string): string

Formats a selected grid rectangle as an A1 reference.

start: Point
end: Point
sheetName: string
functiongetCellEditableValuesource ↗
getCellEditableValue(cell: CellMatrixElement | null | undefined, coordinate?: { col: number; 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.

cell: CellMatrixElement | null | undefined
coordinate: { col: number; row: number }
formulaSourceProvider: IFormulaSourceProvider | null
functionregisterSheetCellEditorInteractionReducerssource ↗
registerSheetCellEditorInteractionReducers(registry: SheetInteractionReducerRegistry): void

Registers Cell Editor's local interaction projections once per DI container.

registry: SheetInteractionReducerRegistry

Package

@searsuite/sear-plugin-cell-fill

14 exports

Sparse Sheet fill state, commands, visual projection, collaboration, and export.

classCellFillMatrixsource ↗
class CellFillMatrix extends CSRMatrix<SheetCellFill | null>

Sparse cell-fill matrix. An absent cell has no fill.

constructorconstructor
CellFillMatrix(data?: CellFillMatrixData, shape?: [number, number]): CellFillMatrix

Creates a sparse cell-fill matrix from serialized CSR data.

data: CellFillMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: templateLiteral | null[]): CellFillMatrix

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: number
The index where the new column should be inserted.
col: templateLiteral | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
addItem(row: number, col: number, value: templateLiteral | null): this

Stores a fill color through the CSR API, removing the entry for null.

row: number
col: number
value: templateLiteral | null
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: templateLiteral | null[]): CellFillMatrix

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: number
The index at which to add the row.
row: templateLiteral | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: templateLiteral | null): templateLiteral | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: templateLiteral | null): templateLiteral | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): CellFillMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): CellFillMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<templateLiteral | null>[]): CellFillMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<templateLiteral | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: templateLiteral | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: templateLiteral | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: templateLiteral | null, 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).

callback: (value: templateLiteral | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: templateLiteral | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: templateLiteral | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: templateLiteral | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: templateLiteral | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: templateLiteral | null[][]): CellFillMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: templateLiteral | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): templateLiteral | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): templateLiteral | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): CellFillMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: templateLiteral | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: templateLiteral | null
The default value to return for missing elements
methodsetItem
setItem(row: number, col: number, value: templateLiteral | null): this

Stores a fill color. Null is represented by removing the sparse entry.

row: number
col: number
value: templateLiteral | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): CellFillMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): CellFillMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): templateLiteral | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetCellFillPluginsource ↗
class SheetCellFillPlugin extends Plugin<unknown, CellProperties, SheetCellFillPluginState>

Plugin that owns cell fill data, commands, structural projections, and export.

constructorconstructor
SheetCellFillPlugin(state: SheetCellFillPluginState): SheetCellFillPlugin

Constructs the plugin around a shared sparse fill matrix.

state: SheetCellFillPluginState
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellFillPluginState, SheetCellFillPluginState>

SheetCellFillPlugin owns its persisted state module.

propertyinterestedIn
interestedIn: string[]

Fill follows direct updates and all sheet structure changes.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Fill transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Fill state is data-only and does not use render-depth diagnostics.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellFillPluginState, SheetCellFillPluginState>

Document-state export contribution for cell fills.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all cell-fill plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the cell-fill plugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: SheetCellFillPluginState, transaction: Transaction): SheetCellFillPluginState | null

Applies direct fill and structural matrix operations.

pluginState: SheetCellFillPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Cell-fill data has no render-time configuration.

methodgetStateinherited
getState(): SheetCellFillPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetCellFillPluginState): void

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

state: SheetCellFillPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

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

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

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

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetCellFillPluginState, 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.

state: SheetCellFillPluginState
transaction: Transaction
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

Contributes explicit fill colors to the shared Sheet cell visual pipeline.

registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the cell-fill command owned by this plugin.

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

Registers default configuration values owned by this plugin.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

registry: SheetFormatTransferRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellFillMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellFillPluginState }

Registers fill state for commands, projections, and collaboration.

methodrender
render(): Node<CellProperties>[]

Cell-fill data contributes through grid cell properties, not scene nodes.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

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

methodsetStateinherited
setState(state: SheetCellFillPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetCellFillPluginState
commitToken: object
interfaceCellFillMatrixDatasource ↗
interface CellFillMatrixData

Serialized sparse entries accepted by CellFillMatrix.

propertydata
readonly data: string | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetCellFillCommandDataSourcesource ↗
interface SheetCellFillCommandDataSource extends CellFillCommandRangeDataSource

State access required by the cell-fill command.

propertytarget
readonly target: PluginKey
methodgetColumnCountinherited
getColumnCount(): number
methodgetRowCountinherited
getRowCount(): number
methodreadCellFill
readCellFill(row: number, column: number): templateLiteral | null
row: number
column: number
interfaceSheetCellFillPluginStatesource ↗
interface SheetCellFillPluginState

State owned by SheetCellFillPlugin.

propertycellFills
cellFills: CellFillMatrix

Sparse matrix containing explicit cell fill colors.

interfaceSheetSetRangeCellFillInputsource ↗
interface SheetSetRangeCellFillInput extends SheetRangeInput

Public input for setting or clearing cell fill in a range.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfill
readonly fill: templateLiteral | null
propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

typeSheetCellFillsource ↗
type SheetCellFill = HexColor

A persisted cell fill color represented as a CSS-compatible hexadecimal color.

variableSetRangeCellFillCommandsource ↗
SetRangeCellFillCommand: SheetCommandDefinition<SheetSetRangeCellFillInput, SheetCommandResult>

Public command for setting or clearing cell fill in a range.

variableSheetCellFillFieldKeysource ↗
SheetCellFillFieldKey: "sheet.cellFill"

DataEngine field owned by SheetCellFillPlugin.

functionassertSheetCellFillsource ↗
assertSheetCellFill(value: unknown): value

Asserts that a value is a supported cell fill color.

value: unknown
functioncreateSetRangeCellFillOperationssource ↗
createSetRangeCellFillOperations(input: SheetSetRangeCellFillInput, dataSource: SheetCellFillCommandDataSource): UpdateCellOTOperation<templateLiteral>[]

Creates sparse update operations for a cell-fill range.

input: SheetSetRangeCellFillInput
dataSource: SheetCellFillCommandDataSource
functionisSheetCellFillsource ↗
isSheetCellFill(value: unknown): value

Returns whether a value is a supported cell fill color.

value: unknown
functionreadSheetCellFillssource ↗
readSheetCellFills(dataEngine: DataEngine): CellFillMatrix | null

Reads cell fills published by SheetCellFillPlugin.

dataEngine: DataEngine
functionregisterSheetCellFillCommandsource ↗
registerSheetCellFillCommand(commands: SheetCommandBus, dataSource: SheetCellFillCommandDataSource): void

Registers the cell-fill command owned by SheetCellFillPlugin.

commands: SheetCommandBus
dataSource: SheetCellFillCommandDataSource

Package

@searsuite/sear-plugin-cell-format

16 exports

Cell number-format state, commands, display projection, and persistence.

classCellFormatMatrixsource ↗
class CellFormatMatrix extends CSRMatrix<CellFormat | null>

Sparse matrix containing explicit per-cell number formats.

constructorconstructor
CellFormatMatrix(data?: CellFormatMatrixData, shape?: [number, number]): CellFormatMatrix
data: CellFormatMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: CellFormat | null[]): CellFormatMatrix

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: number
The index where the new column should be inserted.
col: CellFormat | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
addItem(row: number, column: number, format: CellFormat | null): this

Stores a format through the CSR API.

row: number
column: number
format: CellFormat | null
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: CellFormat | null[]): CellFormatMatrix

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: number
The index at which to add the row.
row: CellFormat | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: CellFormat | null): CellFormat | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: CellFormat | null): CellFormat | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): CellFormatMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): CellFormatMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<CellFormat | null>[]): CellFormatMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<CellFormat | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: CellFormat | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: CellFormat | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: CellFormat | null, 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).

callback: (value: CellFormat | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: CellFormat | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: CellFormat | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: CellFormat | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: CellFormat | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: CellFormat | null[][]): CellFormatMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: CellFormat | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): CellFormat | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): CellFormat | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): CellFormatMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: CellFormat | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: CellFormat | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, format: CellFormat | null): this

Stores a validated format, or removes the sparse entry for null.

row: number
column: number
format: CellFormat | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): CellFormatMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): CellFormatMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): CellFormat | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classCellFormatMatrixErrorsource ↗
class CellFormatMatrixError extends SearError

Public error raised when persisted Sheet cell-format state is invalid.

constructorconstructor
CellFormatMatrixError(message: string, details?: SearErrorDetails): CellFormatMatrixError
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_CELL_FORMAT_INVALID"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetCellFormatPluginsource ↗
class SheetCellFormatPlugin extends Plugin<unknown, CellProperties, SheetCellFormatPluginState>

Plugin owning per-cell number formats, their commands, OT, rendering projection, and export.

constructorconstructor
SheetCellFormatPlugin(state: SheetCellFormatPluginState): SheetCellFormatPlugin
state: SheetCellFormatPluginState
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellFormatPluginState, SheetCellFormatPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: string[]

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

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellFormatPluginState, SheetCellFormatPluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: symbol
memberkeyinherited
key: unknown
methodapply
apply(state: SheetCellFormatPluginState, transaction: Transaction): SheetCellFormatPluginState | null

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

state: SheetCellFormatPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

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

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetCellFormatPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetCellFormatPluginState): void

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

state: SheetCellFormatPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

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

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetCellFormatPluginState, 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.

state: SheetCellFormatPluginState
transaction: Transaction
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void
registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

registry: SheetFormatTransferRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellFormatMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellFormatPluginState }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetCellFormatPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetCellFormatPluginState
commitToken: object
interfaceSheetAdjustRangeCellFormatDecimalsInputsource ↗
interface SheetAdjustRangeCellFormatDecimalsInput extends SheetRangeInput

Input accepted by AdjustRangeCellFormatDecimalPlacesCommand.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertydelta
readonly delta: number
propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

interfaceSheetCellFormatCommandDataSourcesource ↗
interface SheetCellFormatCommandDataSource extends CellFormatCommandRangeDataSource

State access required by the cell-format command.

propertytarget
readonly target: PluginKey
methodgetColumnCountinherited
getColumnCount(): number
methodgetRowCountinherited
getRowCount(): number
methodreadCellFormat
readCellFormat(row: number, column: number): CellFormat | null
row: number
column: number
interfaceSheetCellFormatPluginStatesource ↗
interface SheetCellFormatPluginState

State exclusively owned by SheetCellFormatPlugin.

propertycellFormats
readonly cellFormats: CellFormatMatrix
interfaceSheetCellFormatReadersource ↗
interface SheetCellFormatReader

Read-only projection of one Sheet's persisted cell-format matrix.

propertyshape
readonly shape: [number, number]
methodgetItem
getItem(row: number, column: number): CellFormat | null
row: number
column: number
interfaceSheetSetRangeCellFormatInputsource ↗
interface SheetSetRangeCellFormatInput extends SheetRangeInput

Input accepted by SetRangeCellFormatCommand.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertyformat
readonly format: CellFormat | null
variableAdjustRangeCellFormatDecimalPlacesCommandsource ↗
AdjustRangeCellFormatDecimalPlacesCommand: SheetCommandDefinition<SheetAdjustRangeCellFormatDecimalsInput, SheetCommandResult>

Public command for increasing or decreasing a range's visible decimal places.

variableReadSheetCellFormatQuerysource ↗
ReadSheetCellFormatQuery: SheetQueryDefinition<void, SheetCellFormatReader>

Reads the active Sheet's live, read-only cell-format projection.

variableSetRangeCellFormatCommandsource ↗
SetRangeCellFormatCommand: SheetCommandDefinition<SheetSetRangeCellFormatInput, SheetCommandResult>

Public command for setting or clearing the number format of a cell range.

variableSheetCellFormatFieldKeysource ↗
SheetCellFormatFieldKey: "sheet.cellFormat"

DataEngine field owned by SheetCellFormatPlugin.

functioncreateAdjustCellFormatDecimalOperationssource ↗
createAdjustCellFormatDecimalOperations(input: SheetAdjustRangeCellFormatDecimalsInput, dataSource: SheetCellFormatCommandDataSource): UpdateCellOTOperation<CellFormat>[]

Creates sparse MatrixOT updates for a decimal-place adjustment.

input: SheetAdjustRangeCellFormatDecimalsInput
dataSource: SheetCellFormatCommandDataSource
functioncreateSetRangeCellFormatOperationssource ↗
createSetRangeCellFormatOperations(input: SheetSetRangeCellFormatInput, dataSource: SheetCellFormatCommandDataSource): UpdateCellOTOperation<CellFormat>[]

Creates sparse MatrixOT updates for one format range.

input: SheetSetRangeCellFormatInput
dataSource: SheetCellFormatCommandDataSource
functionreadSheetCellFormatssource ↗
readSheetCellFormats(dataEngine: DataEngine): CellFormatMatrix | null

Reads the live format matrix published by SheetCellFormatPlugin.

dataEngine: DataEngine
functionregisterSheetCellFormatCommandsource ↗
registerSheetCellFormatCommand(commands: SheetCommandBus, dataSource: SheetCellFormatCommandDataSource): void

Registers the command owned by SheetCellFormatPlugin.

commands: SheetCommandBus
dataSource: SheetCellFormatCommandDataSource

Package

@searsuite/sear-plugin-cell-highlight

24 exports

Conditional cell highlight rules, sparse range state, commands, and rendering contributions.

classCellHighlightMatrixsource ↗
class CellHighlightMatrix extends CSRMatrix<CellHighlightRule[] | null>

Sparse rule anchors; the range index avoids scanning all rules for every visible cell.

constructorconstructor
CellHighlightMatrix(data?: CellHighlightMatrixData, shape?: [number, number]): CellHighlightMatrix
data: CellHighlightMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: CellHighlightRule[] | null[]): CellHighlightMatrix

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: number
The index where the new column should be inserted.
col: CellHighlightRule[] | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
column: number
rules: CellHighlightRule[] | null
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: CellHighlightRule[] | null[]): CellHighlightMatrix

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: number
The index at which to add the row.
row: CellHighlightRule[] | null[]
The row to add.
methodclone
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: CellHighlightRule[] | null): CellHighlightRule[] | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: CellHighlightRule[] | null): CellHighlightRule[] | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): CellHighlightMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): CellHighlightMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<CellHighlightRule[] | null>[]): CellHighlightMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<CellHighlightRule[] | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodfindRules
findRules(row: number, column: number): PositionedCellHighlightRule[]
row: number
column: number
methodforEachinherited
forEach(callback: (value: CellHighlightRule[] | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: CellHighlightRule[] | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStored
forEachStored(callback: (rules: CellHighlightRule[] | null, row: number, column: number): void): void

Visits only stored anchors even when the sheet has many empty rows.

callback: (rules: CellHighlightRule[] | null, row: number, column: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: CellHighlightRule[] | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: CellHighlightRule[] | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: CellHighlightRule[] | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: CellHighlightRule[] | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: CellHighlightRule[] | null[][]): CellHighlightMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: CellHighlightRule[] | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): CellHighlightRule[] | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetItem
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: number
The row index.
column: number
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodgetRules
getRules(): PositionedCellHighlightRule[]
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): CellHighlightMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodreplaceRules
replaceRules(entries: readonly PositionedCellHighlightRule[]): void
entries: readonly PositionedCellHighlightRule[]
methodsetDefaultValueinherited
setDefaultValue(value: CellHighlightRule[] | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: CellHighlightRule[] | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, rules: CellHighlightRule[] | null): this
row: number
column: number
rules: CellHighlightRule[] | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): CellHighlightMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): CellHighlightMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): CellHighlightRule[] | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetCellHighlightPluginsource ↗
class SheetCellHighlightPlugin extends Plugin<unknown, CellProperties, SheetCellHighlightPluginState>

Base contract implemented by sheet and document plugins.

Plugins own their state, declare lifecycle hooks, transform transactions into
state, and render scene nodes for their host core. Runtime packages should
extend this contract rather than reaching into Core internals.

constructorconstructor
SheetCellHighlightPlugin(state: SheetCellHighlightPluginState, dependencies: CellHighlightDependencies): SheetCellHighlightPlugin
state: SheetCellHighlightPluginState
dependencies: CellHighlightDependencies
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellHighlightPluginState, SheetCellHighlightPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellHighlightPluginState, SheetCellHighlightPluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(state: SheetCellHighlightPluginState, transaction: Transaction): SheetCellHighlightPluginState | null

Applies a transaction to plugin-owned state and returns the next state.

state: SheetCellHighlightPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methoddispose
dispose(): void
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetCellHighlightPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinvalidateRangeStatistics
invalidateRangeStatistics(cells?: readonly SheetDisplayedValueCoordinate[]): void

Invalidates derived range statistics after displayed values change.

cells: readonly SheetDisplayedValueCoordinate[]
methodlockCommittedStateinherited
lockCommittedState(state: SheetCellHighlightPluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetCellHighlightPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetCellHighlightPluginState, 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.

state: SheetCellHighlightPluginState
transaction: Transaction
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void
registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellHighlightMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellHighlightPluginState }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetCellHighlightPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetCellHighlightPluginState
commitToken: object
interfaceAddCellHighlightRuleInputsource ↗
interface AddCellHighlightRuleInput extends SheetRangeInput

Common range input accepted by explicit range commands.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertycondition
readonly condition: CellHighlightCondition
propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertystyle
readonly style: CellHighlightStyle
interfaceCellHighlightConditionsource ↗
interface CellHighlightCondition
propertycount
readonly count?: number
propertyincludeEqual
readonly includeEqual?: boolean
propertykind
readonly kind: CellHighlightKind
propertyoperator
readonly operator?: CellHighlightValueOperator | CellHighlightTextOperator
propertypercent
readonly percent?: boolean
propertysecondValue
readonly secondValue?: string
propertyvalue
readonly value?: string
interfaceCellHighlightRulesource ↗
interface CellHighlightRule

One conditional rule stored at its range's top-left matrix cell.

propertycondition
readonly condition: CellHighlightCondition
propertyendColumn
readonly endColumn: number
propertyendRow
readonly endRow: number
propertyid
readonly id: string
propertypriority
readonly priority: number
propertystyle
readonly style: CellHighlightStyle
interfacePositionedCellHighlightRulesource ↗
interface PositionedCellHighlightRule
propertycolumn
readonly column: number
propertyrow
readonly row: number
propertyrule
readonly rule: CellHighlightRule
interfaceSheetCellHighlightPluginStatesource ↗
interface SheetCellHighlightPluginState
propertycellHighlights
readonly cellHighlights: CellHighlightMatrix
typeCellHighlightKindsource ↗
type CellHighlightKind = typeof CellHighlightKind[keyof typeof CellHighlightKind]
typeCellHighlightNumericRangeReadersource ↗
type CellHighlightNumericRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: number): void): void
typeCellHighlightStylesource ↗
type CellHighlightStyle = typeof CellHighlightStyle[keyof typeof CellHighlightStyle]
typeCellHighlightTextOperatorsource ↗
type CellHighlightTextOperator = typeof CellHighlightTextOperator[keyof typeof CellHighlightTextOperator]
typeCellHighlightValueOperatorsource ↗
type CellHighlightValueOperator = typeof CellHighlightValueOperator[keyof typeof CellHighlightValueOperator]
typeCellHighlightValueRangeReadersource ↗
type CellHighlightValueRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: unknown): void): void
typeCellHighlightValueReadersource ↗
type CellHighlightValueReader = (row: number, column: number): unknown
variableAddCellHighlightRuleCommandsource ↗
AddCellHighlightRuleCommand: SheetCommandDefinition<AddCellHighlightRuleInput, SheetCommandResult>
variableCellHighlightKindsource ↗
CellHighlightKind: { AboveAverage: "aboveAverage"; BelowAverage: "belowAverage"; Bottom: "bottom"; Duplicate: "duplicate"; Empty: "empty"; Error: "error"; NotEmpty: "notEmpty"; NotError: "notError"; … }
variableCellHighlightStylesource ↗
CellHighlightStyle: { GreenFill: "greenFill"; RedBorder: "redBorder"; RedFill: "redFill"; RedText: "redText"; YellowFill: "yellowFill" }
variableCellHighlightTextOperatorsource ↗
CellHighlightTextOperator: { Contains: "contains"; EndsWith: "endsWith"; NotContains: "notContains"; StartsWith: "startsWith" }
variableCellHighlightValueOperatorsource ↗
CellHighlightValueOperator: { Between: "between"; Equal: "equal"; Greater: "greater"; GreaterOrEqual: "greaterOrEqual"; Less: "less"; LessOrEqual: "lessOrEqual"; NotBetween: "notBetween"; NotEqual: "notEqual" }
variableClearCellHighlightRulesCommandsource ↗
ClearCellHighlightRulesCommand: SheetCommandDefinition<ClearCellHighlightRulesInput, SheetCommandResult>
variableReadCellHighlightRulesQuerysource ↗
ReadCellHighlightRulesQuery: SheetQueryDefinition<void, readonly PositionedCellHighlightRule[]>
variableRemoveCellHighlightRuleCommandsource ↗
RemoveCellHighlightRuleCommand: SheetCommandDefinition<RemoveCellHighlightRuleInput, SheetCommandResult>
variableSheetCellHighlightFieldKeysource ↗
SheetCellHighlightFieldKey: "sheet.cellHighlight"
functionreadSheetCellHighlightssource ↗
readSheetCellHighlights(dataEngine: DataEngine): CellHighlightMatrix | null
dataEngine: DataEngine

Package

@searsuite/sear-plugin-cell-merge

24 exports

Merged-range state, structural transforms, commands, rendering, and persistence.

classCellMergeMatrixsource ↗
class CellMergeMatrix extends CSRMatrix<SheetCellMerge | null>

Sparse matrix containing one end coordinate at every merged-range anchor.

constructorconstructor
CellMergeMatrix(data?: CellMergeMatrixData, shape?: [number, number]): CellMergeMatrix
data: CellMergeMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: SheetCellMerge | null[]): CellMergeMatrix

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: number
The index where the new column should be inserted.
col: SheetCellMerge | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
column: number
value: SheetCellMerge | null
The value to add.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: SheetCellMerge | null[]): CellMergeMatrix

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: number
The index at which to add the row.
row: SheetCellMerge | null[]
The row to add.
methodclone
clone(): this

Deep-clones stored merge values.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: SheetCellMerge | null): SheetCellMerge | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: SheetCellMerge | null): SheetCellMerge | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): CellMergeMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): CellMergeMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<SheetCellMerge | null>[]): CellMergeMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<SheetCellMerge | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodfindRange
findRange(row: number, column: number): Rect | null

Finds the merged range containing one sheet cell.

row: number
column: number
methodforEachinherited
forEach(callback: (value: SheetCellMerge | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: SheetCellMerge | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStored
forEachStored(callback: (value: SheetCellMerge | null, row: number, col: number): void): void

Visits actual anchors only, locating their rows through CSR pointer binary search.

callback: (value: SheetCellMerge | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: SheetCellMerge | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: SheetCellMerge | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: SheetCellMerge | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: SheetCellMerge | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: SheetCellMerge | null[][]): CellMergeMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: SheetCellMerge | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): SheetCellMerge | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetItem
getItem(row: number, column: number): SheetCellMerge | null

Returns an isolated value so callers cannot mutate persisted matrix state.

row: number
column: number
methodgetRanges
getRanges(): Rect[]

Returns all merged ranges in matrix traversal order.

methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): CellMergeMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodreplaceRanges
replaceRanges(ranges: readonly Rect[]): this

Rebuilds sparse entries from normalized ranges while preserving matrix shape.

ranges: readonly Rect[]
methodsetDefaultValueinherited
setDefaultValue(value: SheetCellMerge | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: SheetCellMerge | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, value: SheetCellMerge | null): this

Stores or clears a merged range anchored at the supplied cell.

row: number
column: number
value: SheetCellMerge | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): CellMergeMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): CellMergeMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): SheetCellMerge | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetCellMergeConfirmationErrorsource ↗
class SheetCellMergeConfirmationError extends SearError

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.

constructorconstructor
SheetCellMergeConfirmationError(reason: "required" | "changed"): SheetCellMergeConfirmationError
reason: "required" | "changed"
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_MERGE_CONFIRMATION_REQUIRED"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetCellMergePluginsource ↗
class SheetCellMergePlugin extends Plugin<unknown, CellProperties, SheetCellMergePluginState>

Owns sparse merged-cell state, commands, structure projection, collaboration, and export.

constructorconstructor
SheetCellMergePlugin(state: SheetCellMergePluginState, cellContent?: SheetCellMergeContentSource): SheetCellMergePlugin
state: SheetCellMergePluginState
cellContent: SheetCellMergeContentSource
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellMergePluginState, SheetCellMergePluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellMergePluginState, SheetCellMergePluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(pluginState: SheetCellMergePluginState, transaction: Transaction): SheetCellMergePluginState | null

Applies a transaction to plugin-owned state and returns the next state.

pluginState: SheetCellMergePluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetCellMergePluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodisMergedCell
isMergedCell(row: number, column: number): Rect | null
row: number
column: number
methodlockCommittedStateinherited
lockCommittedState(state: SheetCellMergePluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetCellMergePluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetCellMergePluginState, 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.

state: SheetCellMergePluginState
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Moves complete merged ranges and rejects moves that split a merge.

registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellMergeMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellMergePluginState }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetCellMergePluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetCellMergePluginState
commitToken: object
classSheetMergeRangeMoveErrorsource ↗
class SheetMergeRangeMoveError extends SearError

A cell move that would split an existing merged range.

constructorconstructor
SheetMergeRangeMoveError(context: SheetRangeMoveContext): SheetMergeRangeMoveError
context: SheetRangeMoveContext
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_MOVE_SPLIT_MERGE"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetMergeStructureMoveErrorsource ↗
class SheetMergeStructureMoveError extends SearError

A structure permutation would leave a merged range noncontiguous.

constructorconstructor
SheetMergeStructureMoveError(range: readonly readonly number[][]): SheetMergeStructureMoveError
range: readonly readonly number[][]
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_STRUCTURE_MOVE_SPLIT_MERGE"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
interfaceCellMergeMatrixDatasource ↗
interface CellMergeMatrixData

Serialized CSR entries accepted by CellMergeMatrix.

propertydata
readonly data: SheetCellMerge | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetCellMergesource ↗
interface SheetCellMerge

Sparse value stored only at the top-left cell of a merged range.

propertyendColumn
readonly endColumn: number
propertyendRow
readonly endRow: number
interfaceSheetCellMergeActionDataSourcesource ↗
interface SheetCellMergeActionDataSource extends SheetCellMergeCommandDataSource
propertycellContent
readonly cellContent: SheetCellMergeContentSource
propertytargetinherited
readonly target: PluginKey
methodreadMatrixinherited
readMatrix(): CellMergeMatrix
interfaceSheetCellMergeCommandDataSourcesource ↗
interface SheetCellMergeCommandDataSource
propertytarget
readonly target: PluginKey
methodreadMatrix
readMatrix(): CellMergeMatrix
interfaceSheetCellMergeContentSourcesource ↗
interface SheetCellMergeContentSource
propertytarget
readonly target: PluginKey
methodreadCell
readCell(row: number, column: number): unknown
row: number
column: number
interfaceSheetCellMergePluginStatesource ↗
interface SheetCellMergePluginState
propertycellMerges
cellMerges: CellMergeMatrix
interfaceSheetMergeAnalysissource ↗
interface SheetMergeAnalysis
propertydiscardedCells
readonly discardedCells: readonly SheetMergeDiscardedCell[]
propertyend
readonly end: readonly [number, number]
propertyretainedCell
readonly retainedCell: SheetMergeDiscardedCell | null
propertystart
readonly start: readonly [number, number]
interfaceSheetMergeInputsource ↗
interface SheetMergeInput extends SheetRangeInput

Common range input accepted by explicit range commands.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyconfirmation
readonly confirmation?: SheetMergeAnalysis
propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

variableAnalyzeMergeCellsQuerysource ↗
AnalyzeMergeCellsQuery: SheetQueryDefinition<SheetRangeInput, SheetMergeAnalysis | null>
variableMergeCellsCommandsource ↗
MergeCellsCommand: SheetCommandDefinition<SheetMergeInput, SheetCommandResult>
variableSheetCellMergeFieldKeysource ↗
SheetCellMergeFieldKey: "sheet.cellMerge"

DataEngine field owned by SheetCellMergePlugin.

variableToggleMergeCellsCommandsource ↗
ToggleMergeCellsCommand: SheetCommandDefinition<SheetMergeInput, SheetCommandResult>
variableUnmergeCellsCommandsource ↗
UnmergeCellsCommand: SheetCommandDefinition<SheetRangeInput, SheetCommandResult>
functionanalyzeMergeCellssource ↗
analyzeMergeCells(input: SheetRangeInput, dataSource: SheetCellMergeActionDataSource): SheetMergeAnalysis | null
input: SheetRangeInput
dataSource: SheetCellMergeActionDataSource
functioncreateMergeCellsOperationssource ↗
createMergeCellsOperations(input: SheetRangeInput, dataSource: SheetCellMergeCommandDataSource): UpdateCellOTOperation<SheetCellMerge>[]
input: SheetRangeInput
dataSource: SheetCellMergeCommandDataSource
functioncreateUnmergeCellsOperationssource ↗
createUnmergeCellsOperations(input: SheetRangeInput, dataSource: SheetCellMergeCommandDataSource): UpdateCellOTOperation<SheetCellMerge>[]
input: SheetRangeInput
dataSource: SheetCellMergeCommandDataSource
functionreadSheetCellMergessource ↗
readSheetCellMerges(dataEngine: DataEngine): CellMergeMatrix | null

Reads merged-cell state published by SheetCellMergePlugin.

dataEngine: DataEngine
functionregisterSheetCellMergeCommandssource ↗
registerSheetCellMergeCommands(commands: SheetCommandBus, dataSource: SheetCellMergeActionDataSource): void

Registers every command owned by SheetCellMergePlugin.

commands: SheetCommandBus
dataSource: SheetCellMergeActionDataSource
functionregisterSheetCellMergeQueriessource ↗
registerSheetCellMergeQueries(queries: SheetQueryRegistry, dataSource: SheetCellMergeActionDataSource): void
queries: SheetQueryRegistry
dataSource: SheetCellMergeActionDataSource

Package

@searsuite/sear-plugin-checkbox

27 exports

Portable boolean checkbox cell type, typed commands and stateless Sheet integration.

classCheckboxCellsource ↗
class CheckboxCell extends Cell<CellProperties<boolean>>

Renders a centered symbol while leaving the rest of the cell available for selection.

constructorconstructor
CheckboxCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): CheckboxCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
methodgetDisplayText
getDisplayText(): string

Preserves boolean editor, auto-size and plain-text semantics.

methodrender
render(): FixBoxNode<CellProperties<boolean>>

Creates a glyph only for well-formed boolean values.

classCheckboxCellCommitStrategysource ↗
class CheckboxCellCommitStrategy extends CellCommitStrategyDefinition

Retains checkbox identity for boolean edits, including cells governed by checkbox validation.

constructorconstructor
CheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategy

Creates a target predicate owned by the current editor.

hasRule: (row: number, column: number): boolean
propertykey
readonly key: "checkbox"

Stable editor-local strategy identity.

propertypriority
readonly priority: 1100

Runs before numeric/formula/string fallbacks, only for checkbox targets.

methodcommit
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.

context: CellCommitContext
methodmatches
matches(context: CellCommitContext): boolean

Reports whether this strategy owns the target's edit semantics.

context: CellCommitContext
classCheckboxCellTypeDefinitionsource ↗
class CheckboxCellTypeDefinition extends CellTypeDefinition

Atomic catalog contribution for rendering, editing, display and clipboard behavior.

constructorconstructor
CheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinition

Binds rule-aware edit conversion to one editor.

hasRule: (row: number, column: number): boolean
propertytype
readonly type: "checkbox"

Persisted feature identifier.

methodcreateClipboardCodec
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.

methodcreateCommitStrategies
createCommitStrategies(): CheckboxCellCommitStrategy[]

Creates the checkbox edit strategy.

methodcreateDisplayTextProvider
createDisplayTextProvider(): { cellType: string; getDisplayText: (cell: { value?: unknown }): string }

Provides stable boolean text for searches and measurements.

methodcreateFormatTransferCodecinherited
createFormatTransferCodec(): CellFormatTransferCodec | undefined

Optional format-transfer behavior owned by this cell type.

methodcreateRenderer
createRenderer(): CellRendererDefinition

Registers portable glyph rendering.

methodisStoredValue
isStoredValue(cell: { value?: unknown }): boolean

Validates persisted booleans before creating a glyph.

cell: { value?: unknown }
classCheckboxErrorsource ↗
class CheckboxError extends SearError

Checkbox-specific public error with structured context.

constructorconstructor
CheckboxError(code: CheckboxErrorCode, message: string, details?: SearErrorDetails): CheckboxError

Creates a feature diagnostic.

code: CheckboxErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycodeinherited
readonly code: CheckboxErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classCheckboxGlyphNodesource ↗
class CheckboxGlyphNode extends FixBoxNode<CellProperties<boolean>>

Portable checkbox symbol; its own bounds are the pointer hit region.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<CellProperties<boolean>>): Node<CellProperties<boolean>> add(children: Node<CellProperties<boolean>>[]): Node<CellProperties<boolean>>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<CellProperties<boolean>>
The child node to add.
children: Node<CellProperties<boolean>>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(context: RenderContext): void

Clears this node's bounds from a raster context using stroke padding.

context: RenderContext
Render context to clear.
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(context: RenderContext): void

Draws the node into the hit-test context unless the node is visual-only.

context: RenderContext
Hit render context.
methoddrawScene
drawScene(context: RenderContext, _clip?: ClipRegion): void

Paints the symbol using paths supported by every render adapter.

context: RenderContext
_clip: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<CellProperties<boolean>> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<CellProperties<boolean>> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): CheckboxGlyphNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<CellProperties<boolean>>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<CellProperties<boolean>>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<CellProperties<boolean>>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classSheetCheckboxPluginsource ↗
class SheetCheckboxPlugin extends Plugin<unknown, CellProperties, null>

Stateless feature; persistent values, history and collaboration belong to the ordinary cell owner.

constructorconstructor
SheetCheckboxPlugin(options: SheetCheckboxOptions): SheetCheckboxPlugin

Installs all type capabilities atomically into the owning editor's registries.

options: SheetCheckboxOptions
propertydepth
readonly depth: -25

Intercepts glyph hits before selection and text editing.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Stateless input features need no duplicate-depth warning.

propertysymbolstatic
readonly symbol: typeof symbol

Editor-local DI token.

memberkeyinherited
key: unknown
methodapply
apply(): null

The feature never owns or directly applies cell state.

methoddestroy
destroy(): void

Restores all replaced capabilities and releases handlers idempotently.

methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

No render configuration is contributed.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClick
onDblClick(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Consumes glyph double-clicks so they do not enter text editing.

_core: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDown
onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Changes a glyph through typed selection and toggle commands, never through direct matrix mutation.

_core: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers owner-targeted commands; each change is one staged cell transaction.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Publishes sparse range-state reads.

queries: SheetQueryRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

No independent document state is registered.

methodrender
render(): null

Glyphs are rendered by the catalog's ordinary cell renderer.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
interfaceCheckboxCellValuesource ↗
interface CheckboxCellValue extends CellMatrixElement

A checkbox's persisted boolean state.

propertyformulainherited
formula?: string

Formula source text for formula cells; calculated results live in formula plugin state.

propertyformulaEvaluationModeinherited
formulaEvaluationMode?: "dynamic" | "legacy"

Array evaluation mode used when the formula was entered.

propertytype
type: "checkbox"

Feature-owned cell identifier.

propertyvalue
value: boolean

Boolean used directly by formula semantics.

interfaceCheckboxCellWritesource ↗
interface CheckboxCellWrite

Planned update owned by the ordinary cell-data plugin.

propertycell
readonly cell: CellMatrixElement | null

Replacement cell; null clears it.

propertycolumn
readonly column: number

Absolute column.

propertyrow
readonly row: number

Absolute row.

interfaceCheckboxRangeStatussource ↗
interface CheckboxRangeStatus

Read-only aggregate of existing checkbox states.

propertychecked
readonly checked: number

Checked checkbox count.

propertycount
readonly count: number

Well-formed checkbox count.

propertymixed
readonly mixed: boolean

Whether both states occur in the range.

propertyunchecked
readonly unchecked: number

Unchecked checkbox count.

interfaceInsertCheckboxesInputsource ↗
interface InsertCheckboxesInput extends SheetRangeInput

Converts empty or explicit boolean cells; replacement of other content requires opt-in.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertychecked
readonly checked?: boolean

Optional forced initial state; otherwise existing boolean states are retained.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertyreplaceExisting
readonly replaceExisting?: boolean

Explicitly replace other persisted content.

interfaceSheetCheckboxOptionssource ↗
interface SheetCheckboxOptions

Editor-local dependencies; checkbox state stays in the cell-data owner.

propertycatalog
readonly catalog: CellTypeCatalog

Cell-type extension catalog.

propertycursor
readonly cursor?: CursorRegistry

Optional editor-local cursor registry.

propertyformulas
readonly formulas?: CellFormulaValueConverterRegistry

Formula converter registry, when formula support is installed.

propertyinputValidation
readonly inputValidation?: SheetCellInputValidationRegistry

Shared cell-edit validation registry.

methodbeforeToggle
beforeToggle(): boolean

Allows the composition root to commit or reject an active edit before pointer toggling.

methodcreateTransaction
createTransaction(writes: readonly CheckboxCellWrite[]): Transaction

Creates a semantic cell-owner transaction without mutating live data.

writes: readonly CheckboxCellWrite[]
methodforEachStored
forEachStored(range: SheetRangeInput, visit: (cell: CellMatrixElement | null, row: number, column: number): void): void

Visits persisted sparse entries inside the inclusive selection.

range: SheetRangeInput
visit: (cell: CellMatrixElement | null, row: number, column: number): void
methodhasCheckboxRule
hasCheckboxRule(row: number, column: number): boolean

Reports a checkbox validation rule, including cells currently showing warning text.

row: number
column: number
methodreadCell
readCell(row: number, column: number): CellMatrixElement | null

Reads current persisted cell values.

row: number
column: number
methodreadShape
readShape(): readonly [number, number]

Reads current Sheet dimensions.

methodvalidateValue
validateValue(row: number, column: number, text: string): { message?: string; reject: boolean }

Rejects incompatible existing validation on direct checkbox commands.

row: number
column: number
text: string
typeCheckboxErrorCodesource ↗
type CheckboxErrorCode = typeof CheckboxErrorCode[keyof typeof CheckboxErrorCode]

One checkbox diagnostic identity.

typeCheckboxRemovalModesource ↗
type CheckboxRemovalMode = typeof CheckboxRemovalMode[keyof typeof CheckboxRemovalMode]

One supported removal policy.

variableCheckboxCellTypesource ↗
CheckboxCellType: "checkbox"

Stable persisted identifier owned by the checkbox extension.

variableCheckboxErrorCodesource ↗
CheckboxErrorCode: { Conflict: "CHECKBOX_CONTENT_CONFLICT"; Invalid: "CHECKBOX_INVALID"; Limit: "CHECKBOX_RANGE_LIMIT" }

Stable checkbox diagnostic codes.

variableCheckboxGlyphRolesource ↗
CheckboxGlyphRole: { Checked: "checked"; Unchecked: "unchecked" }

Stable semantic state roles used by checkbox render targets and diagnostics.

variableCheckboxMutationLimitsource ↗
CheckboxMutationLimit: 10000

Maximum number of persisted cells one checkbox command can change.

variableCheckboxRemovalModesource ↗
CheckboxRemovalMode: { Clear: "clear"; Text: "text" }

Removal policies shared by command inputs and hosts.

variableInsertCheckboxesCommandsource ↗
InsertCheckboxesCommand: SheetCommandDefinition<InsertCheckboxesInput, SheetCommandResult>

Inserts checkbox cells in one cell-owner transaction.

variableReadCheckboxRangeQuerysource ↗
ReadCheckboxRangeQuery: SheetQueryDefinition<SheetRangeInput, CheckboxRangeStatus>

Reads sparse checkbox state without traversing every empty coordinate.

variableRemoveCheckboxesCommandsource ↗
RemoveCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { mode?: CheckboxRemovalMode }, SheetCommandResult>

Converts only existing checkbox cells to text or clears them.

variableSetCheckboxesCommandsource ↗
SetCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { checked: boolean }, SheetCommandResult>

Sets only existing checkbox cells in the range.

variableToggleCheckboxesCommandsource ↗
ToggleCheckboxesCommand: SheetCommandDefinition<SheetRangeInput, SheetCommandResult>

Checks a mixed/unchecked range, or unchecks an entirely checked range.

functioncheckboxTextsource ↗
checkboxText(value: boolean): string

Formats the boolean display, editor and clipboard representation.

value: boolean
functionisCheckboxCellsource ↗
isCheckboxCell(cell: CellMatrixElement | null | undefined): cell

Reports whether a persisted value is a well-formed checkbox.

cell: CellMatrixElement | null | undefined
functionnormalizeCheckboxRangesource ↗
normalizeCheckboxRange(input: SheetRangeInput, shape: readonly [number, number]): SheetRangeInput

Validates and orders a public range without limiting sparse read traversal by viewport.

input: SheetRangeInput
shape: readonly [number, number]
functionparseCheckboxTextsource ↗
parseCheckboxText(text: string): boolean | null

Converts explicit boolean editor text without coercing numbers or other strings.

text: string

Package

@searsuite/sear-plugin-clear-style

3 exports

Owner-composed Sheet format clearing without content deletion.

classSheetClearStylePluginsource ↗
class SheetClearStylePlugin extends Plugin<unknown, CellProperties, null>

Composes owner-defined format clearing; owns no persisted document or session state.

constructorconstructor
SheetClearStylePlugin(options: SheetClearStyleOptions): SheetClearStylePlugin
options: SheetClearStyleOptions
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(): null

Applies a transaction to plugin-owned state and returns the next state.

methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
interfaceSheetClearStyleOptionssource ↗
interface SheetClearStyleOptions

Editor-local dependencies provided by the owning composition root.

propertyformats
readonly formats: SheetFormatTransferRegistry
propertyreadShape
readonly readShape: (): readonly [number, number]
variableClearRangeStylesCommandsource ↗
ClearRangeStylesCommand: SheetCommandDefinition<SheetRangeInput, SheetCommandResult>

Clears explicit formatting from an inclusive rectangular selection, preserving cell data.

Package

@searsuite/sear-plugin-clipboard

34 exports

Type-neutral Sheet clipboard traversal, serialization, and paste commands.

enumSheetPasteModesource ↗
enum SheetPasteMode

Selects which structured clipboard channels are applied by a paste command.

enum memberAll
All: "all"
enum memberFormats
Formats: "formats"
enum memberValues
Values: "values"
classDefaultSheetClipboardCodecsource ↗
class DefaultSheetClipboardCodec extends SheetClipboardCodec

Default codec that delegates cell serialization to the cell-type registry.

constructorconstructor
DefaultSheetClipboardCodec(cellCodecs: CellClipboardCodecRegistry): DefaultSheetClipboardCodec
cellCodecs: CellClipboardCodecRegistry
methoddecode
decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRange
payload: SheetClipboardPayload
context: SheetClipboardDecodeContext
methodencode
encode(range: SheetRangeBounds, source: SheetClipboardDataSource): SheetClipboardPayload
range: SheetRangeBounds
source: SheetClipboardDataSource
classInMemorySheetClipboardsource ↗
class InMemorySheetClipboard extends SheetClipboard

Node-safe clipboard used when a host does not expose system clipboard I/O.

constructorconstructor
InMemorySheetClipboard(): InMemorySheetClipboard
propertysymbolstaticinherited
readonly symbol: typeof symbol
methodread
read(): Promise<SheetClipboardPayload | null>
methodwrite
write(payload: SheetClipboardPayload): Promise<void>
payload: SheetClipboardPayload
classSheetClipboardsource ↗
class SheetClipboard

Platform-neutral clipboard abstraction. Implementations own system I/O.

constructorconstructor
SheetClipboard(): SheetClipboard
propertysymbolstatic
readonly symbol: typeof symbol
methodread
read(): Promise<SheetClipboardPayload | null>
methodwrite
write(payload: SheetClipboardPayload): Promise<void>
payload: SheetClipboardPayload
classSheetClipboardErrorsource ↗
class SheetClipboardError extends SearError

Public error raised when a clipboard command cannot satisfy its contract.

constructorconstructor
SheetClipboardError(code: SheetClipboardErrorCode, message: string, details?: SearErrorDetails): SheetClipboardError
code: SheetClipboardErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: SheetClipboardErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetClipboardPluginsource ↗
class SheetClipboardPlugin extends Plugin<unknown, CellProperties, Record<string, never>>, PluginExtension<SheetCommandBus>

Default sheet clipboard plugin. System clipboard I/O remains a host-owned SheetClipboardPort.

constructorconstructor
SheetClipboardPlugin(source: SheetClipboardDataSource, codec: SheetClipboardCodec): SheetClipboardPlugin
source: SheetClipboardDataSource
codec: SheetClipboardCodec
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<Record<string, never>, object> | readonly PluginDocumentStateContribution<Record<string, never>, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

Applies a transaction to plugin-owned state and returns the next state.

state: Record<string, never>
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): Record<string, never>

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
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.

state: PluginStateType
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the three semantic clipboard commands on this editor's bus.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: Record<string, never> }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): []

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
interfaceSheetClipboardCodecsource ↗
interface SheetClipboardCodec

Codec extension point for clipboard envelope and external formats. Cell types register their own handlers separately.

methoddecode
decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRange
payload: SheetClipboardPayload
context: SheetClipboardDecodeContext
methodencode
encode(range: SheetRangeBounds, source: SheetClipboardDataSource): SheetClipboardPayload
range: SheetRangeBounds
source: SheetClipboardDataSource
interfaceSheetClipboardCommandResultsource ↗
interface SheetClipboardCommandResult extends SheetCommandResult

Result shared by copy and cut commands.

propertycompletioninherited
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertyeffectsinherited
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertypayload
readonly payload: SheetClipboardPayload
propertypipelineinherited
readonly pipeline: Pipeline

Pipeline containing transaction, render, interaction and local-action steps.

propertyrange
readonly range: SheetClipboardRangeInput
interfaceSheetClipboardDataSourcesource ↗
interface SheetClipboardDataSource

Data source required by the clipboard plugin; selection and storage stay replaceable.

propertyformatTarget
readonly formatTarget: PluginKey
propertytarget
readonly target: PluginKey
methodgetColumnCount
getColumnCount(): number
methodgetRowCount
getRowCount(): number
methodgetSelection
getSelection(): SheetRangeBounds | null
methodreadCell
readCell(row: number, column: number): CellMatrixElement | null
row: number
column: number
methodreadCellFormat
readCellFormat(row: number, column: number): CellFormat | null
row: number
column: number
interfaceSheetClipboardDecodeContextsource ↗
interface SheetClipboardDecodeContext

Context supplied to codecs so formula-aware implementations can rebase references on paste.

propertytarget
readonly target: SheetClipboardCellPoint
interfaceSheetClipboardDecodedRangesource ↗
interface SheetClipboardDecodedRange

Decoded value and format matrices ready for parallel paste transactions.

propertyformats
readonly formats?: readonly readonly CellFormat | null[][]

Present only when the source supplied editor-native format metadata.

propertyrows
readonly rows: readonly SheetClipboardDecodedRow[]
interfaceSheetClipboardPayloadsource ↗
interface SheetClipboardPayload

Platform-neutral clipboard data. It is transient and is not a persistence envelope.

propertyplainText
readonly plainText: string

Plain text representation suitable for external applications.

propertystructured
readonly structured?: SheetClipboardStructuredPayload

Optional editor-native representation preserving cell type and metadata.

interfaceSheetClipboardRangeInputsource ↗
interface SheetClipboardRangeInput

Inclusive range accepted by clipboard commands.

propertyend
readonly end: SheetClipboardCellPoint
propertystart
readonly start: SheetClipboardCellPoint
interfaceSheetClipboardStructuredPayloadsource ↗
interface SheetClipboardStructuredPayload

Editor-owned structured range data carried inside a clipboard payload.

propertyformats
readonly formats: readonly readonly CellFormat | null[][]

Parallel explicit-format rows. Null means General/no explicit format.

propertykind
readonly kind: "searsuite.sheet-range"
propertyrows
readonly rows: readonly SheetClipboardRow[]
propertysource
readonly source: SheetClipboardCellPoint

Original top-left coordinate, supplied to cell-type paste codecs.

propertyversion
readonly version: 3
interfaceSheetCopyRangeInputsource ↗
interface SheetCopyRangeInput

Optional explicit range; omitted means the current editor selection.

propertyrange
readonly range?: SheetClipboardRangeInput
interfaceSheetPasteRangeInputsource ↗
interface SheetPasteRangeInput

Input for pasting a previously decoded or host-read clipboard payload.

propertymode
readonly mode?: SheetPasteMode

Structured channel selection. Plain-text payloads contain values only.

propertypayload
readonly payload: SheetClipboardPayload
propertytarget
readonly target?: SheetClipboardCellPoint

Top-left target; omitted means the current selection's top-left cell.

typeSheetClipboardCellPointsource ↗
type SheetClipboardCellPoint = readonly [number, number]

A zero-based cell coordinate expressed as [row, column].

typeSheetClipboardDecodedRowsource ↗
type SheetClipboardDecodedRow = readonly CellMatrixElement | null[]

Decoded cells ready for a paste transaction.

typeSheetClipboardErrorCodesource ↗
type SheetClipboardErrorCode = typeof SheetClipboardErrorCode[keyof typeof SheetClipboardErrorCode]

Supported sheet clipboard error code values.

typeSheetClipboardPortsource ↗
type SheetClipboardPort = Pick<SheetClipboard, "read" | "write">

Structural port retained as a lightweight host-adapter contract.

typeSheetClipboardRowsource ↗
type SheetClipboardRow = readonly CellClipboardCellPayload | null[]

One row in a structured clipboard range, including empty cells.

variableCopyCommandsource ↗
CopyCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>
variableCopyRangeCommandsource ↗
CopyRangeCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>

Typed command that snapshots a range without mutating sheet state.

variableCutCommandsource ↗
CutCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>
variableCutRangeCommandsource ↗
CutRangeCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>

Typed command that snapshots and clears a range in one sheet transaction.

variablePasteCommandsource ↗
PasteCommand: SheetCommandDefinition<SheetPasteRangeInput, SheetCommandResult>
variablePasteRangeCommandsource ↗
PasteRangeCommand: SheetCommandDefinition<SheetPasteRangeInput, SheetCommandResult>

Typed command that decodes and writes a payload through the normal sheet transaction boundary.

variableSHEET_CLIPBOARD_MIME_TYPEsource ↗
SHEET_CLIPBOARD_MIME_TYPE: "application/x-searsuite-sheet-range"

MIME type that a browser adapter may use for the structured payload.

variableSHEET_CLIPBOARD_PAYLOAD_VERSIONsource ↗
SHEET_CLIPBOARD_PAYLOAD_VERSION: 3

Current version of the transient structured sheet clipboard payload.

variableSheetClipboardCodecSymbolsource ↗
SheetClipboardCodecSymbol: typeof SheetClipboardCodecSymbol

DI token for the editor-local clipboard codec.

variableSheetClipboardDataSourceSymbolsource ↗
SheetClipboardDataSourceSymbol: typeof SheetClipboardDataSourceSymbol

DI token for the editor-local clipboard data source.

variableSheetClipboardErrorCodesource ↗
SheetClipboardErrorCode: { InvalidPayload: "SEAR_SHEET_CLIPBOARD_INVALID_PAYLOAD"; NoSelection: "SEAR_SHEET_CLIPBOARD_NO_SELECTION"; TargetOutOfBounds: "SEAR_SHEET_CLIPBOARD_TARGET_OUT_OF_BOUNDS" }

Stable public errors raised by the sheet clipboard contract.

classAbstractSheetClipboardsource ↗
class AbstractSheetClipboard

Platform-neutral clipboard abstraction. Implementations own system I/O.

constructorconstructor
SheetClipboard(): SheetClipboard
propertysymbolstatic
readonly symbol: typeof symbol
methodread
read(): Promise<SheetClipboardPayload | null>
methodwrite
write(payload: SheetClipboardPayload): Promise<void>
payload: SheetClipboardPayload
variableSheetClipboardErrorCodeTypesource ↗
SheetClipboardErrorCodeType: { InvalidPayload: "SEAR_SHEET_CLIPBOARD_INVALID_PAYLOAD"; NoSelection: "SEAR_SHEET_CLIPBOARD_NO_SELECTION"; TargetOutOfBounds: "SEAR_SHEET_CLIPBOARD_TARGET_OUT_OF_BOUNDS" }

Stable public errors raised by the sheet clipboard contract.

Package

@searsuite/sear-plugin-collab

35 exports

Editor bridges that connect committed collaborative transactions to host transports.

classCollaborationChannelsource ↗
class CollaborationChannel extends CollaborationSession

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.

constructorconstructor
CollaborationChannel(transport: CollabTransport | (): CollabTransport, platform: Pick<Platform, "warn" | "createId">): CollaborationChannel
transport: CollabTransport | (): CollabTransport
platform: Pick<Platform, "warn" | "createId">
methodapplyExternalEvent
applyExternalEvent(event: CollaborationExternalEvent): void

Applies one transport event while the owning editor dispatches its command.

event: CollaborationExternalEvent
methodattachRemoteApplier
attachRemoteApplier(applier: CollaborationRemoteOperationApplier): (): void

Attaches the one currently mounted editor and replays queued remote effects in revision order.

applier: CollaborationRemoteOperationApplier
methodconnect
connect(options: CollaborationConnectOptions): Promise<void>
options: CollaborationConnectOptions
methoddestroy
destroy(): void
methoddisconnect
disconnect(): void
methodenforceCommandBoundary
enforceCommandBoundary(assertWrite: (): void, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value, dispatchExternalEvent: (event: CollaborationExternalEvent): void): void

Restricts public channel mutations after its owning editor finishes assembly.

assertWrite: (): void
runWithoutMutationAuthority: <Value>(callback: (): Value): Value
dispatchExternalEvent: (event: CollaborationExternalEvent): void
methodgetStatus
getStatus(): CollaborationStatus
methodregisterContributor
registerContributor(contribution: CollaborationContribution): void

Installs one open OT owner contract for the lifetime of this channel.

contribution: CollaborationContribution
methodsubmitLocal
submitLocal(ownerId: string, operations: readonly OTOperation[]): void

Queues a committed local operation batch through the shared collaboration engine.

ownerId: string
operations: readonly OTOperation[]
methodsubscribeStatus
subscribeStatus(listener: (status: CollaborationStatus): void): (): void
listener: (status: CollaborationStatus): void
classCollaborationChannelErrorsource ↗
class CollaborationChannelError extends SearError

Stable public failures raised by a collaboration channel host.

constructorconstructor
CollaborationChannelError(code: CollaborationChannelErrorCode, message: string, details?: Record<string, unknown>): CollaborationChannelError
code: CollaborationChannelErrorCode
message: string
details: Record<string, unknown>
propertycauseinherited
cause?: unknown
propertycode
readonly code: CollaborationChannelErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classCollabTransportsource ↗
class CollabTransport

Abstract transport layer. Swap implementations (WebSocket, BroadcastChannel,
polling, etc.) without touching the plugin logic.

constructorconstructor
CollabTransport(): CollabTransport
propertysymbolstatic
readonly symbol: symbol

DI token for resolving CollabTransport.

methodconnect
connect(options: CollaborationTransportConnectOptions): Promise<void>

Opens the collaboration transport and begins receiving messages.

options: CollaborationTransportConnectOptions
methoddisconnect
disconnect(): void

Closes the collaboration transport and releases its listeners.

methodsend
send(message: CollaborationSubmission): void

Sends one encoded collaboration message through the transport.

message: CollaborationSubmission
methodsubscribe
subscribe(handler: (message: CollaborationServerMessage): void): (): void

Subscribes to server messages and returns an idempotent disposer.

handler: (message: CollaborationServerMessage): void
classHeadlessCollabTransportsource ↗
class HeadlessCollabTransport extends CollabTransport

Collaboration transport that keeps the plugin local to the current host.

constructorconstructor
HeadlessCollabTransport(): HeadlessCollabTransport
propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessCollabTransport.

methodconnect
connect(_options: CollaborationTransportConnectOptions): Promise<void>

Opens the collaboration transport and begins receiving messages.

_options: CollaborationTransportConnectOptions
methoddisconnect
disconnect(): void

Closes the collaboration transport and releases its listeners.

methodsend
send(_message: CollaborationSubmission): void

Sends one encoded collaboration message through the transport.

_message: CollaborationSubmission
methodsubscribe
subscribe(_handler: (message: CollaborationServerMessage): void): (): void

Subscribes without producing network messages.

_handler: (message: CollaborationServerMessage): void
classSheetCollaborationPluginsource ↗
class SheetCollaborationPlugin extends Plugin<SearCoreSheet, CellProperties, null>, SheetLifecycleController, CollaborationSession

Thin Sheet bridge around the editor-independent collaboration engine.

constructorconstructor
SheetCollaborationPlugin(channelBinding: CollaborationChannelBinding, plugins: PluginManager<SearCoreSheet, CellProperties>, commands: SheetCommandBus): SheetCollaborationPlugin
channelBinding: CollaborationChannelBinding
plugins: PluginManager<SearCoreSheet, CellProperties>
commands: SheetCommandBus
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

_state: null
_transaction: Transaction
methodconnect
connect(options: CollaborationConnectOptions): Promise<void>
options: CollaborationConnectOptions
methoddestroy
destroy(): void
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methoddisconnect
disconnect(): void
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodgetStatus
getStatus(): CollaborationStatus
methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void
observations: ObservationRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstart
start(_context: SheetLifecycleContext): void
_context: SheetLifecycleContext
classWebSocketTransportsource ↗
class WebSocketTransport extends CollabTransport

Browser WebSocket implementation of CollabTransport.

The authority validates and orders submitted operation batches while this
adapter owns only WebSocket lifecycle and JSON framing.

constructorconstructor
WebSocketTransport(): WebSocketTransport
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving CollabTransport.

methodconnect
connect(options: CollaborationTransportConnectOptions): Promise<void>

Opens the collaboration transport and begins receiving messages.

options: CollaborationTransportConnectOptions
methoddisconnect
disconnect(): void

Closes the collaboration transport and releases its listeners.

methodsend
send(message: CollaborationSubmission): void

Sends one encoded collaboration message through the transport.

message: CollaborationSubmission
methodsubscribe
subscribe(handler: (message: CollaborationServerMessage): void): (): void

Subscribes to parsed server messages.

handler: (message: CollaborationServerMessage): void
interfaceCollaborationChannelBindingsource ↗
interface CollaborationChannelBinding

DI value used to distinguish editor-owned channels from host-retained channels.

propertychannel
readonly channel: CollaborationChannel
propertyowner
readonly owner: "editor" | "host"
interfaceCollaborationConnectOptionssource ↗
interface CollaborationConnectOptions
propertyresourceId
readonly resourceId: string
propertyrevision
readonly revision?: number
propertyurl
readonly url: string
interfaceCollaborationRemoteOperationssource ↗
interface CollaborationRemoteOperations

Remote operation batch delivered to the currently mounted editor bridge.

propertyoperations
readonly operations: readonly OTOperation[]
propertyownerId
readonly ownerId: string
propertyserverRevision
readonly serverRevision: number
interfaceCollaborationSessionsource ↗
interface CollaborationSession

Host-facing lifecycle API independent from a concrete editor bridge.

methodconnect
connect(options: CollaborationConnectOptions): Promise<void>
options: CollaborationConnectOptions
methoddisconnect
disconnect(): void
methodgetStatus
getStatus(): CollaborationStatus
interfaceCollaborationStatussource ↗
interface CollaborationStatus
propertyerror
readonly error: unknown
propertypendingCount
readonly pendingCount: number
propertyresourceId
readonly resourceId: string | null
propertyrevision
readonly revision: number
propertystate
readonly state: CollaborationConnectionState
interfaceCollaborationTransportConnectOptionssource ↗
interface CollaborationTransportConnectOptions

Connection parameters for one collaboration resource.

propertyresourceId
readonly resourceId: string
propertyrevision
readonly revision: number
propertyurl
readonly url: string
interfaceConnectSheetCollaborationResultsource ↗
interface ConnectSheetCollaborationResult extends SheetCommandResult

Command result that resolves when the collaboration transport is connected.

propertycompletion
readonly completion: Promise<void>

Optional asynchronous completion of a command-owned external effect.

propertyeffectsinherited
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertypipelineinherited
readonly pipeline: Pipeline

Pipeline containing transaction, render, interaction and local-action steps.

interfaceSheetApplyRemoteOperationsInputsource ↗
interface SheetApplyRemoteOperationsInput

Input for applying operations received from a collaboration transport.

propertyoperations
readonly operations: readonly Operation[]

Remote operations after local OT transformation.

propertyownerId
readonly ownerId: string

Stable collaboration owner id resolved through the local plugin registry.

typeCollaborationChannelErrorCodesource ↗
type CollaborationChannelErrorCode = typeof CollaborationChannelErrorCode[keyof typeof CollaborationChannelErrorCode]
typeCollaborationConnectionStatesource ↗
type CollaborationConnectionState = typeof CollaborationConnectionState[keyof typeof CollaborationConnectionState]

Public lifecycle state of one collaboration session.

typeCollaborationExternalEventsource ↗
type CollaborationExternalEvent = { epoch: number; kind: "connected"; resourceId: string } | { epoch: number; error: unknown; kind: "failed"; resourceId: string } | { epoch: number; kind: "message"; message: CollaborationServerMessage }

Transport event returned to the owning editor's command bus.

typeCollaborationRemoteOperationAppliersource ↗
type CollaborationRemoteOperationApplier = (effect: CollaborationRemoteOperations): void
variableApplyRemoteOperationsCommandsource ↗
ApplyRemoteOperationsCommand: SheetCommandDefinition<SheetApplyRemoteOperationsInput, SheetCommandResult>

Command that applies remote collaboration operations through the normal pipeline.

variableApplySheetCollaborationEventCommandsource ↗
ApplySheetCollaborationEventCommand: SheetCommandDefinition<CollaborationExternalEvent, SheetCommandResult>

Routes an external transport event into the owning Sheet command bus.

variableCollaborationChannelBindingsource ↗
CollaborationChannelBinding: { symbol: symbol }
variableCollaborationChannelErrorCodesource ↗
CollaborationChannelErrorCode: { AttachmentConflict: "SEAR_COLLABORATION_ATTACHMENT_CONFLICT"; BoundaryInstalled: "SEAR_COLLABORATION_BOUNDARY_INSTALLED"; ContributorConflict: "SEAR_COLLABORATION_CONTRIBUTOR_CONFLICT"; Destroyed: "SEAR_COLLABORATION_CHANNEL_DESTROYED" }
variableCollaborationConnectionStatesource ↗
CollaborationConnectionState: { Connecting: "connecting"; Disconnected: "disconnected"; Error: "error"; Online: "online" }

Public lifecycle state of one collaboration session.

variableCollaborationStatusObservationsource ↗
CollaborationStatusObservation: StateObservationDefinition<CollaborationStatus>

Editor-local collaboration connection and synchronization status.

variableConnectSheetCollaborationCommandsource ↗
ConnectSheetCollaborationCommand: SheetCommandDefinition<CollaborationConnectOptions, ConnectSheetCollaborationResult>

Starts a Sheet collaboration session through the editor command bus.

variableDisconnectSheetCollaborationCommandsource ↗
DisconnectSheetCollaborationCommand: SheetCommandDefinition<void, SheetCommandResult>

Disconnects a Sheet collaboration session through the editor command bus.

interfaceCollaborationAcceptedBatchsource ↗
interface CollaborationAcceptedBatch

Canonical operation batch accepted and ordered by the authority.

propertybaseRevision
readonly baseRevision: number
propertyclientId
readonly clientId: string
propertykind
readonly kind: "accepted"
propertyoperationId
readonly operationId: string
propertyoperationType
readonly operationType: CollaborationOperationType
propertyownerId
readonly ownerId: string
propertypayload
readonly payload: OTEncodedValue
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
propertyserverRevision
readonly serverRevision: number
variableCollaborationChannelErrorCodeTypesource ↗
CollaborationChannelErrorCodeType: { AttachmentConflict: "SEAR_COLLABORATION_ATTACHMENT_CONFLICT"; BoundaryInstalled: "SEAR_COLLABORATION_BOUNDARY_INSTALLED"; ContributorConflict: "SEAR_COLLABORATION_CONTRIBUTOR_CONFLICT"; Destroyed: "SEAR_COLLABORATION_CHANNEL_DESTROYED" }
typeCollaborationClientMessagesource ↗
type CollaborationClientMessage = CollaborationSubmission
variableCollaborationConnectionStateTypesource ↗
CollaborationConnectionStateType: { Connecting: "connecting"; Disconnected: "disconnected"; Error: "error"; Online: "online" }

Public lifecycle state of one collaboration session.

variableCollaborationProtocolVersionsource ↗
CollaborationProtocolVersion: 1

Current collaboration wire protocol version.

interfaceCollaborationRejectedMessagesource ↗
interface CollaborationRejectedMessage

Explicit authority rejection; clients must not infer recovery from dropped frames.

propertycode
readonly code: string
propertykind
readonly kind: "rejected"
propertymessage
readonly message: string
propertyoperationId
readonly operationId?: string
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
typeCollaborationServerMessagesource ↗
type CollaborationServerMessage = CollaborationAcceptedBatch | CollaborationSyncMessage | CollaborationRejectedMessage
interfaceCollaborationSubmissionsource ↗
interface CollaborationSubmission

Client submission before the authority assigns a canonical revision.

propertybaseRevision
readonly baseRevision: number
propertyclientId
readonly clientId: string
propertykind
readonly kind: "submit"
propertyoperationId
readonly operationId: string
propertyoperationType
readonly operationType: CollaborationOperationType
propertyownerId
readonly ownerId: string
propertypayload
readonly payload: OTEncodedValue
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
interfaceCollaborationSyncMessagesource ↗
interface CollaborationSyncMessage

Ordered catch-up response sent when a transport joins a resource.

propertybatches
readonly batches: readonly CollaborationAcceptedBatch[]
propertyfromRevision
readonly fromRevision: number
propertykind
readonly kind: "sync"
propertyprotocolVersion
readonly protocolVersion: 1
propertyresourceId
readonly resourceId: string
propertyserverRevision
readonly serverRevision: number

Package

@searsuite/sear-plugin-data-validation

38 exports

Sheet data validation rules, commands, queries, and editor-local evaluation.

classDataValidationEvaluatorRegistrysource ↗
class DataValidationEvaluatorRegistry

Host extension point for structured values and custom formulas.

constructorconstructor
DataValidationEvaluatorRegistry(): DataValidationEvaluatorRegistry
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Seals post-assembly writes without adding work to evaluator reads.

isExecuting: (): boolean
dispatchRemoval: (id: number): void
methodevaluate
evaluate(condition: DataValidationCondition, text: string, row: number, column: number): boolean | null
condition: DataValidationCondition
text: string
row: number
column: number
methodregister
register(kind: DataValidationKind, evaluator: DataValidationExternalEvaluator): (): void
kind: DataValidationKind
evaluator: DataValidationExternalEvaluator
methodunregister
unregister(id: number): void

Removes a registration through the owning command after assembly.

id: number
classDataValidationMatrixsource ↗
class DataValidationMatrix extends CSRMatrix<DataValidationRule[] | null>

Sparse range anchors for validation rules.

constructorconstructor
DataValidationMatrix(data?: { data: DataValidationRule[] | null[]; indices: number[]; indptr: number[] }, shape?: [number, number]): DataValidationMatrix
data: { data: DataValidationRule[] | null[]; indices: number[]; indptr: number[] }
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: DataValidationRule[] | null[]): DataValidationMatrix

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: number
The index where the new column should be inserted.
col: DataValidationRule[] | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
column: number
rules: DataValidationRule[] | null
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: DataValidationRule[] | null[]): DataValidationMatrix

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: number
The index at which to add the row.
row: DataValidationRule[] | null[]
The row to add.
methodclone
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: DataValidationRule[] | null): DataValidationRule[] | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: DataValidationRule[] | null): DataValidationRule[] | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): DataValidationMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): DataValidationMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<DataValidationRule[] | null>[]): DataValidationMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<DataValidationRule[] | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodfindRules
findRules(row: number, column: number): PositionedDataValidationRule[]
row: number
column: number
methodforEachinherited
forEach(callback: (value: DataValidationRule[] | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: DataValidationRule[] | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: DataValidationRule[] | null, 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).

callback: (value: DataValidationRule[] | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: DataValidationRule[] | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: DataValidationRule[] | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: DataValidationRule[] | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: DataValidationRule[] | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: DataValidationRule[] | null[][]): DataValidationMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: DataValidationRule[] | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): DataValidationRule[] | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetItem
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: number
The row index.
column: number
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodgetRules
getRules(): PositionedDataValidationRule[]
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): DataValidationMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodreplaceRules
replaceRules(entries: readonly PositionedDataValidationRule[]): void
entries: readonly PositionedDataValidationRule[]
methodsetDefaultValueinherited
setDefaultValue(value: DataValidationRule[] | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: DataValidationRule[] | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, rules: DataValidationRule[] | null): this
row: number
column: number
rules: DataValidationRule[] | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): DataValidationMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): DataValidationMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): DataValidationRule[] | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetDataValidationPluginsource ↗
class SheetDataValidationPlugin extends Plugin<unknown, CellProperties, SheetDataValidationPluginState>

Base contract implemented by sheet and document plugins.

Plugins own their state, declare lifecycle hooks, transform transactions into
state, and render scene nodes for their host core. Runtime packages should
extend this contract rather than reaching into Core internals.

constructorconstructor
SheetDataValidationPlugin(state: SheetDataValidationPluginState, dependencies: SheetDataValidationDependencies): SheetDataValidationPlugin
state: SheetDataValidationPluginState
dependencies: SheetDataValidationDependencies
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetDataValidationPluginState, SheetDataValidationPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetDataValidationPluginState, SheetDataValidationPluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(state: SheetDataValidationPluginState, transaction: Transaction): SheetDataValidationPluginState | null

Applies a transaction to plugin-owned state and returns the next state.

state: SheetDataValidationPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methoddispose
dispose(): void
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetDataValidationPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetDataValidationPluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetDataValidationPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetDataValidationPluginState, 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.

state: SheetDataValidationPluginState
transaction: Transaction
methodreadIssue
readIssue(row: number, column: number): DataValidationIssue | null

Returns a definite failure for the cell's current value, including values predating the rule.

row: number
column: number
methodregisterCapabilities
registerCapabilities(registry: RuntimeCapabilityRegistry): void
registry: RuntimeCapabilityRegistry
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void
registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(registry: ObservationRegistry): void
registry: ObservationRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): DataValidationMatrix; viewKey: string }[] }; key: PluginKey; state: SheetDataValidationPluginState }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWrites
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetDataValidationPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetDataValidationPluginState
commitToken: object
methodvalidate
validate(row: number, column: number, text: string): SheetCellInputValidationResult
row: number
column: number
text: string
interfaceDataValidationConditionsource ↗
interface DataValidationCondition

Type-specific settings used to evaluate a cell value.

propertydropdownMode
readonly dropdownMode?: DataValidationDropdownMode
propertyformula
readonly formula?: string
propertyintegerOnly
readonly integerOnly?: boolean
propertykind
readonly kind: DataValidationKind
propertyoperator
readonly operator?: DataValidationOperator
propertyoptions
readonly options?: readonly DataValidationOption[]
propertysecondValue
readonly secondValue?: string
propertyshowDropdownArrow
readonly showDropdownArrow?: boolean
propertysourceRange
readonly sourceRange?: { end: readonly [number, number]; start: readonly [number, number] }
propertytextMode
readonly textMode?: DataValidationTextMode
propertyvalue
readonly value?: string
interfaceDataValidationEvaluationContextsource ↗
interface DataValidationEvaluationContext
propertycolumn
readonly column: number
propertyevaluateExternal
readonly evaluateExternal?: (condition: DataValidationCondition, text: string, row: number, column: number): boolean | null

Host contribution for formula results and structured cell types. Null means unavailable.

propertyreadSourceValues
readonly readSourceValues?: (start: readonly [number, number], end: readonly [number, number]): readonly string[]
propertyrow
readonly row: number
interfaceDataValidationIssuesource ↗
interface DataValidationIssue

A definite failure of the current cell value against a validation rule.

propertycolumn
readonly column: number
propertymessage
readonly message: string
propertyrow
readonly row: number
propertyruleId
readonly ruleId: string
interfaceDataValidationOptionsource ↗
interface DataValidationOption

One displayable dropdown choice and its optional color.

propertycolor
readonly color?: string
propertylabel
readonly label: string
interfaceDataValidationRulesource ↗
interface DataValidationRule

One independently editable rule stored at the top-left cell of its range.

propertycondition
readonly condition: DataValidationCondition
propertyendColumn
readonly endColumn: number
propertyendRow
readonly endRow: number
propertyerrorMessage
readonly errorMessage?: string
propertyid
readonly id: string
propertyinputMessage
readonly inputMessage?: string
propertyinputPolicy
readonly inputPolicy: DataValidationInputPolicy
interfaceDataValidationWarningsource ↗
interface DataValidationWarning
propertycolumn
readonly column: number
propertymessage
readonly message: string
propertyrow
readonly row: number
propertyruleId
readonly ruleId: string
interfacePositionedDataValidationRulesource ↗
interface PositionedDataValidationRule

A rule with its persisted range anchor.

propertycolumn
readonly column: number
propertyrow
readonly row: number
propertyrule
readonly rule: DataValidationRule
interfaceSetDataValidationRuleInputsource ↗
interface SetDataValidationRuleInput extends SheetRangeInput

Target range and rule settings for creating or editing a rule.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertyid
readonly id?: string
propertyrule
readonly rule: Omit<DataValidationRule, "id" | "endRow" | "endColumn">
interfaceSheetDataValidationDependenciessource ↗
interface SheetDataValidationDependencies
propertycreateId
readonly createId: (): string
propertyevaluators
readonly evaluators: DataValidationEvaluatorRegistry
propertyinputValidation
readonly inputValidation: SheetCellInputValidationRegistry
propertyreadSourceValues
readonly readSourceValues?: (start: readonly [number, number], end: readonly [number, number]): readonly string[]
propertyreadValue
readonly readValue?: (row: number, column: number): unknown
propertyrequestRender
readonly requestRender?: (): void
interfaceSheetDataValidationPluginStatesource ↗
interface SheetDataValidationPluginState
propertydataValidations
readonly dataValidations: DataValidationMatrix
typeDataValidationDropdownModesource ↗
type DataValidationDropdownMode = typeof DataValidationDropdownMode[keyof typeof DataValidationDropdownMode]

Dropdown selection mode stored with a rule.

typeDataValidationExternalEvaluatorsource ↗
type DataValidationExternalEvaluator = (condition: DataValidationCondition, text: string, row: number, column: number): boolean | null
typeDataValidationInputPolicysource ↗
type DataValidationInputPolicy = typeof DataValidationInputPolicy[keyof typeof DataValidationInputPolicy]

Invalid input policy stored with a rule.

typeDataValidationKindsource ↗
type DataValidationKind = typeof DataValidationKind[keyof typeof DataValidationKind]

One supported validation value family.

typeDataValidationOperatorsource ↗
type DataValidationOperator = typeof DataValidationOperator[keyof typeof DataValidationOperator]

One comparison operator for a validation condition.

typeDataValidationTextModesource ↗
type DataValidationTextMode = typeof DataValidationTextMode[keyof typeof DataValidationTextMode]

Text comparison mode stored with a rule.

variableClearDataValidationRulesCommandsource ↗
ClearDataValidationRulesCommand: SheetCommandDefinition<{ range?: SheetRangeInput }, SheetCommandResult>

Removes every rule, or only rule fragments within a range.

variableDataValidationDropdownModesource ↗
DataValidationDropdownMode: { Multiple: "multiple"; Single: "single" }

Selection modes for dropdown validation.

variableDataValidationEvaluatorRegistryCapabilitysource ↗
DataValidationEvaluatorRegistryCapability: RuntimeCapability<DataValidationEvaluatorRegistry>
variableDataValidationInputPolicysource ↗
DataValidationInputPolicy: { Reject: "reject"; Warn: "warn" }

Action to take when an entered value does not satisfy a rule.

variableDataValidationKindsource ↗
DataValidationKind: { Attachment: "attachment"; Checkbox: "checkbox"; Date: "date"; Document: "document"; Dropdown: "dropdown"; Formula: "formula"; IdentityCard: "identityCard"; Image: "image"; … }

Supported validation value families.

variableDataValidationOperatorsource ↗
DataValidationOperator: { Between: "between"; Contains: "contains"; EndsWith: "endsWith"; Equal: "equal"; Greater: "greater"; GreaterOrEqual: "greaterOrEqual"; Less: "less"; LessOrEqual: "lessOrEqual"; … }

Comparison operators shared by numeric, date, and text validation.

variableDataValidationTextModesource ↗
DataValidationTextMode: { Content: "content"; Length: "length" }

Whether text validation compares content or character count.

variableDataValidationWarningObservationsource ↗
DataValidationWarningObservation: EventObservationDefinition<DataValidationWarning>
variableReadDataValidationCellRulesQuerysource ↗
ReadDataValidationCellRulesQuery: SheetQueryDefinition<readonly [number, number], readonly PositionedDataValidationRule[]>

Reads the rules that cover one cell.

variableReadDataValidationIssueQuerysource ↗
ReadDataValidationIssueQuery: SheetQueryDefinition<readonly [number, number], DataValidationIssue | null>

Reads a definite validation failure for the current value of one cell.

variableReadDataValidationRulesQuerysource ↗
ReadDataValidationRulesQuery: SheetQueryDefinition<void, readonly PositionedDataValidationRule[]>

Reads all persisted validation rules and their range anchors.

variableRemoveDataValidationRuleCommandsource ↗
RemoveDataValidationRuleCommand: SheetCommandDefinition<{ id: string }, SheetCommandResult>

Removes a rule by its stable identifier.

variableSetDataValidationRuleCommandsource ↗
SetDataValidationRuleCommand: SheetCommandDefinition<SetDataValidationRuleInput, SheetCommandResult>

Creates or updates a validation rule for a sheet range.

variableSheetDataValidationFieldKeysource ↗
SheetDataValidationFieldKey: "sheet.dataValidation"

Sheet data-view field contributed by the validation plugin.

variableUnregisterDataValidationEvaluatorCommandsource ↗
UnregisterDataValidationEvaluatorCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one editor-local external data-validation evaluator.

functionevaluateDataValidationsource ↗
evaluateDataValidation(condition: DataValidationCondition, text: string, context: DataValidationEvaluationContext): boolean | null

Returns null when a host-owned value type has no evaluator. Empty input is allowed.

condition: DataValidationCondition
text: string
context: DataValidationEvaluationContext
functionformatDropdownSelectionsource ↗
formatDropdownSelection(values: readonly string[]): string

Serializes labels without losing embedded commas, quotes or surrounding spaces.

values: readonly string[]
functionparseDropdownSelectionsource ↗
parseDropdownSelection(text: string): string[]

Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.

text: string
functionreadSheetDataValidationssource ↗
readSheetDataValidations(dataEngine: DataEngine): DataValidationMatrix | null

Reads the current validation matrix from the sheet data view.

dataEngine: DataEngine

Package

@searsuite/sear-plugin-dropdown

21 exports

Optional dropdown cell interactions over validation-owned rules.

classDropdownErrorsource ↗
class DropdownError extends SearError

Structured feature diagnostic.

constructorconstructor
DropdownError(code: DropdownErrorCode, message: string, details?: SearErrorDetails): DropdownError

Creates a public dropdown diagnostic.

code: DropdownErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycodeinherited
readonly code: DropdownErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetDropdownPluginsource ↗
class SheetDropdownPlugin extends Plugin<unknown, CellProperties, null>

Stateless dropdown interaction; rules and values retain their existing document owners.

constructorconstructor
SheetDropdownPlugin(options: SheetDropdownOptions): SheetDropdownPlugin

Receives owner-scoped projections and semantic transaction factories.

options: SheetDropdownOptions
propertydepth
readonly depth: -24

Handles arrows before ordinary selection.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Several stateless interaction extensions may share depth.

propertysymbolstatic
readonly symbol: typeof symbol

Editor-local service token.

memberkeyinherited
key: unknown
methodapply
apply(): null

Mutations belong to validation and cell owners.

methoddestroy
destroy(): void

Releases transient host subscriptions.

methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

No independent render configuration.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDown
onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Activates the trailing cell arrow through the public command bus.

_core: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp
onMouseUp(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Keeps an arrow release from returning focus to the cell text editor.

_core: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

Adds viewport-bounded arrows and option color layers without taking fill ownership.

registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers value changes and a transient picker request command.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(registry: ObservationRegistry): void

Host listener failures are isolated by the editor observation registry.

registry: ObservationRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Publishes a typed, current-cell query.

queries: SheetQueryRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

No duplicate document field is created.

methodrender
render(): null

Cell visual readers supply all adornments.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
interfaceDropdownCellInputsource ↗
interface DropdownCellInput

Absolute target cell; all picker reads are editor-local.

propertycolumn
readonly column: number

Zero-based column.

propertyrow
readonly row: number

Zero-based row.

interfaceDropdownCellSnapshotsource ↗
interface DropdownCellSnapshot extends DropdownCellInput

Immutable current rule and cell projection.

propertycolumninherited
readonly column: number

Zero-based column.

propertyinputMessage
readonly inputMessage?: string

Selection prompt from the validation owner.

propertymultiple
readonly multiple: boolean

Whether choices accumulate.

propertyoptions
readonly options: readonly DataValidationOption[]

Ordered, distinct current choices.

propertyrowinherited
readonly row: number

Zero-based row.

propertyruleId
readonly ruleId: string

Stable validation owner id.

propertyselected
readonly selected: readonly string[]

Current selected labels, including values absent from the rule.

propertyshowArrow
readonly showArrow: boolean

Whether the cell shows its arrow.

interfacePickDropdownOptionInputsource ↗
interface PickDropdownOptionInput extends DropdownCellInput

Target and choice to set, or toggle in multiple-selection mode.

propertycolumninherited
readonly column: number

Zero-based column.

propertylabel
readonly label: string

Option label, matched exactly against current choices.

propertyrowinherited
readonly row: number

Zero-based row.

propertyruleId
readonly ruleId?: string

Optional rule identity guards stale picker actions after configuration changes.

interfaceSheetDropdownOptionssource ↗
interface SheetDropdownOptions

Dependencies supplied by the composition root; persistent data stays with its original owners.

propertyqueries
readonly queries: SheetQueryRegistry

Editor-local query bus for validation-owner projections.

propertyvalidation
readonly validation: SheetCellInputValidationRegistry

Shared edit validation, including overlapping rules.

methodbeforeOpen
beforeOpen(): boolean

Commits active editing before pointer activation; false leaves the edit active.

methodcreateValueTransaction
createValueTransaction(row: number, column: number, text: string | null): Transaction

Plans a text or empty replacement as an ordinary cell-owner transaction.

row: number
column: number
text: string | null
methodforEachSourceValue
forEachSourceValue(start: readonly [number, number], end: readonly [number, number], visit: (value: unknown): void): void

Visits nonempty source values in provider order, including formula projections.

start: readonly [number, number]
end: readonly [number, number]
visit: (value: unknown): void
methodreadShape
readShape(): readonly [number, number]

Reads dimensions for coordinate validation.

methodreadText
readText(row: number, column: number): string

Reads display text, including formula results and structured cells.

row: number
column: number
typeDropdownErrorCodesource ↗
type DropdownErrorCode = typeof DropdownErrorCode[keyof typeof DropdownErrorCode]

One public dropdown error code.

variableClearDropdownValueCommandsource ↗
ClearDropdownValueCommand: SheetCommandDefinition<DropdownCellInput, SheetCommandResult>

Clears the cell value while retaining validation rules.

variableDropdownErrorCodesource ↗
DropdownErrorCode: { Conflict: "DROPDOWN_CONFLICT"; Invalid: "DROPDOWN_INVALID"; Limit: "DROPDOWN_LIMIT"; Stale: "DROPDOWN_STALE" }

Stable dropdown diagnostic codes.

variableDropdownLimitssource ↗
DropdownLimits: { Options: 1000; SourceValues: 10000 }

Shared option and source traversal budgets.

variableDropdownPickerRequestsource ↗
DropdownPickerRequest: EventObservationDefinition<DropdownCellInput>

Transient host request; no document or remount session state is stored.

variableOpenDropdownPickerCommandsource ↗
OpenDropdownPickerCommand: SheetCommandDefinition<DropdownCellInput, SheetCommandResult>

Requests the host picker for one current dropdown cell.

variablePickDropdownOptionCommandsource ↗
PickDropdownOptionCommand: SheetCommandDefinition<PickDropdownOptionInput, SheetCommandResult>

Picks one valid option through a cell-owner transaction.

variableReadDropdownCellQuerysource ↗
ReadDropdownCellQuery: SheetQueryDefinition<DropdownCellInput, DropdownCellSnapshot | null>

Reads the current dropdown without exposing a feature matrix.

functionassertDropdownCellsource ↗
assertDropdownCell(input: DropdownCellInput, shape: readonly number[]): void

Validates a cell before any source traversal or mutation.

input: DropdownCellInput
shape: readonly number[]
functionplanDropdownValuesource ↗
planDropdownValue(state: DropdownCellSnapshot | null, input: PickDropdownOptionInput): string | null

Computes a selection without mutating state; stale or removed choices fail explicitly.

state: DropdownCellSnapshot | null
input: PickDropdownOptionInput
functionreadDropdownCellsource ↗
readDropdownCell(input: DropdownCellInput, options: SheetDropdownOptions): DropdownCellSnapshot | null

Resolves the last covering dropdown rule and bounded, distinct choices.

input: DropdownCellInput
options: SheetDropdownOptions
variableDropdownModesource ↗
DropdownMode: { Multiple: "multiple"; Single: "single" }

Selection modes for dropdown validation.

interfaceDropdownOptionsource ↗
interface DropdownOption

One displayable dropdown choice and its optional color.

propertycolor
readonly color?: string
propertylabel
readonly label: string
functionformatDropdownSelectionsource ↗
formatDropdownSelection(values: readonly string[]): string

Serializes labels without losing embedded commas, quotes or surrounding spaces.

values: readonly string[]
functionparseDropdownSelectionsource ↗
parseDropdownSelection(text: string): string[]

Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.

text: string

Package

@searsuite/sear-plugin-duplicate

22 exports

Sparse Sheet duplicate-highlight state and duplicate row commands.

classDuplicateMatrixsource ↗
class DuplicateMatrix extends CSRMatrix<SheetDuplicateHighlight | null>

Sparse duplicate-highlight matrix. An absent cell has no duplicate marker.

constructorconstructor
DuplicateMatrix(data?: DuplicateMatrixData, shape?: [number, number]): DuplicateMatrix

Creates a sparse duplicate-highlight matrix from serialized CSR data.

data: DuplicateMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: templateLiteral | null[]): DuplicateMatrix

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: number
The index where the new column should be inserted.
col: templateLiteral | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
addItem(row: number, col: number, value: templateLiteral | null): this

Stores a duplicate highlight through the CSR API, removing the entry for null.

row: number
col: number
value: templateLiteral | null
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: templateLiteral | null[]): DuplicateMatrix

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: number
The index at which to add the row.
row: templateLiteral | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: templateLiteral | null): templateLiteral | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: templateLiteral | null): templateLiteral | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): DuplicateMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): DuplicateMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<templateLiteral | null>[]): DuplicateMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<templateLiteral | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: templateLiteral | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: templateLiteral | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: templateLiteral | null, 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).

callback: (value: templateLiteral | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: templateLiteral | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: templateLiteral | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: templateLiteral | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: templateLiteral | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: templateLiteral | null[][]): DuplicateMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: templateLiteral | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): templateLiteral | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): templateLiteral | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): DuplicateMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: templateLiteral | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: templateLiteral | null
The default value to return for missing elements
methodsetItem
setItem(row: number, col: number, value: templateLiteral | null): this

Stores a duplicate highlight. Null is represented by removing the sparse entry.

row: number
col: number
value: templateLiteral | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): DuplicateMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): DuplicateMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): templateLiteral | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetDuplicatePluginsource ↗
class SheetDuplicatePlugin extends Plugin<unknown, CellProperties, SheetDuplicatePluginState>

Plugin that owns duplicate-highlight data and duplicate row commands.

constructorconstructor
SheetDuplicatePlugin(state: SheetDuplicatePluginState, sheetData: SheetDataPlugin, cellCodecs: CellClipboardCodecRegistry): SheetDuplicatePlugin

Constructs the plugin around a shared sparse duplicate-highlight matrix.

state: SheetDuplicatePluginState
sheetData: SheetDataPlugin
cellCodecs: CellClipboardCodecRegistry
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>

SheetDuplicatePlugin owns its persisted state module.

propertyinterestedIn
interestedIn: string[]

Duplicate highlights follow direct updates and all sheet structure changes.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Duplicate-highlight transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Duplicate state is data-only and does not use render-depth diagnostics.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>

Document-state export contribution for duplicate highlights.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all duplicate plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the duplicate plugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: SheetDuplicatePluginState, transaction: Transaction): SheetDuplicatePluginState | null

Applies direct duplicate-highlight and structural matrix operations.

pluginState: SheetDuplicatePluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Duplicate state has no render-time configuration.

methodgetStateinherited
getState(): SheetDuplicatePluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetDuplicatePluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetDuplicatePluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetDuplicatePluginState, 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.

state: SheetDuplicatePluginState
transaction: Transaction
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

Contributes duplicate highlights to the shared Sheet cell visual pipeline.

registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers duplicate commands owned by this plugin.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes this owner's cell state to atomic range moves.

registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): DuplicateMatrix; viewKey: string }[] }; key: PluginKey; state: SheetDuplicatePluginState }

Registers duplicate state for commands, projections, and collaboration.

methodrender
render(): Node<CellProperties>[]

Duplicate state contributes through grid cell properties, not scene nodes.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetDuplicatePluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetDuplicatePluginState
commitToken: object
interfaceDuplicateMatrixDatasource ↗
interface DuplicateMatrixData

Serialized sparse entries accepted by DuplicateMatrix.

propertydata
readonly data: string | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetDuplicateClearInputsource ↗
interface SheetDuplicateClearInput extends SheetRangeInput

Public input for clearing duplicate highlights.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

interfaceSheetDuplicateCommandDataSourcesource ↗
interface SheetDuplicateCommandDataSource extends DuplicateRangeDataSource

State access required by duplicate commands.

propertyduplicateTarget
readonly duplicateTarget: PluginKey
propertysheetDataTarget
readonly sheetDataTarget: PluginKey
methodgetColumnCountinherited
getColumnCount(): number
methodgetRowCountinherited
getRowCount(): number
methodreadCell
readCell(row: number, column: number): CellMatrixElement | null
row: number
column: number
methodreadCellText
readCellText(cell: CellMatrixElement): string
cell: CellMatrixElement
methodreadDuplicateHighlight
readDuplicateHighlight(row: number, column: number): templateLiteral | null
row: number
column: number
interfaceSheetDuplicateDeleteInputsource ↗
interface SheetDuplicateDeleteInput extends SheetRangeInput

Public input for duplicate deletion.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertycolumns
readonly columns?: readonly number[]
propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertyheaderRow
readonly headerRow?: boolean
propertykeep
readonly keep?: SheetDuplicateKeepMode
interfaceSheetDuplicateHighlightInputsource ↗
interface SheetDuplicateHighlightInput extends SheetRangeInput

Public input for duplicate highlighting.

propertyanchorinherited
readonly anchor: SheetCellPoint

One corner of the target range.

propertycolumns
readonly columns?: readonly number[]
propertyfocusinherited
readonly focus: SheetCellPoint

Opposite corner of the target range.

propertyheaderRow
readonly headerRow?: boolean
propertyhighlight
readonly highlight: templateLiteral
interfaceSheetDuplicatePluginStatesource ↗
interface SheetDuplicatePluginState

State owned by SheetDuplicatePlugin.

propertyduplicates
duplicates: DuplicateMatrix

Sparse matrix containing duplicate highlight settings.

typeSheetDuplicateHighlightsource ↗
type SheetDuplicateHighlight = HexColor

A persisted duplicate-highlight color represented as a hexadecimal color.

typeSheetDuplicateKeepModesource ↗
type SheetDuplicateKeepMode = typeof SheetDuplicateKeepMode[keyof typeof SheetDuplicateKeepMode]

Type contract for SheetDuplicateKeepMode.

variableClearDuplicateHighlightsCommandsource ↗
ClearDuplicateHighlightsCommand: SheetCommandDefinition<SheetDuplicateClearInput, SheetCommandResult>

Public command for clearing duplicate highlights in a range.

variableDeleteDuplicateRowsCommandsource ↗
DeleteDuplicateRowsCommand: SheetCommandDefinition<SheetDuplicateDeleteInput, SheetCommandResult>

Public command for deleting duplicate row contents in a range.

variableHighlightDuplicateRowsCommandsource ↗
HighlightDuplicateRowsCommand: SheetCommandDefinition<SheetDuplicateHighlightInput, SheetCommandResult>

Public command for highlighting duplicate cell values in a range.

variableSheetDuplicateFieldKeysource ↗
SheetDuplicateFieldKey: "sheet.duplicateHighlights"

DataEngine field owned by SheetDuplicatePlugin.

variableSheetDuplicateKeepModesource ↗
SheetDuplicateKeepMode: { First: "first"; Last: "last" }

Retention mode used by DeleteDuplicateRowsCommand.

functionassertSheetDuplicateHighlightsource ↗
assertSheetDuplicateHighlight(value: unknown): value

Asserts that a value is a supported duplicate-highlight color.

value: unknown
functioncreateClearDuplicateHighlightOperationssource ↗
createClearDuplicateHighlightOperations(input: SheetDuplicateClearInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]

Creates sparse update operations that remove duplicate highlights from a range.

input: SheetDuplicateClearInput
dataSource: SheetDuplicateCommandDataSource
functioncreateDeleteDuplicateRowsOperationssource ↗
createDeleteDuplicateRowsOperations(input: SheetDuplicateDeleteInput, dataSource: SheetDuplicateCommandDataSource): DeleteRowOTOperation<CellMatrixElement>[]

Creates sheet-data operations that clear duplicate row contents in the selected range.

input: SheetDuplicateDeleteInput
dataSource: SheetDuplicateCommandDataSource
functioncreateHighlightDuplicateOperationssource ↗
createHighlightDuplicateOperations(input: SheetDuplicateHighlightInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]

Creates sparse update operations for duplicate-value highlighting.

input: SheetDuplicateHighlightInput
dataSource: SheetDuplicateCommandDataSource
functionisSheetDuplicateHighlightsource ↗
isSheetDuplicateHighlight(value: unknown): value

Returns whether a value is a supported duplicate-highlight color.

value: unknown
functionreadSheetDuplicateHighlightssource ↗
readSheetDuplicateHighlights(dataEngine: DataEngine): DuplicateMatrix | null

Reads duplicate highlights published by SheetDuplicatePlugin.

dataEngine: DataEngine
functionregisterSheetDuplicateCommandssource ↗
registerSheetDuplicateCommands(commands: SheetCommandBus, dataSource: SheetDuplicateCommandDataSource): void

Registers duplicate commands owned by SheetDuplicatePlugin.

commands: SheetCommandBus
dataSource: SheetDuplicateCommandDataSource

Package

@searsuite/sear-plugin-export-node

5 exports

Node CSV and XLSX adapters for Workbook document states.

interfaceNodeCsvWorkbookImportOptionssource ↗
interface NodeCsvWorkbookImportOptions
propertysheetId
readonly sheetId?: string
propertysheetName
readonly sheetName?: string
propertyworkbookId
readonly workbookId: string
functionexportNodeCsvSheetsource ↗
exportNodeCsvSheet(state: WorkbookDocumentState<SheetDocumentState>, sheetId: string): string

Exports one Workbook sheet as CSV, preserving formula source text.

state: WorkbookDocumentState<SheetDocumentState>
sheetId: string
functionexportNodeXlsxWorkbooksource ↗
exportNodeXlsxWorkbook(state: WorkbookDocumentState<SheetDocumentState>): Promise<Uint8Array<ArrayBufferLike>>

Writes Workbook formula sources and scalar values to an XLSX buffer.

state: WorkbookDocumentState<SheetDocumentState>
functionimportNodeCsvWorkbooksource ↗
importNodeCsvWorkbook(text: string, options: NodeCsvWorkbookImportOptions): WorkbookDocumentState<SheetDocumentState>

Imports one CSV table as a single-sheet Workbook document.

text: string
options: NodeCsvWorkbookImportOptions
functionimportNodeXlsxWorkbooksource ↗
importNodeXlsxWorkbook(bytes: Uint8Array, workbookId: string): Promise<WorkbookDocumentState<SheetDocumentState>>

Reads values and formula sources from an XLSX buffer into a Workbook document.

bytes: Uint8Array
workbookId: string

Package

@searsuite/sear-plugin-export

16 exports

Versioned export envelopes, document-state codec registries, and durable persistence boundaries.

classDocumentStateCodecRegistrysource ↗
class DocumentStateCodecRegistry<TState>

Registry that composes document-state modules without central field enumeration.

constructorconstructor
DocumentStateCodecRegistry<TState>(): DocumentStateCodecRegistry<TState>
methoddeserialize
deserialize(modules: readonly SearDocumentStateModuleFile[], path: string): Partial<TState>

Deserializes registered modules into one partial document state.

modules: readonly SearDocumentStateModuleFile[]
path: string
methodregister
register(codec: DocumentStateCodec<TState>): this

Registers a module codec. Duplicate keys are rejected.

codec: DocumentStateCodec<TState>
methodregisterContribution
registerContribution(contribution: DocumentStateModuleContribution<unknown, object>): this

Registers the codec from a plugin-owned document-state contribution.

contribution: DocumentStateModuleContribution<unknown, object>
methodserialize
serialize(state: TState): SearDocumentStateModuleFile[]

Serializes every registered module whose codec returns a payload.

state: TState
classExportErrorsource ↗
class ExportError extends SearError

Error thrown when a persisted workbook payload cannot be encoded or decoded.

constructorconstructor
ExportError(code: ExportErrorCode, message: string, details?: SearErrorDetails): ExportError

Creates an ExportError instance.

code: ExportErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: ExportErrorCode

Stable machine-readable error code.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
interfaceDocumentStateCodecsource ↗
interface DocumentStateCodec<TState>

Codec contributed by the owner of one document-state module.

propertykey
readonly key: string

Stable module key written to persisted files.

methoddeserialize
deserialize(payload: JsonValue, path: string): Partial<TState>

Restores the module-owned part of a document state.

payload: JsonValue
path: string
methodserialize
serialize(state: TState): unknown

Serializes the module-owned part of a document state.

state: TState
interfaceDocumentStateModuleContributionsource ↗
interface DocumentStateModuleContribution<TOwnerState, TDocumentState>

Export contribution owned by one document-state owner.

propertycodec
readonly codec: DocumentStateCodec<TDocumentState>

JSON codec used for this module in stable export files.

propertykey
readonly key: string

Stable module key written to persisted files.

methodcapture
capture(ownerState: TOwnerState): Partial<TDocumentState> | undefined

Captures this owner state into the aggregate document-state snapshot.

ownerState: TOwnerState
interfaceSearDocumentStateModuleFilesource ↗
interface SearDocumentStateModuleFile

One registered document-state module in a stable export file.

propertykey
readonly key: string

Stable module key owned by the state owner, such as sheet.data.

propertypayload
readonly payload: JsonValue

Module-owned JSON payload.

interfaceSearFormulaBindingFilesource ↗
interface SearFormulaBindingFile

One formula cell's workbook-qualified reference targets.

propertycol
readonly col: number
propertyformula
readonly formula: string
propertyreferences
readonly references: readonly { sheetId: string; sheetName: string }[]
propertyrow
readonly row: number
propertysheetId
readonly sheetId: string
interfaceSearSheetDocumentFilesource ↗
interface SearSheetDocumentFile

Stable persisted representation of one Sheet document state.

propertykind
readonly kind: "sheet"

Sheet payload kind.

propertymodules
readonly modules: readonly SearDocumentStateModuleFile[]

Registered document-state modules.

interfaceSearWorkbookFilesource ↗
interface SearWorkbookFile<TSheetDescriptor>

Stable persisted representation of a Workbook document state.

propertyformat
readonly format: "searsuite.workbook"

Stable file-format identifier.

propertyworkbook
readonly workbook: { formulaBindings?: readonly SearFormulaBindingFile[]; id: string; metadata?: Readonly<Record<string, JsonValue>>; sheets: readonly TSheetDescriptor[]; sheetStates: Readonly<Record<string, SearSheetDocumentFile>> }

Persisted workbook document state.

typeExportErrorCodesource ↗
type ExportErrorCode = typeof ExportErrorCode[keyof typeof ExportErrorCode]

Machine-readable export error code type.

typeJsonValuesource ↗
type JsonValue = null | boolean | number | string | readonly JsonValue[] | { }

JSON-compatible scalar or object value.

variableExportErrorCodesource ↗
ExportErrorCode: { codecNotFound: "SEAR_EXPORT_CODEC_NOT_FOUND"; duplicateCodec: "SEAR_EXPORT_DUPLICATE_CODEC"; invalidFormat: "SEAR_EXPORT_INVALID_FORMAT" }

Stable machine-readable error codes owned by the export plugin.

variableSearWorkbookFileFormatsource ↗
SearWorkbookFileFormat: "searsuite.workbook"

Current stable workbook JSON format identifier.

functioncloneJsonRecordsource ↗
cloneJsonRecord(value: Readonly<Record<string, unknown>> | undefined, path: string): Readonly<Record<string, JsonValue>> | undefined

Narrows a runtime value to a JSON-compatible metadata record.

value: Readonly<Record<string, unknown>> | undefined
path: string
functioncloneJsonValuesource ↗
cloneJsonValue<TValue>(value: TValue, path?: string): TValue

Clones a JSON-compatible value and rejects values that cannot be persisted as JSON.

value: TValue
path: string
functionreadRecordsource ↗
readRecord(value: unknown, path: string): Record<string, unknown>

Narrows a runtime value to a plain object.

value: unknown
path: string
variableExportErrorCodeValuesource ↗
ExportErrorCodeValue: { codecNotFound: "SEAR_EXPORT_CODEC_NOT_FOUND"; duplicateCodec: "SEAR_EXPORT_DUPLICATE_CODEC"; invalidFormat: "SEAR_EXPORT_INVALID_FORMAT" }

Stable machine-readable error codes owned by the export plugin.

Package

@searsuite/sear-plugin-filter

30 exports

Sheet range filtering with independent rules and row visibility.

classSheetFilterMatrixsource ↗
class SheetFilterMatrix extends CSRMatrix<SheetFilterDefinition | null>

One sparse anchor holds the current range and its column rules.

constructorconstructor
SheetFilterMatrix(data?: { data: SheetFilterDefinition | null[]; indices: number[]; indptr: number[] }): SheetFilterMatrix
data: { data: SheetFilterDefinition | null[]; indices: number[]; indptr: number[] }
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: SheetFilterDefinition | null[]): SheetFilterMatrix

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: number
The index where the new column should be inserted.
col: SheetFilterDefinition | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
column: number
value: SheetFilterDefinition | null
The value to add.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: SheetFilterDefinition | null[]): SheetFilterMatrix

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: number
The index at which to add the row.
row: SheetFilterDefinition | null[]
The row to add.
methodclone
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: SheetFilterDefinition | null): SheetFilterDefinition | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: SheetFilterDefinition | null): SheetFilterDefinition | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetFilterMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): SheetFilterMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<SheetFilterDefinition | null>[]): SheetFilterMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<SheetFilterDefinition | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: SheetFilterDefinition | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: SheetFilterDefinition | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: SheetFilterDefinition | null, 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).

callback: (value: SheetFilterDefinition | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: SheetFilterDefinition | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: SheetFilterDefinition | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: SheetFilterDefinition | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: SheetFilterDefinition | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: SheetFilterDefinition | null[][]): SheetFilterMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: SheetFilterDefinition | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): SheetFilterDefinition | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetItem
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: number
The row index.
column: number
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): SheetFilterMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: SheetFilterDefinition | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: SheetFilterDefinition | null
The default value to return for missing elements
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): SheetFilterMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): SheetFilterMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): SheetFilterDefinition | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetFilterPluginsource ↗
class SheetFilterPlugin extends Plugin<unknown, CellProperties, SheetFilterPluginState>, SheetRowVisibility

Owns persisted filter rules and a derived, editor-local row visibility view.

constructorconstructor
SheetFilterPlugin(state: SheetFilterPluginState, dependencies: SheetFilterDependencies): SheetFilterPlugin
state: SheetFilterPluginState
dependencies: SheetFilterDependencies
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetFilterPluginState, SheetFilterPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetFilterPluginState, SheetFilterPluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberactive
active: unknown
memberkeyinherited
key: unknown
memberversion
version: unknown
methodapply
apply(state: SheetFilterPluginState, transaction: Transaction): SheetFilterPluginState | null

Applies a transaction to plugin-owned state and returns the next state.

state: SheetFilterPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methoddispose
dispose(): void
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetFilterPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodisRowFiltered
isRowFiltered(row: number): boolean
row: number
methodlockCommittedStateinherited
lockCommittedState(state: SheetFilterPluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetFilterPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetFilterPluginState, 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.

state: SheetFilterPluginState
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void
registry: SessionStateRegistry
methodregisterState
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.

methodrender
render(): []

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetFilterPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetFilterPluginState
commitToken: object
interfaceCreateSheetFilterInputsource ↗
interface CreateSheetFilterInput

Sheet range and header policy for a new filter or private view.

propertyfirstRowIsHeader
readonly firstRowIsHeader?: boolean

Treat the first row as a header when true.

propertyrange
readonly range: { end: readonly [number, number]; start: readonly [number, number] }

Inclusive range to filter.

interfaceReadSheetFilterValuesInputsource ↗
interface ReadSheetFilterValuesInput

Parameters for a bounded distinct-value query.

propertycolumn
readonly column: number
propertylimit
readonly limit?: number
interfaceSetSheetColumnFilterInputsource ↗
interface SetSheetColumnFilterInput

Sets or clears a predicate for one column.

propertycolumn
readonly column: number
propertypredicate
readonly predicate: SheetFilterPredicate | null
interfaceSheetFilterColumnRulesource ↗
interface SheetFilterColumnRule

A rule attached to one column within a filter range.

propertycolumn
readonly column: number

Zero-based sheet column index.

propertypredicate
readonly predicate: SheetFilterPredicate

Predicate applied to values in the column.

interfaceSheetFilterDefinitionsource ↗
interface SheetFilterDefinition

Document or private-session filter configuration for one sheet range.

propertyfirstRowIsHeader
readonly firstRowIsHeader: boolean

Whether the first row is always visible as a header.

propertyprivateView
readonly privateView: boolean

Whether this definition belongs to the current editor session.

propertyrange
readonly range: { end: readonly [number, number]; start: readonly [number, number] }

Inclusive sheet coordinates covered by the filter.

propertyrules
readonly rules: readonly SheetFilterColumnRule[]

Active column predicates.

interfaceSheetFilterDependenciessource ↗
interface SheetFilterDependencies extends Omit<SheetFilterCommandSource, "target" | "readMatrix" | "readActiveDefinition" | "readPrivateDefinition" | "setPrivateDefinition" | "normalizeSearch">

Host-neutral dependencies supplied by a Sheet composition root.

propertydataTarget
readonly dataTarget?: PluginKey
propertydisplayedValueChanges
readonly displayedValueChanges?: Pick<SheetDisplayedValueChanges, "subscribe">
propertyinvalidateVisibilityAggregates
readonly invalidateVisibilityAggregates?: (): void
propertyparseDate
readonly parseDate?: (value: unknown): number | null
propertyplatform
readonly platform: Pick<Platform, "toLowerCase">
propertyreadColor
readonly readColor: (row: number, column: number, property: "fill" | "textColor"): string | null
propertyrenderKeysinherited
renderKeys?: (): readonly PluginKey[]
propertyrequestRenderAll
readonly requestRenderAll?: (): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, column: number, endRow: number, visit: (row: number): void): void
startRow: number
column: number
endRow: number
visit: (row: number): void
methodreadShapeinherited
readShape(): readonly [number, number]
methodreadValueinherited
readValue(row: number, column: number): unknown
row: number
column: number
interfaceSheetFilterPluginStatesource ↗
interface SheetFilterPluginState

Persisted state owned by the filter plugin.

propertyfilters
readonly filters: SheetFilterMatrix
interfaceSheetFilterValueCountsource ↗
interface SheetFilterValueCount

One distinct displayed value and its occurrence count.

propertycount
readonly count: number
propertyvalue
readonly value: string
interfaceSheetFilterValuePagesource ↗
interface SheetFilterValuePage

Bounded distinct-value query result for a filter column.

propertyitems
readonly items: readonly SheetFilterValueCount[]

Matching values returned within the requested limit.

propertytruncated
readonly truncated: boolean

Whether additional matching values were omitted.

typeSheetFilterCategorysource ↗
type SheetFilterCategory = typeof SheetFilterCategory[keyof typeof SheetFilterCategory]

A condition filter's value category.

typeSheetFilterColorPropertysource ↗
type SheetFilterColorProperty = typeof SheetFilterColorProperty[keyof typeof SheetFilterColorProperty]

A cell visual property used by a color filter.

typeSheetFilterKindsource ↗
type SheetFilterKind = typeof SheetFilterKind[keyof typeof SheetFilterKind]

Supported filter rule kinds.

typeSheetFilterOperatorsource ↗
type SheetFilterOperator = typeof SheetFilterOperator[keyof typeof SheetFilterOperator]

A comparison operator supported by the filter plugin.

typeSheetFilterPredicatesource ↗
type SheetFilterPredicate = { excluded?: boolean; kind: typeof SheetFilterKind.Values; values: readonly string[] } | { category: SheetFilterCategory; kind: typeof SheetFilterKind.Condition; operator: SheetFilterOperator; secondValue?: string; value: string } | { color: string | null; kind: typeof SheetFilterKind.Color; property: SheetFilterColorProperty }

Serializable rule used to decide whether a row remains visible.

variableClearSheetFilterCommandsource ↗
ClearSheetFilterCommand: SheetCommandDefinition<void, SheetCommandResult>

Clears the active filter or private view.

variableCreateSheetFilterCommandsource ↗
CreateSheetFilterCommand: SheetCommandDefinition<CreateSheetFilterInput, SheetCommandResult>

Creates a document-owned filter range.

variableCreateSheetFilterViewCommandsource ↗
CreateSheetFilterViewCommand: SheetCommandDefinition<CreateSheetFilterInput, SheetCommandResult>

Creates a session-owned filter view.

variableReadSheetFilterQuerysource ↗
ReadSheetFilterQuery: SheetQueryDefinition<void, SheetFilterDefinition | null>

Reads the active filter definition.

variableReadSheetFilterValuesQuerysource ↗
ReadSheetFilterValuesQuery: SheetQueryDefinition<ReadSheetFilterValuesInput, SheetFilterValuePage>

Reads a bounded page of distinct displayed values in one column.

variableReapplySheetFilterCommandsource ↗
ReapplySheetFilterCommand: SheetCommandDefinition<void, SheetCommandResult>

Recomputes visibility for the active filter.

variableSetSheetColumnFilterCommandsource ↗
SetSheetColumnFilterCommand: SheetCommandDefinition<SetSheetColumnFilterInput, SheetCommandResult>

Replaces or clears one column predicate.

variableSheetFilterCategorysource ↗
SheetFilterCategory: { Date: "date"; Number: "number"; Text: "text" }

Value categories supported by condition filters.

variableSheetFilterColorPropertysource ↗
SheetFilterColorProperty: { Fill: "fill"; Text: "textColor" }

Cell visual properties available to color filters.

variableSheetFilterKindsource ↗
SheetFilterKind: { Color: "color"; Condition: "condition"; Values: "values" }

Persisted filter modes owned by this plugin.

variableSheetFilterOperatorsource ↗
SheetFilterOperator: { Between: "between"; Contains: "contains"; EndsWith: "endsWith"; Equal: "equal"; Greater: "greater"; GreaterEqual: "greaterEqual"; Less: "less"; LessEqual: "lessEqual"; … }

Operators available to condition filters.

variableSheetFilterViewSessionStateDefinitionsource ↗
SheetFilterViewSessionStateDefinition: SessionStateDefinition<SheetFilterDefinition | null>

Session-state contribution for a private filter view.

variableSheetRowVisibilityFieldKeysource ↗
SheetRowVisibilityFieldKey: "sheet.filter.rowVisibility"

Neutral field contract re-exported by the plugin that owns the contribution.

functionsheetFilterValueKeysource ↗
sheetFilterValueKey(value: unknown): string

Uses display values for distinct-value selection, including an explicit blank key.

value: unknown

Package

@searsuite/sear-plugin-find-replace

28 exports

Sparse, typed Sheet find and replace.

classSheetFindReplaceErrorsource ↗
class SheetFindReplaceError extends SearError

Diagnostic error surfaced to hosts by find and replace commands or queries.

constructorconstructor
SheetFindReplaceError(code: SheetFindReplaceErrorCode, message: string, details?: SearErrorDetails): SheetFindReplaceError
code: SheetFindReplaceErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: SheetFindReplaceErrorCode

Stable error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetFindReplacePluginsource ↗
class SheetFindReplacePlugin extends Plugin<unknown, CellProperties, null>

Stateless Sheet feature; matches always read the current staged data owner.

constructorconstructor
SheetFindReplacePlugin(data: SheetDataPlugin, codecs: CellClipboardCodecRegistry, commits: CellCommitStrategyRegistry, projection?: Pick<SheetFindSource, "readValue" | "forEachProjectedValueInRange">): SheetFindReplacePlugin
data: SheetDataPlugin
codecs: CellClipboardCodecRegistry
commits: CellCommitStrategyRegistry
projection: Pick<SheetFindSource, "readValue" | "forEachProjectedValueInRange">
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

_state: null
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterState
registerState(): { key: PluginKey; state: null }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): []

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
interfaceSheetFindInputsource ↗
interface SheetFindInput

Query options shared by navigation and replacement.

propertycontent
readonly content?: SheetFindContent

Whether to read displayed values or formula source.

propertyentireCell
readonly entireCell?: boolean

Requires the search text to equal the entire cell text.

propertymatchCase
readonly matchCase?: boolean

Enables case-sensitive matching.

propertyorder
readonly order?: SheetFindOrder

Cell traversal order.

propertyrange
readonly range?: SheetFindRange

Limits search to an inclusive rectangular cell range.

propertytext
readonly text: string

Literal text to search for; an empty string produces no matches.

interfaceSheetFindMatchsource ↗
interface SheetFindMatch

One occurrence, with UTF-16 offsets within the cell's searched text.

propertycolumn
readonly column: number

Zero-based column coordinate.

propertyend
readonly end: number

Exclusive UTF-16 offset.

propertyrow
readonly row: number

Zero-based row coordinate.

propertystart
readonly start: number

Inclusive UTF-16 offset.

propertytext
readonly text: string

Searched cell text at query time.

interfaceSheetFindPagesource ↗
interface SheetFindPage

Match window and its position in the complete result set.

propertymatches
readonly matches: readonly SheetFindMatch[]
propertyrevision
readonly revision: number
propertystartIndex
readonly startIndex: number
propertytotal
readonly total: number
interfaceSheetFindPageInputsource ↗
interface SheetFindPageInput extends SheetFindInput

A bounded window of matches in the requested traversal order.

propertybackward
readonly backward?: boolean

Reads the matches preceding the cursor when set.

propertycontentinherited
readonly content?: SheetFindContent

Whether to read displayed values or formula source.

propertycursor
readonly cursor?: Pick<SheetFindMatch, "start" | "row" | "column">

Exclusive position from which to continue.

propertyentireCellinherited
readonly entireCell?: boolean

Requires the search text to equal the entire cell text.

propertyexpectedRevision
readonly expectedRevision?: number

Rejects a cursor created before the Sheet data changed.

propertylimit
readonly limit: number

Maximum number of matches returned.

propertymatchCaseinherited
readonly matchCase?: boolean

Enables case-sensitive matching.

propertyorderinherited
readonly order?: SheetFindOrder

Cell traversal order.

propertyrangeinherited
readonly range?: SheetFindRange

Limits search to an inclusive rectangular cell range.

propertytextinherited
readonly text: string

Literal text to search for; an empty string produces no matches.

interfaceSheetFindRangesource ↗
interface SheetFindRange

Inclusive cell bounds for a Sheet search.

propertyend
readonly end: readonly [number, number]

Last row and column.

propertystart
readonly start: readonly [number, number]

First row and column.

interfaceSheetFindReplaceSourcesource ↗
interface SheetFindReplaceSource extends SheetFindSource

Search source plus the cell commit policy used for replacements.

propertycodecsinherited
readonly codecs: Pick<CellClipboardCodecRegistry, "toPlainText">
propertycommitStrategies
readonly commitStrategies: Pick<CellCommitStrategyRegistry, "commit">
propertyforEachProjectedValueInRangeinherited
readonly forEachProjectedValueInRange?: (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void
propertygetRevisioninherited
readonly getRevision?: (): number
propertymatrixinherited
readonly matrix: CSRMatrix<CellMatrixElement>
propertyreadValueinherited
readonly readValue?: (row: number, column: number, cell: CellMatrixElement | null): unknown
interfaceSheetFindSourcesource ↗
interface SheetFindSource

Sparse cells and optional projected values visible to a Sheet search.

propertycodecs
readonly codecs: Pick<CellClipboardCodecRegistry, "toPlainText">
propertyforEachProjectedValueInRange
readonly forEachProjectedValueInRange?: (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void
propertygetRevision
readonly getRevision?: (): number
propertymatrix
readonly matrix: CSRMatrix<CellMatrixElement>
propertyreadValue
readonly readValue?: (row: number, column: number, cell: CellMatrixElement | null): unknown
interfaceSheetReplaceInputsource ↗
interface SheetReplaceInput extends SheetFindInput

Replacement options shared by single and bulk commands.

propertycontentinherited
readonly content?: SheetFindContent

Whether to read displayed values or formula source.

propertyentireCellinherited
readonly entireCell?: boolean

Requires the search text to equal the entire cell text.

propertymatchCaseinherited
readonly matchCase?: boolean

Enables case-sensitive matching.

propertyorderinherited
readonly order?: SheetFindOrder

Cell traversal order.

propertyrangeinherited
readonly range?: SheetFindRange

Limits search to an inclusive rectangular cell range.

propertyreplacement
readonly replacement: string

Literal text inserted for each matching occurrence.

propertytextinherited
readonly text: string

Literal text to search for; an empty string produces no matches.

interfaceSheetReplaceOneInputsource ↗
interface SheetReplaceOneInput extends SheetReplaceInput

Replaces one match returned by the find query.

propertycontentinherited
readonly content?: SheetFindContent

Whether to read displayed values or formula source.

propertyentireCellinherited
readonly entireCell?: boolean

Requires the search text to equal the entire cell text.

propertymatch
readonly match: SheetFindMatch

Selected occurrence, including the cell text observed by the find query.

propertymatchCaseinherited
readonly matchCase?: boolean

Enables case-sensitive matching.

propertyorderinherited
readonly order?: SheetFindOrder

Cell traversal order.

propertyrangeinherited
readonly range?: SheetFindRange

Limits search to an inclusive rectangular cell range.

propertyreplacementinherited
readonly replacement: string

Literal text inserted for each matching occurrence.

propertytextinherited
readonly text: string

Literal text to search for; an empty string produces no matches.

typeSheetFindContentsource ↗
type SheetFindContent = typeof SheetFindContent[keyof typeof SheetFindContent]

Supported cell content projections for search.

typeSheetFindOrdersource ↗
type SheetFindOrder = typeof SheetFindOrder[keyof typeof SheetFindOrder]

Supported match traversal orders.

typeSheetFindReplaceErrorCodesource ↗
type SheetFindReplaceErrorCode = typeof SheetFindReplaceErrorCode[keyof typeof SheetFindReplaceErrorCode]

Public code union for diagnostic find/replace failures.

variableFindSheetMatchesQuerysource ↗
FindSheetMatchesQuery: SheetQueryDefinition<SheetFindInput, readonly SheetFindMatch[]>

Reads matching occurrences from current Sheet state.

variableFindSheetMatchPageQuerysource ↗
FindSheetMatchPageQuery: SheetQueryDefinition<SheetFindPageInput, SheetFindPage>

Reads a bounded window and total count without retaining all matches.

variableMAX_SHEET_FIND_PAGE_SIZEsource ↗
MAX_SHEET_FIND_PAGE_SIZE: 200

Bounds the memory used by a single Sheet search page.

variableReadSheetFindRevisionQuerysource ↗
ReadSheetFindRevisionQuery: SheetQueryDefinition<void, number>

Reads the revision used to invalidate cached result windows.

variableReplaceAllSheetMatchesCommandsource ↗
ReplaceAllSheetMatchesCommand: SheetCommandDefinition<SheetReplaceInput, SheetCommandResult>

Replaces all matching occurrences in one Sheet transaction.

variableReplaceSheetMatchCommandsource ↗
ReplaceSheetMatchCommand: SheetCommandDefinition<SheetReplaceOneInput, SheetCommandResult>

Replaces one selected occurrence in a Sheet transaction.

variableSheetFindContentsource ↗
SheetFindContent: { Formula: "formula"; Value: "value" }

The source searched in a cell.

variableSheetFindOrdersource ↗
SheetFindOrder: { Columns: "columns"; Rows: "rows" }

Row-major or column-major traversal of matching cells.

variableSheetFindReplaceErrorCodesource ↗
SheetFindReplaceErrorCode: { CrossBlockReplacement: "SHEET_FIND_CROSS_BLOCK_REPLACEMENT"; InvalidPage: "SHEET_FIND_INVALID_PAGE"; InvalidRange: "SHEET_FIND_INVALID_RANGE"; InvalidRichText: "SHEET_FIND_INVALID_RICH_TEXT"; StaleResults: "SHEET_FIND_STALE_RESULTS" }

Stable failure categories for Sheet find and replace.

functionfindSheetMatchessource ↗
findSheetMatches(input: SheetFindInput, source: SheetFindSource): SheetFindMatch[]

Collects all occurrences for callers that need the complete result.

input: SheetFindInput
source: SheetFindSource
functionfindSheetMatchPagesource ↗
findSheetMatchPage(input: SheetFindPageInput, source: SheetFindSource): SheetFindPage

Finds a bounded window while still reporting the complete match count.

input: SheetFindPageInput
source: SheetFindSource
functionregisterSheetFindReplaceCommandssource ↗
registerSheetFindReplaceCommands(commands: SheetCommandBus, source: SheetFindReplaceSource): void

Publishes single and bulk replace commands for a Sheet plugin.

commands: SheetCommandBus
source: SheetFindReplaceSource
functionregisterSheetFindReplaceQueriessource ↗
registerSheetFindReplaceQueries(queries: SheetQueryRegistry, source: SheetFindReplaceSource): void

Publishes the typed find query for a Sheet plugin.

queries: SheetQueryRegistry
source: SheetFindReplaceSource
functionreplaceSheetMatchessource ↗
replaceSheetMatches(input: SheetReplaceInput | SheetReplaceOneInput, source: SheetFindReplaceSource, one: boolean): UpdateCellOTOperation<CellMatrixElement | null>[]

Builds one operation per changed cell for a single undoable transaction.

input: SheetReplaceInput | SheetReplaceOneInput
source: SheetFindReplaceSource
one: boolean

Package

@searsuite/sear-plugin-fixed-row

11 exports

Sparse fixed-row state, structural transforms, visual projection, collaboration, and export.

classFixedRowMatrixsource ↗
class FixedRowMatrix extends CSRMatrix<boolean | null>

Sparse one-by-row-count matrix whose stored true values identify fixed rows.

constructorconstructor
FixedRowMatrix(data?: FixedRowMatrixData, shape?: [number, number]): FixedRowMatrix
data: FixedRowMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: boolean | null[]): FixedRowMatrix

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: number
The index where the new column should be inserted.
col: boolean | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
column: number
value: boolean | null
The value to add.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: boolean | null[]): FixedRowMatrix

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: number
The index at which to add the row.
row: boolean | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: boolean | null): boolean | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: boolean | null): boolean | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): FixedRowMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): FixedRowMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<boolean | null>[]): FixedRowMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<boolean | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: boolean | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: boolean | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: boolean | null, 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).

callback: (value: boolean | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: boolean | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: boolean | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: boolean | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: boolean | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: boolean | null[][]): FixedRowMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: boolean | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): boolean | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): boolean | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): FixedRowMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: boolean | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: boolean | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, value: boolean | null): this

Stores true sparsely; false and null clear the row's fixed state.

row: number
column: number
value: boolean | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): FixedRowMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): FixedRowMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): boolean | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetFixedRowPluginsource ↗
class SheetFixedRowPlugin extends Plugin<unknown, CellProperties, SheetFixedRowPluginState>

Owns fixed-row data, commands, structural projections, export, history, and collaboration.

constructorconstructor
SheetFixedRowPlugin(state: SheetFixedRowPluginState): SheetFixedRowPlugin
state: SheetFixedRowPluginState
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetFixedRowPluginState, SheetFixedRowPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetFixedRowPluginState, SheetFixedRowPluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(state: SheetFixedRowPluginState, transaction: Transaction): SheetFixedRowPluginState | null

Applies direct fixed-row updates and projects sheet row structure changes.

state: SheetFixedRowPluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetFixedRowPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetFixedRowPluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetFixedRowPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetFixedRowPluginState, 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.

state: SheetFixedRowPluginState
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the public command that fixes or unfixes a row range.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): FixedRowMatrix; viewKey: string }[] }; key: PluginKey; state: SheetFixedRowPluginState }

Publishes the plugin-owned matrix as a read-only Sheet data-view field.

methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetFixedRowPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetFixedRowPluginState
commitToken: object
interfaceFixedRowMatrixDatasource ↗
interface FixedRowMatrixData

Serialized sparse storage accepted by FixedRowMatrix.

propertydata
readonly data: boolean | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetFixedRowCommandDataSourcesource ↗
interface SheetFixedRowCommandDataSource

Fixed-row state needed to validate and create invertible command operations.

propertytarget
readonly target: PluginKey
methodgetRowCount
getRowCount(): number
methodisRowFixed
isRowFixed(index: number): boolean
index: number
interfaceSheetFixedRowPluginStatesource ↗
interface SheetFixedRowPluginState

State owned exclusively by SheetFixedRowPlugin.

propertyfixedRows
readonly fixedRows: FixedRowMatrix
interfaceSheetSetRowsFixedInputsource ↗
interface SheetSetRowsFixedInput

Public input for fixing or unfixing rows.

propertycount
readonly count?: number
propertyfixed
readonly fixed: boolean
propertyindex
readonly index: number
variableSetSheetRowsFixedCommandsource ↗
SetSheetRowsFixedCommand: SheetCommandDefinition<SheetSetRowsFixedInput, SheetCommandResult>

Sets the fixed state for a contiguous row range.

variableSheetFixedRowsFieldKeysource ↗
SheetFixedRowsFieldKey: "sheet.fixedRows"

Stable Sheet data-view field owned by SheetFixedRowPlugin.

functioncreateSetSheetRowsFixedOperationssource ↗
createSetSheetRowsFixedOperations(input: SheetSetRowsFixedInput, dataSource: SheetFixedRowCommandDataSource): UpdateCellOTOperation<boolean>[]

Creates sparse, invertible fixed-row updates for a normalized row range.

input: SheetSetRowsFixedInput
dataSource: SheetFixedRowCommandDataSource
functionreadSheetFixedRowssource ↗
readSheetFixedRows(dataEngine: DataEngine): FixedRowMatrix | null

Reads the fixed-row matrix published by SheetFixedRowPlugin.

dataEngine: DataEngine
functionregisterSheetFixedRowCommandssource ↗
registerSheetFixedRowCommands(commands: SheetCommandBus, dataSource: SheetFixedRowCommandDataSource): void

Registers the fixed-row command against one plugin-owned state source.

commands: SheetCommandBus
dataSource: SheetFixedRowCommandDataSource

Package

@searsuite/sear-plugin-format-painter

16 exports

Sheet format painting through state-owner contributions.

classSheetFormatPainterPluginsource ↗
class SheetFormatPainterPlugin extends Plugin<unknown, CellProperties, null>

Owns only a local captured-format session; document formats remain with their owners.

constructorconstructor
SheetFormatPainterPlugin(options: SheetFormatPainterOptions): SheetFormatPainterPlugin
options: SheetFormatPainterOptions
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: Transaction): null

Applies a transaction to plugin-owned state and returns the next state.

_state: null
_transaction: Transaction
methoddestroy
destroy(): void
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void
observations: ObservationRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): null

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
interfaceFormatPainterStatesource ↗
interface FormatPainterState
propertymode
readonly mode: FormatPainterMode | null
propertysource
readonly source: SheetMoveRange | null
interfaceSheetFormatPainterOptionssource ↗
interface SheetFormatPainterOptions

Dependencies supplied by the owning composition root, with no global state.

propertyformats
readonly formats: SheetFormatTransferRegistry
propertyplatform
readonly platform: Platform
propertyreadShape
readonly readShape: (): readonly [number, number]
interfaceStartFormatPainterInputsource ↗
interface StartFormatPainterInput
propertymode
readonly mode?: FormatPainterMode
propertysource
readonly source: SheetMoveRange
typeFormatPainterModesource ↗
type FormatPainterMode = typeof FormatPainterMode[keyof typeof FormatPainterMode]

Canonical activation modes shared by commands and hosts.

variableApplyFormatPainterCommandsource ↗
ApplyFormatPainterCommand: SheetCommandDefinition<{ destination: SheetMoveRange }, SheetCommandResult>
variableCancelFormatPainterCommandsource ↗
CancelFormatPainterCommand: SheetCommandDefinition<void, SheetCommandResult>
variableFormatPainterModesource ↗
FormatPainterMode: { Once: "once"; Persistent: "persistent" }

Canonical activation modes shared by commands and hosts.

variableFormatPainterObservationsource ↗
FormatPainterObservation: StateObservationDefinition<FormatPainterState>
variableStartFormatPainterCommandsource ↗
StartFormatPainterCommand: SheetCommandDefinition<StartFormatPainterInput, SheetCommandResult>
functioncreateMatrixFormatTransfersource ↗
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<SheetFormatTransferContribution>

Captures sparse persisted formats and tiles them over an inclusive target.

id: string
target: PluginKey
readMatrix: (): SheetFormatMatrix<Value>
typeSheetFormatRangesource ↗
type SheetFormatRange = SheetMoveRange

Inclusive range shared by format-transfer owners and hosts.

interfaceSheetFormatTransferContributionsource ↗
interface SheetFormatTransferContribution

Optional state-owner contribution to format painting.

propertyid
readonly id: string
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans removal of this owner's explicit formats without changing cell content.

range: SheetMoveRange
interfaceSheetFormatTransferPlansource ↗
interface SheetFormatTransferPlan

One owner's isolated plan; only the owner interprets its operations.

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
classSheetFormatTransferRegistrysource ↗
class SheetFormatTransferRegistry

Editor-local composition of state-owner format transfers.

constructorconstructor
SheetFormatTransferRegistry(): SheetFormatTransferRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans all format owners against the same unchanged pre-clear state.

range: SheetMoveRange
methoddestroy
destroy(): void
methodregister
register(owner: SheetFormatTransferContribution): (): void
owner: SheetFormatTransferContribution
interfaceSheetFormatTransferSnapshotsource ↗
interface SheetFormatTransferSnapshot

Captured format data, independent of subsequent source changes.

methodplan
plan(destination: SheetMoveRange): readonly SheetFormatTransferPlan[]
destination: SheetMoveRange

Package

@searsuite/sear-plugin-formula-engineering

60 exports

Host-neutral Excel-compatible engineering formulas organized by category.

interfaceEngineeringFunctionRegistrationOptionssource ↗
interface EngineeringFunctionRegistrationOptions
propertyexcludedNames
readonly excludedNames?: readonly string[]

Function names omitted for hosts whose formula dialect does not expose them.

variableBESSELIsource ↗
BESSELI: FormulaFunction

BESSELI returns the modified Bessel function I_n(x). Example: =BESSELI(1.5,1) returns about 0.981666.

variableBESSELJsource ↗
BESSELJ: FormulaFunction

BESSELJ returns the Bessel function J_n(x). Example: =BESSELJ(1.9,2) returns about 0.329926.

variableBESSELKsource ↗
BESSELK: FormulaFunction

BESSELK returns the modified Bessel function K_n(x). Example: =BESSELK(1.5,1) returns about 0.277388.

variableBESSELYsource ↗
BESSELY: FormulaFunction

BESSELY returns the Bessel function Y_n(x). Example: =BESSELY(2.5,1) returns about 0.145918.

variableBIN2DECsource ↗
BIN2DEC: FormulaFunction

BIN2DEC converts binary to decimal. Example: =BIN2DEC("1100100") returns 100.

variableBIN2HEXsource ↗
BIN2HEX: FormulaFunction

BIN2HEX converts binary to hexadecimal. Example: =BIN2HEX("11111011") returns FB.

variableBIN2OCTsource ↗
BIN2OCT: FormulaFunction

BIN2OCT converts binary to octal. Example: =BIN2OCT("1001") returns 11.

variableBITANDsource ↗
BITAND: FormulaFunction

BITAND returns the bitwise AND of two 48-bit nonnegative integers. Example: =BITAND(13,25) returns 9.

variableBITLSHIFTsource ↗
BITLSHIFT: FormulaFunction

BITLSHIFT shifts a 48-bit integer left, or right for a negative shift. Example: =BITLSHIFT(4,2) returns 16.

variableBITORsource ↗
BITOR: FormulaFunction

BITOR returns the bitwise OR of two 48-bit nonnegative integers. Example: =BITOR(23,10) returns 31.

variableBITRSHIFTsource ↗
BITRSHIFT: FormulaFunction

BITRSHIFT shifts a 48-bit integer right, or left for a negative shift. Example: =BITRSHIFT(16,2) returns 4.

variableBITXORsource ↗
BITXOR: FormulaFunction

BITXOR returns the bitwise exclusive OR of two 48-bit nonnegative integers. Example: =BITXOR(5,3) returns 6.

variableCOMPLEXsource ↗
COMPLEX: FormulaFunction

COMPLEX creates Excel complex-number text from real and imaginary coefficients. Example: =COMPLEX(3,4) returns "3+4i".

variableCONVERTsource ↗
CONVERT: FormulaFunction

CONVERT changes a number between compatible measurement units. Example: =CONVERT(1,"mi","km") returns 1.609344.

variableDEC2BINsource ↗
DEC2BIN: FormulaFunction

DEC2BIN converts decimal to binary. Example: =DEC2BIN(9) returns 1001.

variableDEC2HEXsource ↗
DEC2HEX: FormulaFunction

DEC2HEX converts decimal to hexadecimal. Example: =DEC2HEX(100) returns 64.

variableDEC2OCTsource ↗
DEC2OCT: FormulaFunction

DEC2OCT converts decimal to octal. Example: =DEC2OCT(58) returns 72.

variableDELTAsource ↗
DELTA: FormulaFunction

DELTA tests whether two numbers are equal. Example: =DELTA(5,4) returns 0.

variableengineeringFunctionssource ↗
engineeringFunctions: readonly FormulaFunction[]
variableERFsource ↗
ERF: FormulaFunction

ERF returns the error function between lower and optional upper bounds. Example: =ERF(1) returns about 0.842701.

variableERF_PRECISEsource ↗
ERF_PRECISE: FormulaFunction

ERF.PRECISE returns the error function from zero to x. Example: =ERF.PRECISE(1) returns about 0.842701.

variableERFCsource ↗
ERFC: FormulaFunction

ERFC returns the complementary error function. Example: =ERFC(1) returns about 0.157299.

variableERFC_PRECISEsource ↗
ERFC_PRECISE: FormulaFunction

ERFC.PRECISE returns the precise complementary error function. Example: =ERFC.PRECISE(1) returns about 0.157299.

variableGESTEPsource ↗
GESTEP: FormulaFunction

GESTEP tests whether a number is at least a threshold. Example: =GESTEP(5,4) returns 1.

variableHEX2BINsource ↗
HEX2BIN: FormulaFunction

HEX2BIN converts hexadecimal to binary. Example: =HEX2BIN("F") returns 1111.

variableHEX2DECsource ↗
HEX2DEC: FormulaFunction

HEX2DEC converts hexadecimal to decimal. Example: =HEX2DEC("A5") returns 165.

variableHEX2OCTsource ↗
HEX2OCT: FormulaFunction

HEX2OCT converts hexadecimal to octal. Example: =HEX2OCT("F") returns 17.

variableIMABSsource ↗
IMABS: FormulaFunction

IMABS returns the modulus of a complex number. Example: =IMABS("3+4i") returns 5.

variableIMAGINARYsource ↗
IMAGINARY: FormulaFunction

IMAGINARY returns the imaginary coefficient. Example: =IMAGINARY("3+4i") returns 4.

variableIMARGUMENTsource ↗
IMARGUMENT: FormulaFunction

IMARGUMENT returns a complex number's angle in radians. Example: =IMARGUMENT("3+4i") returns about 0.9273.

variableIMCONJUGATEsource ↗
IMCONJUGATE: FormulaFunction

IMCONJUGATE returns the complex conjugate. Example: =IMCONJUGATE("3+4i") returns a 3-4i.

variableIMCOSsource ↗
IMCOS: FormulaFunction

IMCOS returns the cosine of a complex number. Example: =IMCOS("1+i") returns a complex cosine.

variableIMCOSHsource ↗
IMCOSH: FormulaFunction

IMCOSH returns the hyperbolic cosine of a complex number. Example: =IMCOSH("1+i") returns a complex hyperbolic cosine.

variableIMCOTsource ↗
IMCOT: FormulaFunction

IMCOT returns the cotangent of a complex number. Example: =IMCOT("1+i") returns a complex cotangent.

variableIMCOTHsource ↗
IMCOTH: FormulaFunction

IMCOTH returns the hyperbolic cotangent. Example: =IMCOTH("1+i") returns a complex value.

variableIMCSCsource ↗
IMCSC: FormulaFunction

IMCSC returns the cosecant of a complex number. Example: =IMCSC("1+i") returns a complex cosecant.

variableIMCSCHsource ↗
IMCSCH: FormulaFunction

IMCSCH returns the hyperbolic cosecant of a complex number. Example: =IMCSCH("1+i") returns a complex hyperbolic cosecant.

variableIMDIVsource ↗
IMDIV: FormulaFunction

IMDIV divides one complex number by another. Example: =IMDIV("3+4i","5-3i") returns their quotient.

variableIMEXPsource ↗
IMEXP: FormulaFunction

IMEXP returns the exponential of a complex number. Example: =IMEXP("1+i") returns a complex exponential.

variableIMLNsource ↗
IMLN: FormulaFunction

IMLN returns the natural logarithm of a complex number. Example: =IMLN("3+4i") returns a complex logarithm.

variableIMLOGsource ↗
IMLOG: FormulaFunction

IMLOG returns a complex logarithm in a chosen base. Example: =IMLOG("8",2) returns 3.

variableIMLOG10source ↗
IMLOG10: FormulaFunction

IMLOG10 returns the base-10 logarithm of a complex number. Example: =IMLOG10("3+4i") returns a complex logarithm.

variableIMLOG2source ↗
IMLOG2: FormulaFunction

IMLOG2 returns the base-2 logarithm of a complex number. Example: =IMLOG2("3+4i") returns a complex logarithm.

variableIMPOWERsource ↗
IMPOWER: FormulaFunction

IMPOWER raises a complex number to a real power. Example: =IMPOWER("2+3i",3) returns "-46+9i".

variableIMPRODUCTsource ↗
IMPRODUCT: FormulaFunction

IMPRODUCT multiplies complex numbers and ranges. Example: =IMPRODUCT("3+4i","5-3i") returns "27+11i".

variableIMREALsource ↗
IMREAL: FormulaFunction

IMREAL returns the real coefficient. Example: =IMREAL("6-9i") returns 6.

variableIMSECsource ↗
IMSEC: FormulaFunction

IMSEC returns the secant of a complex number. Example: =IMSEC("1+i") returns a complex secant.

variableIMSECHsource ↗
IMSECH: FormulaFunction

IMSECH returns the hyperbolic secant of a complex number. Example: =IMSECH("1+i") returns a complex hyperbolic secant.

variableIMSINsource ↗
IMSIN: FormulaFunction

IMSIN returns the sine of a complex number. Example: =IMSIN("1+i") returns a complex sine.

variableIMSINHsource ↗
IMSINH: FormulaFunction

IMSINH returns the hyperbolic sine of a complex number. Example: =IMSINH("1+i") returns a complex hyperbolic sine.

variableIMSQRTsource ↗
IMSQRT: FormulaFunction

IMSQRT returns the square root of a complex number. Example: =IMSQRT("1+i") returns a complex square root.

variableIMSUBsource ↗
IMSUB: FormulaFunction

IMSUB subtracts the second complex number from the first. Example: =IMSUB("13+4i","5+3i") returns "8+i".

variableIMSUMsource ↗
IMSUM: FormulaFunction

IMSUM adds complex numbers and ranges. Example: =IMSUM("3+6i","5-2i") returns "8+4i".

variableIMTANsource ↗
IMTAN: FormulaFunction

IMTAN returns the tangent of a complex number. Example: =IMTAN("1+i") returns a complex tangent.

variableIMTANHsource ↗
IMTANH: FormulaFunction

IMTANH returns the hyperbolic tangent. Example: =IMTANH("1+i") returns a complex value.

variableOCT2BINsource ↗
OCT2BIN: FormulaFunction

OCT2BIN converts octal to binary. Example: =OCT2BIN("3") returns 11.

variableOCT2DECsource ↗
OCT2DEC: FormulaFunction

OCT2DEC converts octal to decimal. Example: =OCT2DEC("54") returns 44.

variableOCT2HEXsource ↗
OCT2HEX: FormulaFunction

OCT2HEX converts octal to hexadecimal. Example: =OCT2HEX("100") returns 40.

functionregisterEngineeringFunctionssource ↗
registerEngineeringFunctions(registry: IFunctionRegistry, options?: EngineeringFunctionRegistrationOptions): (): void

Registers engineering formulas into an editor-local registry and returns an idempotent disposer.

registry: IFunctionRegistry
options: EngineeringFunctionRegistrationOptions

Package

@searsuite/sear-plugin-formula

56 exports

Sheet formula source, evaluation scheduling, dependency tracking, and result projection.

namespaceFormulaRegistryOwnershipsource ↗
FormulaRegistryOwnership: unknown
variablesymbol
symbol: typeof symbol
namespaceFormulaSchedulerDataSourcesource ↗
FormulaSchedulerDataSource: unknown
variablesymbol
symbol: typeof symbol

DI token for resolving FormulaSchedulerDataSource.

classCellFormulaValueConverterRegistrysource ↗
class CellFormulaValueConverterRegistry

Cell type → formula semantic value registry.

Rendering and formula coercion intentionally use separate registries: a
custom cell type can define its calculation semantics without coupling to a
Canvas renderer.

constructorconstructor
CellFormulaValueConverterRegistry(platform: Platform): CellFormulaValueConverterRegistry

Creates a registry with the built-in cell-to-formula semantics.

platform: Platform
Platform adapter used for diagnostics when unknown cell types fall back to text.
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving CellFormulaValueConverterRegistry.

methodregister
register(converter: CellFormulaValueConverter): (): void

Registers or overrides formula semantics for one cell type.

ReturnsDisposer that restores the previous converter only if this registration is still active.

converter: CellFormulaValueConverter
Converter owned by a built-in package or third-party plugin.
methodtoFormulaValue
toFormulaValue(cell: CellMatrixElement): FormulaValue

Converts a persisted sheet cell into the formula value contract.

ReturnsFormula value, including canonical propagated formula errors or #VALUE! for malformed error payloads.

cell: CellMatrixElement
Matrix cell to convert; the method never writes back to the sheet matrix.
classFormulaCalculationTraceBussource ↗
class FormulaCalculationTraceBus extends IFormulaCalculationTraceProvider

Editor-local formula trace event hub.

The hub fans out local runtime trace to host/plugin subscribers. It is
intentionally independent from OT, rendering, and persistence; publishing an
event must not mutate sheet state or request a render pipeline.

constructorconstructor
FormulaCalculationTraceBus(platform: Platform): FormulaCalculationTraceBus

Creates a trace hub bound to one editor instance.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaCalculationTraceBus.

methodemit
emit(event: Omit<FormulaBatchFlushedEvent, "sequence"> | Omit<FormulaDependenciesChangedEvent, "sequence"> | Omit<FormulaErrorChangedEvent, "sequence"> | Omit<FormulaRecalculationCompletedEvent, "sequence">): void

Emits one calculation trace event to current subscribers.

Listener failures are reported through Platform.warn and do not interrupt
formula recalculation, dependency maintenance, rendering invalidation, or
other subscribers.

event: Omit<FormulaBatchFlushedEvent, "sequence"> | Omit<FormulaDependenciesChangedEvent, "sequence"> | Omit<FormulaErrorChangedEvent, "sequence"> | Omit<FormulaRecalculationCompletedEvent, "sequence">
Event payload without provider-owned sequence metadata.
methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean): void

Seals event publication after initial formula data has been scanned.

isCommandExecuting: (): boolean
methodsubscribeFormulaCalculationTrace
subscribeFormulaCalculationTrace(listener: FormulaCalculationTraceListener): (): void

Subscribes to formula calculation trace events for one editor instance.

ReturnsFunction that removes the listener; calling it more than once is safe.

listener: FormulaCalculationTraceListener
Callback invoked for future calculation trace events.
classFormulaCrossSheetHighlightSourcesource ↗
class FormulaCrossSheetHighlightSource

Optional workbook-owned source for cross-sheet formula reference overlays.

constructorconstructor
FormulaCrossSheetHighlightSource(): FormulaCrossSheetHighlightSource
propertysymbolstatic
readonly symbol: typeof symbol
methodgetReferences
getReferences(selectionRevision: number, selectionSource?: string): readonly FormulaCrossSheetReference[]
selectionRevision: number
selectionSource: string
classFormulaRefShiftersource ↗
class FormulaRefShifter

Rewrites formula references after Sheet structure changes.

constructorconstructor
FormulaRefShifter(parser: IFormulaParser): FormulaRefShifter

Creates a FormulaRefShifter instance.

parser: IFormulaParser
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaRefShifter.

methodshiftAll
shiftAll(formulas: Map<number, FormulaAST>, changes: StructureChange[]): { key: number; newAst: FormulaAST }[]

Handles structural changes by traversing all formula ASTs and shifting references.

ReturnsFormula list that needs updates (key -> new AST).

formulas: Map<number, FormulaAST>
Current AST cache for all formulas (CellKey -> AST).
changes: StructureChange[]
Structural change list for row/column insertion and deletion.
classFormulaRenderInvalidatorsource ↗
class FormulaRenderInvalidator

Formula-result publisher for the shared displayed-value change bus.

The formula scheduler reports changes after updating derived results. Other
features subscribe to the shared bus without depending on formula internals.

constructorconstructor
FormulaRenderInvalidator(displayedValueChanges: SheetDisplayedValueChanges): FormulaRenderInvalidator
displayedValueChanges: SheetDisplayedValueChanges
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaRenderInvalidator.

methodbind
bind(handler: FormulaRenderInvalidationHandler): (): void

Registers the legacy formula-result callback for one editor instance.

ReturnsDisposer that removes this handler if it is still active.

handler: FormulaRenderInvalidationHandler
Callback that maps changed formula keys to render work.
methodinvalidateFormulaResults
invalidateFormulaResults(keys: readonly number[]): void

Reports formula result changes to displayed-value subscribers.

keys: readonly number[]
Formula cell keys whose derived display values changed.
classFormulaResultProviderRegistrysource ↗
class FormulaResultProviderRegistry extends IFormulaResultProvider

Instance-local result provider registry exposed as the renderer's formula result reader.

constructorconstructor
FormulaResultProviderRegistry(): FormulaResultProviderRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the registry owned by one SheetEditor instance.

methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void

Binds post-assembly registration and disposal to the owning command bus.

isExecuting: (): boolean
remove: (id: number): void
methodforEachFormulaResultInRange
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Visits derived result coordinates published by registered providers, once per position.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodgetFormulaResult
getFormulaResult(row: number, col: number): FormulaValue | undefined

Reads the first defined result supplied by registered providers.

row: number
col: number
methodregister
register(registration: FormulaResultProviderRegistration): (): void

Registers one formula result provider and returns an idempotent disposer.

registration: FormulaResultProviderRegistration
methodunregister
unregister(id: number): void

Removes one provider inside the formula owner's unregister command.

id: number
classFormulaResultStoresource ↗
class FormulaResultStore

Stores calculated formula results independently from persisted formula source.

constructorconstructor
FormulaResultStore(valueConverters: CellFormulaValueConverterRegistry): FormulaResultStore

Creates a FormulaResultStore instance.

valueConverters: CellFormulaValueConverterRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving FormulaResultStore.

methodcellToFormulaValue
cellToFormulaValue(row: number, col: number, cell: CellMatrixElement | null | undefined): FormulaValue

Converts a CellMatrixElement to a FormulaValue.

Used when evaluators read cell data:
- formula cells: read the local calculated result from this store; derived and unsynced.
- richtext/string cells: return text values, converting numeric strings to numbers.
- null/undefined: return 0 for empty cells.

Called by both SheetFormulaPlugin.apply for aggCache delta calculation and
RecalcScheduler.createEvalContext, so it lives on the store to avoid
duplicated logic or callback plumbing.

row: number
col: number
cell: CellMatrixElement | null | undefined
methodclear
clear(): void

Clears state owned by FormulaResultStore.

methoddelete
delete(key: number): void

Removes the calculated result for one formula cell.

key: number
methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean): void

Closes direct result writes after the owning Sheet has started.

isCommandExecuting: (): boolean
methodforEachSpillInRange
forEachSpillInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Visits projected spill coordinates in a range; formula anchors live in the Sheet data matrix.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodget
get(key: number): FormulaValue | undefined

Returns the value.

key: number
methodgetAt
getAt(row: number, col: number): FormulaValue | undefined

Reads an anchor or projected spill value at any sheet coordinate.

row: number
col: number
methodhas
has(key: number): boolean

Returns whether value exists.

key: number
methodset
set(key: number, value: FormulaValue): void

Updates the value.

key: number
value: FormulaValue
methodsetFormulaResult
setFormulaResult(key: number, value: FormulaValue, context: { isCellInBounds: unknown; isCellOccupied?: unknown }): number[]

Stores a formula result and projects a rectangular array into derived spill cells.

key: number
value: FormulaValue
context: { isCellInBounds: unknown; isCellOccupied?: unknown }
classFormulaRichResultProviderRegistrysource ↗
class FormulaRichResultProviderRegistry extends IFormulaRichResultProvider

Instance-local provider registry for formula hyperlinks, images, and future rich results.

constructorconstructor
FormulaRichResultProviderRegistry(): FormulaRichResultProviderRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void
isExecuting: (): boolean
remove: (id: number): void
methodgetFormulaRichResult
getFormulaRichResult(row: number, col: number): FormulaRichResult | undefined
row: number
col: number
methodregister
register(registration: FormulaRichResultProviderRegistration): (): void
registration: FormulaRichResultProviderRegistration
methodunregister
unregister(id: number): void
id: number
classFormulaSourceProviderRegistrysource ↗
class FormulaSourceProviderRegistry extends IFormulaSourceProvider

Editor-local ordered registry for formula source providers.

constructorconstructor
FormulaSourceProviderRegistry(): FormulaSourceProviderRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving IFormulaSourceProvider.

methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): void
isExecuting: (): boolean
remove: (id: number): void
methodgetFormulaSource
getFormulaSource(row: number, col: number): string | undefined

Gets the formula source that should be presented to the user for one cell.

Providers may return undefined when they do not own the queried cell. The
default sheet formula provider returns the persisted formula text, while
workbook-aware providers can return display text formatted from stable
workbook bindings and the current sheet names.

row: number
col: number
methodregister
register(registration: FormulaSourceProviderRegistration): (): void
registration: FormulaSourceProviderRegistration
methodunregister
unregister(id: number): void
id: number
classRecalcSchedulersource ↗
class RecalcScheduler

Schedules dependency-aware formula recalculation with visible-cell priority.

constructorconstructor
RecalcScheduler(graph: IDependencyGraph, evaluator: IFormulaEvaluator, resultStore: FormulaResultStore, aggCache: IAggregationCache, dataSource: FormulaSchedulerDataSource, platform: Platform, renderInvalidator: FormulaRenderInvalidator, trace: FormulaCalculationTraceBus, functionRegistry?: IFunctionRegistry, iterationSettings?: IFormulaIterationSettingsProvider): RecalcScheduler

Creates a RecalcScheduler instance.

graph: IDependencyGraph
evaluator: IFormulaEvaluator
resultStore: FormulaResultStore
aggCache: IAggregationCache
dataSource: FormulaSchedulerDataSource
platform: Platform
renderInvalidator: FormulaRenderInvalidator
trace: FormulaCalculationTraceBus
functionRegistry: IFunctionRegistry
iterationSettings: IFormulaIterationSettingsProvider
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving RecalcScheduler.

methodbindAstCache
bindAstCache(cache: ReadonlyMap<number, FormulaAST>): void

Binds the formula owner's cache during plugin setup.

cache: ReadonlyMap<number, FormulaAST>
methodbindCommandBus
bindCommandBus(commands: SheetCommandBus): void

Binds asynchronous formula work to the owning editor's command bus.

commands: SheetCommandBus
methodbindTeardownToken
bindTeardownToken(token: object): void

Gives the owning editor lifecycle exclusive authority to dispose the mounted scheduler.

token: object
methoddiscardPendingWork
discardPendingWork(): void

Discards pending formula batches when committed formula inputs are replaced.

methoddispose
dispose(token?: object): void

Releases scheduler-owned subscriptions.

token: object
methodgetFormulaKeys
getFormulaKeys(): IterableIterator<number>

Iterates formula coordinates without exposing the cache for mutation.

methodmarkDirty
markDirty(changedKeys: number[]): void

Triggers recalculation.

Performs only two actions:
1. Mark dirty formulas, propagated by BFS without sorting.
2. Start the async scheduling loop without blocking the current frame.

changedKeys: number[]
methodmarkFunctionsDirty
markFunctionsDirty(functionNames: readonly string[]): void

Recalculates formulas that contain any of the supplied function names.

functionNames: readonly string[]
methodprocessScheduledBatch
processScheduledBatch(): void

Runs one budgeted batch inside the formula owner's command.

methodrecalculateVolatile
recalculateVolatile(): void

Starts an explicit recalculation epoch for every formula containing a volatile call.

methodresumePendingWork
resumePendingWork(): void

Resumes pending work inside a viewport or external-service command.

methodwaitForIdle
waitForIdle(): Promise<void>

Resolves when the scheduler has no running or pending formula work.

classSheetFormulaPluginsource ↗
class SheetFormulaPlugin extends Plugin<SearCoreSheet, CellProperties, FormulaPluginState>, IFormulaResultProvider, IFormulaSourceProvider, IFormulaStatusProvider

Owns formula source, dependency tracking, recalculation, and result projection.

constructorconstructor
SheetFormulaPlugin(parser: IFormulaParser, graph: IDependencyGraph, aggCache: IAggregationCache, resultStore: FormulaResultStore, scheduler: RecalcScheduler, refShifter: FormulaRefShifter, trace: FormulaCalculationTraceBus, dataEngine?: DataEngine, platform?: Platform, results?: IFormulaResultProvider, resultProviders?: FormulaResultProviderRegistry, richResultProviders?: FormulaRichResultProviderRegistry, sourceProviders?: FormulaSourceProviderRegistry, functions?: IFunctionRegistry, externalServices?: IFormulaExternalServiceProvider, textServices?: IFormulaTextServiceProvider): SheetFormulaPlugin

Creates a SheetFormulaPlugin instance.

parser: IFormulaParser
graph: IDependencyGraph
aggCache: IAggregationCache
resultStore: FormulaResultStore
scheduler: RecalcScheduler
refShifter: FormulaRefShifter
trace: FormulaCalculationTraceBus
dataEngine: DataEngine
platform: Platform
results: IFormulaResultProvider
resultProviders: FormulaResultProviderRegistry
richResultProviders: FormulaRichResultProviderRegistry
sourceProviders: FormulaSourceProviderRegistry
functions: IFunctionRegistry
externalServices: IFormulaExternalServiceProvider
textServices: IFormulaTextServiceProvider
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

Operation types listened to by this plugin:
- uc: UpdateCell
- ri: RowInsert
- rd: RowDelete
- ci: ColInsert
- cd: ColDelete

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetFormulaPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetFormulaPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_pluginState: null, transaction: Transaction): null

Rejects unsupported structure operations before the owning transaction commits.
Derived ASTs are not staged as plugin state.

_pluginState: null
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceProviderCommandBoundary
enforceProviderCommandBoundary(commands: SheetCommandBus, workbookOwnership?: FormulaRegistryOwnership): void

Seals provider registration once every configured Sheet plugin has started.

commands: SheetCommandBus
workbookOwnership: FormulaRegistryOwnership
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodforEachFormulaResultInRange
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): void

Exposes derived spill coordinates to sparse range consumers.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodgetFormulaCellStatus
getFormulaCellStatus(row: number, col: number): FormulaCellStatus

IFormulaStatusProvider implementation used by hosts and plugins to inspect
formula source, result, dirty state, and dependency edges without touching
plugin-owned caches directly.

row: number
col: number
methodgetFormulaResult
getFormulaResult(row: number, col: number): FormulaValue | undefined

IFormulaResultProvider implementation used by rendering to read formula results.

Returns FormulaValue from resultStore, or undefined when it has not been
calculated yet. The rendering layer (FormulaCell) converts it to display text.

row: number
col: number
methodgetFormulaSource
getFormulaSource(row: number, col: number): string | undefined

IFormulaSourceProvider implementation used by editors to read persisted formula text.

row: number
col: number
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCell
onInitialDataCell(_searCore: SearCoreSheet, value: unknown, row: number, col: number): void

Receives cells from shared startup scanning and builds AST/dependency
indexes for existing formula cells.

Initial data such as content.json is injected directly into SheetDataPlugin
and does not pass through the command pipeline -> apply, so formula-derived
indexes must be built here.

_searCore: SearCoreSheet
value: unknown
row: number
col: number
methodonInitialDataComplete
onInitialDataComplete(_searCore: SearCoreSheet): void

Starts one recalculation after dependencies for all initial formulas have been registered.

_searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

Rebuilds derived indexes after the owning document transaction commits.

transaction: Transaction
Successfully committed transaction.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers formula host commands.

commands: SheetCommandBus
Command bus owned by one editor instance.
methodregisterConfig
registerConfig(): { config: ConfigUnit<FormulaReferenceHighlightConfig>; key: PluginKey }[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers formula calculation trace as an editor-local host observation.

observations: ObservationRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes formula identity updates to the same atomic cell-move plan.

registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

Formula indexes are editor-local and do not enter Sheet document views.

methodregisterStructureMoves
registerStructureMoves(registry: SheetStructureMoveRegistry): void

Plans persisted reference rewrites for complete row and column reordering.

registry: SheetStructureMoveRegistry
methodrender
render(): Node<CellProperties>[]

Render method; the formula plugin does not render nodes directly.

Formula cells are rendered by FormulaCell through render-registry
registration. This plugin owns data updates, not visual presentation.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
classSheetFormulaReferenceHighlightPluginsource ↗
class SheetFormulaReferenceHighlightPlugin extends Plugin<SearCoreSheet, CellProperties, Record<string, never>>

Highlights formula precedents and dependents for the active cell.

This intentionally remains separate from Selection: formula dependency status
is optional, while Selection itself must stay independent of formula support.

constructorconstructor
SheetFormulaReferenceHighlightPlugin(statusProvider: IFormulaStatusProvider, configEngine: ConfigEngine, highlightRegistry: SheetHighlightRegistry, interactionStore: SheetInteractionStore): SheetFormulaReferenceHighlightPlugin

Creates a SheetFormulaReferenceHighlightPlugin instance.

statusProvider: IFormulaStatusProvider
configEngine: ConfigEngine
highlightRegistry: SheetHighlightRegistry
interactionStore: SheetInteractionStore
propertydepth
depth: number

Draw above regular cells and below Selection's edit overlay.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<Record<string, never>, object> | readonly PluginDocumentStateContribution<Record<string, never>, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: string[]

Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertyhighlightProviderKeystatic
readonly highlightProviderKey: "formula-selection-references"

Stable key for the formula-reference highlight contribution.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetFormulaReferenceHighlightPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetFormulaReferenceHighlightPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: Record<string, never>, _transaction: Transaction): Record<string, never> | null

Applies a transaction to SheetFormulaReferenceHighlightPlugin state.

_state: Record<string, never>
_transaction: Transaction
methodbindCrossSheetSource
bindCrossSheetSource(source: FormulaCrossSheetHighlightSource): void

Binds an optional workbook-owned reference source for this Sheet instance.

source: FormulaCrossSheetHighlightSource
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetHighlights
getHighlights(context: SheetHighlightContext): SheetRangeHighlight[]

The provider contract consumed by SheetHighlightPlugin.

context: SheetHighlightContext
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodgetStateinherited
getState(): Record<string, never>

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
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.

state: PluginStateType
transaction: Transaction
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { key: PluginKey; state: Record<string, never> }

Registers the state.

methodrender
render(_searCore: SearCoreSheet): Node<CellProperties>[]

Renders SheetFormulaReferenceHighlightPlugin scene output.

_searCore: SearCoreSheet
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
interfaceCellFormulaValueConvertersource ↗
interface CellFormulaValueConverter

Defines how one persisted cell type enters the formula domain.

propertycellType
readonly cellType: string

Persisted cell type identifier handled by this converter.

methodtoFormulaValue
toFormulaValue(cell: CellMatrixElement): FormulaValue

Converts one sheet matrix element into a formula-engine value.

ReturnsFormula value used by formula evaluation and dependency recalculation.

cell: CellMatrixElement
Persisted sheet cell to read without mutating sheet state.
interfaceFormulaCellStatusCommandInputsource ↗
interface FormulaCellStatusCommandInput

Input for querying one cell's formula status through the host command bus.

propertycol
readonly col: number

Column index (0-based).

propertyrow
readonly row: number

Row index (0-based).

interfaceFormulaCellStatusCommandResultsource ↗
interface FormulaCellStatusCommandResult extends SheetCommandResult

Command result for a formula status query.

The pipeline is intentionally empty: formula status reads must not mutate OT
state, request rendering, or produce local effects.

propertycompletioninherited
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertyeffectsinherited
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertypipelineinherited
readonly pipeline: Pipeline

Pipeline containing transaction, render, interaction and local-action steps.

propertystatus
readonly status: FormulaCellStatus

Formula status snapshot returned by the formula status provider.

interfaceFormulaCrossSheetReferencesource ↗
interface FormulaCrossSheetReference

One workbook-qualified reference projected onto the currently mounted sheet.

propertyend
readonly end: [number, number]
propertyindex
readonly index: number
propertystart
readonly start: [number, number]
interfaceFormulaDependencyCellRefsource ↗
interface FormulaDependencyCellRef

Product-facing cell coordinate plus A1 reference label.

propertycol
readonly col: number

Column index (0-based).

propertyref
readonly ref: string

A1 notation for display in product UI.

propertyrow
readonly row: number

Row index (0-based).

interfaceFormulaDependencyStatussource ↗
interface FormulaDependencyStatus

Product-facing formula dependency status for one queried cell.

propertycell
readonly cell: FormulaDependencyCellRef

Queried cell with display label.

propertydependents
readonly dependents: readonly FormulaDependencyCellRef[]

Direct formula cells that depend on the queried cell.

propertyprecedents
readonly precedents: readonly FormulaDependencyReference[]

Direct precedent references used by the formula in the queried cell.

propertystatus
readonly status: FormulaCellStatus

Underlying formula status snapshot for consumers that need result/error/dirty details.

propertytransitiveDependents
readonly transitiveDependents: readonly FormulaDependencyCellRef[]

Transitive dependent formula cells, only populated when requested.

propertytransitivePrecedents
readonly transitivePrecedents: readonly FormulaDependencyCellRef[]

Transitive precedent cells, only populated when requested.

interfaceFormulaDependencyStatusCommandInputsource ↗
interface FormulaDependencyStatusCommandInput

Input for querying product-facing formula dependency status.

propertycol
readonly col: number

Column index (0-based).

propertyincludeTransitive
readonly includeTransitive?: boolean

Whether to include transitive dependency/dependent cells beyond direct edges.

propertymaxDepth
readonly maxDepth?: number

Maximum traversal depth used when includeTransitive is true. Defaults to 8.

propertyrow
readonly row: number

Row index (0-based).

interfaceFormulaDependencyStatusCommandResultsource ↗
interface FormulaDependencyStatusCommandResult extends SheetCommandResult

Command result for a product-facing formula dependency query.

The pipeline is intentionally empty: dependency reads must not mutate OT state,
request rendering, or produce local effects.

propertycompletioninherited
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertydependencyStatus
readonly dependencyStatus: FormulaDependencyStatus

Product-facing dependency snapshot for the queried cell.

propertyeffectsinherited
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertypipelineinherited
readonly pipeline: Pipeline

Pipeline containing transaction, render, interaction and local-action steps.

interfaceFormulaIdleCommandResultsource ↗
interface FormulaIdleCommandResult extends SheetCommandResult

Result returned when waiting for one editor instance's formula scheduler.

propertycompletioninherited
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertyeffectsinherited
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertyidle
readonly idle: Promise<void>

Promise resolved when the formula scheduler becomes idle.

propertypipelineinherited
readonly pipeline: Pipeline

Pipeline containing transaction, render, interaction and local-action steps.

interfaceFormulaIdleProvidersource ↗
interface FormulaIdleProvider

Provider contract used by the deterministic formula-idle command.

methodwaitForIdle
waitForIdle(): Promise<void>

Resolves after all currently scheduled formula work has completed.

interfaceFormulaReferenceColorPalettesource ↗
interface FormulaReferenceColorPalette

Named palette entries stay compatible with the reactive configuration engine.

propertyazure
azure: string
propertyblue
blue: string
propertybrown
brown: string
propertycyan
cyan: string
propertyemerald
emerald: string
propertygreen
green: string
propertyindigo
indigo: string
propertyorange
orange: string
propertyrose
rose: string
propertyslate
slate: string
propertyteal
teal: string
propertyviolet
violet: string
interfaceFormulaReferenceHighlightConfigsource ↗
interface FormulaReferenceHighlightConfig

Formula-reference overlay settings used while editing a formula.

propertyactiveReferenceFillOpacity
activeReferenceFillOpacity: number

Opacity of the referenced-cell overlay under the formula cursor.

propertyreferenceColors
referenceColors: FormulaReferenceColorPalette

Stable, high-contrast colors assigned to formula references.

propertyreferenceFillOpacity
referenceFillOpacity: number

Opacity of referenced-cell overlays when the cursor is elsewhere.

interfaceFormulaRegistryOwnershipsource ↗
interface FormulaRegistryOwnership

Marks formula registries borrowed from a Workbook owner by a mounted Sheet.

propertyexternalServices
readonly externalServices: boolean
propertyfunctions
readonly functions: boolean
propertytextServices
readonly textServices: boolean
interfaceFormulaResultProviderRegistrationsource ↗
interface FormulaResultProviderRegistration

Ordered formula result provider registered for one SheetEditor instance.

propertypriority
readonly priority?: number

Higher priority providers are queried first.

propertyprovider
readonly provider: IFormulaResultProvider

Provider queried for formula results.

interfaceFormulaRichResultProviderRegistrationsource ↗
interface FormulaRichResultProviderRegistration

Ordered rich-result provider registered for one SheetEditor instance.

propertypriority
readonly priority?: number
propertyprovider
readonly provider: IFormulaRichResultProvider
interfaceFormulaSchedulerDataSourcesource ↗
interface FormulaSchedulerDataSource

Narrow data-source contract used by RecalcScheduler.

Implementations adapt host-owned sheet data, viewport state, and dimension
services into formula-engine concepts. The scheduler depends only on this
contract, not on render, scroll, or DataEngine packages.

methodcreateEvalContext
createEvalContext(resultStore: FormulaResultStore): EvalContext

Builds the latest evaluation context for a recalculation batch.

ReturnsEvalContext for the current committed sheet snapshot.

resultStore: FormulaResultStore
Per-client derived formula result store used when formula cells reference formula cells.
methodgetViewportFormulaKeys
getViewportFormulaKeys(formulaKeys: Iterable<number>): Set<number>

Selects formula keys that are currently visible and should be evaluated first.

ReturnsFormula keys inside the current visible viewport.

formulaKeys: Iterable<number>
Formula AST keys known to the scheduler.
methodonExternalServiceInvalidated
onExternalServiceInvalidated(handler: FormulaExternalServiceInvalidationHandler): (): void

Subscribes to host-service cache changes that require selected functions to be evaluated again.

handler: FormulaExternalServiceInvalidationHandler
methodonViewportChanged
onViewportChanged(handler: FormulaViewportChangeHandler): (): void

Subscribes to viewport changes that should wake pending formula recalculation.

ReturnsDisposer for the subscription.

handler: FormulaViewportChangeHandler
Callback invoked after viewport-priority inputs change.
interfaceFormulaSourceProviderRegistrationsource ↗
interface FormulaSourceProviderRegistration
propertypriority
readonly priority?: number
propertyprovider
readonly provider: IFormulaSourceProvider
interfaceUnregisterFormulaProviderInputsource ↗
interface UnregisterFormulaProviderInput
propertykind
readonly kind: FormulaProviderKind
propertyregistrationId
readonly registrationId: number
typeFormulaDependencyReferencesource ↗
type FormulaDependencyReference = FormulaDependencyCellRef & { kind: typeof FormulaNodeKind.Cell } | { end: FormulaDependencyCellRef; kind: typeof FormulaNodeKind.Range; ref: string; start: FormulaDependencyCellRef } | FormulaDependencyCellRef & { kind: typeof FormulaNodeKind.WorkbookCell; sheetName: string } | { end: FormulaDependencyCellRef; kind: typeof FormulaNodeKind.WorkbookRange; ref: string; sheetName: string; start: FormulaDependencyCellRef } | { endCol: number; kind: typeof FormulaNodeKind.ColumnRange; ref: string; startCol: number } | { endRow: number; kind: typeof FormulaNodeKind.RowRange; ref: string; startRow: number }

Product-facing dependency edge that preserves range-level formula semantics.

typeFormulaPluginStatesource ↗
type FormulaPluginState = null

Formula owns no document state; its ASTs and results are derived caches.

typeFormulaProviderKindsource ↗
type FormulaProviderKind = typeof FormulaProviderKind[keyof typeof FormulaProviderKind]

Formula-owned provider families sharing one editor-local unregister command.

typeFormulaRenderInvalidationHandlersource ↗
type FormulaRenderInvalidationHandler = (keys: readonly CellKey[]): void

Compatibility callback for formula-result change notifications.

typeFormulaViewportChangeHandlersource ↗
type FormulaViewportChangeHandler = (): void

Callback invoked when viewport-priority scheduling inputs may have changed.

variableDiscardFormulaWorkCommandsource ↗
DiscardFormulaWorkCommand: SheetCommandDefinition<void, SheetCommandResult>

Invalidates an obsolete formula calculation generation.

variableFormulaCalculationTraceObservationsource ↗
FormulaCalculationTraceObservation: EventObservationDefinition<FormulaCalculationTraceEvent>

Editor-local formula calculation trace events exposed to diagnostic hosts.

variableFormulaProviderKindsource ↗
FormulaProviderKind: { Result: "result"; RichResult: "richResult"; Source: "source" }

Formula-owned provider families sharing one editor-local unregister command.

variableformulaReferenceHighlightConfigsource ↗
formulaReferenceHighlightConfig: FormulaReferenceHighlightConfig
variableGetFormulaCellStatusCommandsource ↗
GetFormulaCellStatusCommand: SheetCommandDefinition<FormulaCellStatusCommandInput, FormulaCellStatusCommandResult>

Host command that reads one cell's formula status.

variableGetFormulaDependencyStatusCommandsource ↗
GetFormulaDependencyStatusCommand: SheetCommandDefinition<FormulaDependencyStatusCommandInput, FormulaDependencyStatusCommandResult>

Host command that reads product-facing formula dependency status.

variableMarkFormulaDirtyCommandsource ↗
MarkFormulaDirtyCommand: SheetCommandDefinition<readonly number[], SheetCommandResult>

Marks formula dependencies dirty after an external result or function changes.

variableResumeFormulaWorkCommandsource ↗
ResumeFormulaWorkCommand: SheetCommandDefinition<void, SheetCommandResult>

Resumes pending formula work when the visible viewport changes.

variableRunFormulaBatchCommandsource ↗
RunFormulaBatchCommand: SheetCommandDefinition<void, SheetCommandResult>

Executes one scheduled, time-bounded formula calculation batch.

variablesheetFormulaPluginKeysource ↗
sheetFormulaPluginKey: PluginKey

Shared identity for formula plugin state and configuration.

variableUnregisterFormulaProviderCommandsource ↗
UnregisterFormulaProviderCommand: SheetCommandDefinition<UnregisterFormulaProviderInput, SheetCommandResult>

Removes an editor-local formula provider registration.

variableUnregisterSheetFormulaExternalServiceCommandsource ↗
UnregisterSheetFormulaExternalServiceCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one Sheet-owned external formula service contribution.

variableUnregisterSheetFormulaFunctionCommandsource ↗
UnregisterSheetFormulaFunctionCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one function contribution through its Sheet owner.

variableUnregisterSheetFormulaTextServiceCommandsource ↗
UnregisterSheetFormulaTextServiceCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one Sheet-owned formula text service contribution.

variableWaitForFormulaIdleCommandsource ↗
WaitForFormulaIdleCommand: SheetCommandDefinition<void, FormulaIdleCommandResult>

Host command that exposes deterministic formula-idle synchronization.

functiongetFormulaReferenceColorsource ↗
getFormulaReferenceColor(referenceIndex: number, colors?: FormulaReferenceColorPalette): string

Assigns a formula reference its Excel-style, position-based palette color.

referenceIndex: number
colors: FormulaReferenceColorPalette
functionlockFormulaResultValuesource ↗
lockFormulaResultValue(value: FormulaValue): void

Locks a calculated value once when it enters the editor-local result cache.

value: FormulaValue
functionregisterFormulaStatusCommandssource ↗
registerFormulaStatusCommands(commands: SheetCommandBus, provider: IFormulaStatusProvider, idleProvider?: FormulaIdleProvider): void

Registers formula status query commands.

commands: SheetCommandBus
Command bus for one editor instance.
provider: IFormulaStatusProvider
Formula status provider bound to the same editor instance.
idleProvider: FormulaIdleProvider
functionwaitForFormulaIdlesource ↗
waitForFormulaIdle(commands: SheetCommandBus): Promise<void>

Waits deterministically for one editor's formula scheduler to become idle.

commands: SheetCommandBus

Package

@searsuite/sear-plugin-freeze

11 exports

Persistent Sheet freeze boundaries and typed command surface.

classSheetFreezeBoundaryErrorsource ↗
class SheetFreezeBoundaryError extends SearError

Public invalid-boundary error with stable diagnostics.

constructorconstructor
SheetFreezeBoundaryError(input: SheetFreezeState, rowCount: number, columnCount: number): SheetFreezeBoundaryError
input: SheetFreezeState
rowCount: number
columnCount: number
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_FREEZE_INVALID_BOUNDARY"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetFreezeMatrixsource ↗
class SheetFreezeMatrix extends CSRMatrix<number | null>

One row with the frozen row and column counts at columns zero and one.

constructorconstructor
SheetFreezeMatrix(data?: SheetFreezeMatrixData, shape?: [number, number]): SheetFreezeMatrix

Creates or restores a freeze matrix.

data: SheetFreezeMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: number | null[]): SheetFreezeMatrix

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: number
The index where the new column should be inserted.
col: number | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
addItem(row: number, column: number, value: number | null): this

Adds a boundary count through the same sparse normalization.

row: number
column: number
value: number | null
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: number | null[]): SheetFreezeMatrix

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: number
The index at which to add the row.
row: number | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: number | null): number | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: number | null): number | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetFreezeMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): SheetFreezeMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<number | null>[]): SheetFreezeMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<number | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: number | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: number | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: number | null, 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).

callback: (value: number | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: number | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: number | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: number | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: number | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: number | null[][]): SheetFreezeMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: number | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): number | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): SheetFreezeMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: number | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: number | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, value: number | null): this

Sets a boundary count, removing empty values from sparse storage.

row: number
column: number
value: number | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): SheetFreezeMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): SheetFreezeMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): number | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetFreezePluginsource ↗
class SheetFreezePlugin extends Plugin<unknown, CellProperties, SheetFreezePluginState>

Owns the persistent row and column prefix kept visible during scrolling.

constructorconstructor
SheetFreezePlugin(state: SheetFreezePluginState, shape: (): readonly [number, number]): SheetFreezePlugin
state: SheetFreezePluginState
shape: (): readonly [number, number]
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetFreezePluginState, SheetFreezePluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
readonly interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetFreezePluginState, SheetFreezePluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(state: SheetFreezePluginState, transaction: Transaction): SheetFreezePluginState | null

Applies a transaction to plugin-owned state and returns the next state.

state: SheetFreezePluginState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetFreezePluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetFreezePluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetFreezePluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetFreezePluginState, 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.

state: SheetFreezePluginState
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): SheetFreezeMatrix; viewKey: string }[] }; key: PluginKey; state: SheetFreezePluginState }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetFreezePluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetFreezePluginState
commitToken: object
interfaceSheetFreezeCommandSourcesource ↗
interface SheetFreezeCommandSource

Supplies current boundaries and sheet dimensions to the command factory.

propertytarget
readonly target: PluginKey

Owner of the persistent freeze matrix.

methodread
read(): SheetFreezeState

Reads the currently committed freeze boundaries.

methodshape
shape(): readonly [number, number]

Reads the current row and column counts.

interfaceSheetFreezeMatrixDatasource ↗
interface SheetFreezeMatrixData

Sparse serialization payload accepted by the freeze matrix.

propertydata
readonly data: number | null[]

Stored boundary counts.

propertyindices
readonly indices: number[]

Sparse row offsets.

propertyindptr
readonly indptr: number[]

Stored axis indices.

interfaceSheetFreezePluginStatesource ↗
interface SheetFreezePluginState

Document-owned state for one Sheet editor's freeze boundaries.

propertyfreeze
readonly freeze: SheetFreezeMatrix

Sparse freeze boundary matrix.

interfaceSheetFreezeStatesource ↗
interface SheetFreezeState

Number of leading rows and columns kept visible while scrolling.

propertycolumns
readonly columns: number

Frozen column count.

propertyrows
readonly rows: number

Frozen row count.

variableSetSheetFreezeCommandsource ↗
SetSheetFreezeCommand: SheetCommandDefinition<SheetFreezeState, SheetCommandResult>

Replaces both freeze boundaries in one transaction.

variableSheetFreezeFieldKeysource ↗
SheetFreezeFieldKey: "sheet.freeze"

Plugin-owned data-view field for persistent freeze boundaries.

functioncreateSetSheetFreezeOperationssource ↗
createSetSheetFreezeOperations(input: SheetFreezeState, source: SheetFreezeCommandSource): UpdateCellOTOperation<number | null>[]

Creates invertible updates for the changed freeze boundaries.

input: SheetFreezeState
source: SheetFreezeCommandSource
functionreadSheetFreezesource ↗
readSheetFreeze(dataEngine: DataEngine): SheetFreezeState

Reads freeze boundaries, returning zeroes when the plugin is absent.

dataEngine: DataEngine

Package

@searsuite/sear-plugin-header-highlight

2 exports

Header highlight behavior derived from Sheet selections.

classSheetHeaderHighlightPluginsource ↗
class SheetHeaderHighlightPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetHeaderHighlight>

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.

constructorconstructor
SheetHeaderHighlightPlugin(sheetSelectionPlugin: SheetSelectionPlugin, sheetCornerPlugin: SheetCornerPlugin): SheetHeaderHighlightPlugin

Creates a SheetHeaderHighlightPlugin instance.

sheetSelectionPlugin: SheetSelectionPlugin
sheetCornerPlugin: SheetCornerPlugin
propertydepth
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.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<ISheetHeaderHighlight, object> | readonly PluginDocumentStateContribution<ISheetHeaderHighlight, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName | RectOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetHeaderHighlightPlugin.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetHeaderHighlightPlugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: ISheetHeaderHighlight, _transaction: Transaction): ISheetHeaderHighlight

Applies a transaction to SheetHeaderHighlightPlugin state.

pluginState: ISheetHeaderHighlight
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): null

Returns plugin-specific configuration.

This plugin currently reads config directly from configEngine during render.

searCore: SearCoreSheet
methodgetStateinherited
getState(): ISheetHeaderHighlight

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: ISheetHeaderHighlight): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: ISheetHeaderHighlight
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: ISheetHeaderHighlight, 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.

state: ISheetHeaderHighlight
transaction: Transaction
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ columnHeaderHeight: number; headerHighlightActiveBarThickness: number; headerHighlightActiveBorderColor: string; headerHighlightBackgroundColor: string; headerHighlightBorderColor: string; mode: SheetHeaderHighlightMode }>; key: PluginKey }[]

Registers default configuration for this plugin.

methodregisterState
registerState(): { key: PluginKey; state: ISheetHeaderHighlight }

Registers plugin state into the host state store.

methodrender
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: SearCoreSheet
Active core sheet instance.
offset: { x: number; y: number }
World-space offset propagated by the render pipeline.
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: ISheetHeaderHighlight, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: ISheetHeaderHighlight
commitToken: object
typeSheetHeaderHighlightModesource ↗
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.

Package

@searsuite/sear-plugin-history

9 exports

Commit-driven Sheet and Doc undo and redo stacks.

classSheetHistoryPluginsource ↗
class SheetHistoryPlugin extends Plugin<SearCoreSheet, CellProperties, null>, SheetLifecycleController, SheetHistoryStatusProvider

Editor-local command history for plugin-owned Sheet state with registered transaction algebra.

constructorconstructor
SheetHistoryPlugin(plugins: PluginManager<SearCoreSheet, CellProperties>, interaction: SheetInteractionStore, keyboard: KeyboardRouter, platform: Platform, commands: SheetCommandBus): SheetHistoryPlugin
plugins: PluginManager<SearCoreSheet, CellProperties>
interaction: SheetInteractionStore
keyboard: KeyboardRouter
platform: Platform
commands: SheetCommandBus
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable owner key for the private history state.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the default Sheet history plugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: null, _transaction: Transaction): null

History observes committed commands and owns no transactional sheet projection.

_state: null
_transaction: Transaction
methoddestroy
destroy(): void

Releases command/status subscriptions owned by this editor instance.

methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

History has no render-time configuration.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodgetStatus
getStatus(): SheetHistoryStatus

Returns current undo and redo availability.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers typed history commands on this editor's command bus.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers the host-facing history status observation for this editor.

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers sheet-local undo and redo history for editor remounts.

registry: SessionStateRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

History state is private runtime state and is never persisted or synchronized.

methodrender
render(): null

History contributes no scene nodes.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodstart
start(_context: SheetLifecycleContext): void

Starts command observation and semantic keyboard shortcuts after Core is ready.

_context: SheetLifecycleContext
methodsubscribe
subscribe(listener: (status: SheetHistoryStatus): void): (): void

Subscribes to future history availability changes.

listener: (status: SheetHistoryStatus): void
classSheetHistoryStatusProvidersource ↗
class SheetHistoryStatusProvider

Editor-local DI contract used by plugins that render history controls.

constructorconstructor
SheetHistoryStatusProvider(): SheetHistoryStatusProvider
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the active editor's history status provider.

methodgetStatus
getStatus(): SheetHistoryStatus

Returns the current editor-local history availability.

methodsubscribe
subscribe(listener: (status: SheetHistoryStatus): void): (): void

Observes future history availability changes and returns an idempotent disposer.

listener: (status: SheetHistoryStatus): void
interfaceSheetHistoryEntrysource ↗
interface SheetHistoryEntry
propertyredo
redo: Transaction<Operation>[]
propertyundo
undo: Transaction<Operation>[]
interfaceSheetHistorySessionStatesource ↗
interface SheetHistorySessionState

In-memory history retained for one sheet session while a workbook is open.

propertyredoStack
readonly redoStack: SheetHistoryEntry[]
propertyundoStack
readonly undoStack: SheetHistoryEntry[]
interfaceSheetHistoryStatussource ↗
interface SheetHistoryStatus

Immutable status published whenever one editor's history availability changes.

propertycanRedo
readonly canRedo: boolean
propertycanUndo
readonly canUndo: boolean
variableRedoSheetCommandsource ↗
RedoSheetCommand: SheetCommandDefinition<void, SheetCommandResult>

Reapplies the latest sheet mutation reverted by undo.

variableSheetHistorySessionStateDefinitionsource ↗
SheetHistorySessionStateDefinition: SessionStateDefinition<SheetHistorySessionState>

Stable session-state identity owned by SheetHistoryPlugin.

variableSheetHistoryStatusObservationsource ↗
SheetHistoryStatusObservation: StateObservationDefinition<SheetHistoryStatus>

Editor-local undo/redo availability exposed to third-party hosts.

variableUndoSheetCommandsource ↗
UndoSheetCommand: SheetCommandDefinition<void, SheetCommandResult>

Reverts the latest successfully committed sheet mutation.

Package

@searsuite/sear-plugin-i18n

16 exports

Editor-local locale registration and built-in English and Chinese formula locales.

classSheetI18nLocaleRegistrysource ↗
class SheetI18nLocaleRegistry

Editor-local registry for built-in and third-party locale contributions.

constructorconstructor
SheetI18nLocaleRegistry(): SheetI18nLocaleRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetI18nLocaleRegistry.

methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): void

Seals runtime registrations after every plugin has started.

isExecuting: (): boolean
dispatchRemoval: (id: number): void
methodget
get(locale: string): SheetI18nLocaleEntry | undefined

Returns a registered locale contribution, if present.

locale: string
methodhas
has(locale: string): boolean

Returns whether a locale id is registered.

locale: string
methodlist
list(): readonly SheetI18nLocaleEntry[]

Lists registered locale contributions in stable locale-id order.

methodregister
register(registration: SheetI18nLocaleRegistration): (): void

Registers one locale contribution and returns an idempotent disposer.

registration: SheetI18nLocaleRegistration
methodrequire
require(locale: string): SheetI18nLocaleEntry

Returns a required locale contribution.

locale: string
methodunregister
unregister(id: number): void

Removes one contribution through the locale owner's command after assembly.

id: number
classSheetI18nPluginsource ↗
class SheetI18nPlugin extends Plugin<SearCoreSheet, CellProperties, null>, IFormulaLocaleProvider, ICellFormatLocaleProvider

Editor-local i18n plugin for built-in English and Chinese locale services.

constructorconstructor
SheetI18nPlugin(locales: SheetI18nLocaleRegistry): SheetI18nPlugin

Creates a SheetI18nPlugin instance.

locales: SheetI18nLocaleRegistry
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<null, object> | readonly PluginDocumentStateContribution<null, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetI18nPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetI18nPlugin.

memberkeyinherited
key: unknown
methodapply
apply(state: null, _transaction: Transaction): null

Applies no document mutations because i18n is local runtime state.

state: null
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetCellFormatLocale
getCellFormatLocale(): CellFormatLocale

ICellFormatLocaleProvider implementation.

methodgetDateTimeLocale
getDateTimeLocale(): FormulaDateTimeLocale

IFormulaLocaleProvider implementation.

methodgetLocale
getLocale(): string

Returns the active locale.

methodgetPluginConfig
getPluginConfig(): null

Returns the plugin config.

methodgetStateinherited
getState(): null

Returns the plugin-owned state currently registered with the manager.

methodgetTextLocale
getTextLocale(): FormulaTextLocale

IFormulaLocaleProvider implementation.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(context: { container: Container }): void

Discovers formula scheduling after the formula runtime has registered its services.

context: { container: Container }
methodlockCommittedStateinherited
lockCommittedState(state: null): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: null
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: null, 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.

state: null
transaction: Transaction
methodregisterCapabilities
registerCapabilities(registry: RuntimeCapabilityRegistry): void

Publishes the i18n locale registry for third-party locale contributions.

registry: RuntimeCapabilityRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers language switching commands.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers the current i18n state observation.

observations: ObservationRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers local i18n state for in-memory editor remounts.

registry: SessionStateRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

Registers private plugin state.

methodrender
render(): Node<CellProperties>[]

This plugin renders no scene nodes.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWrites
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetLocale
setLocale(locale: string): void

Updates the active locale and notifies observers.

locale: string
methodsetStateinherited
setState(state: null, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: null
commitToken: object
methodtoggleLocale
toggleLocale(): void

Toggles between English and Chinese.

methodregisterServicesstatic
registerServices(context: { container: Container }): void

Publishes this plugin as the editor-local formula locale provider.

context: { container: Container }
interfaceSetSheetLocaleInputsource ↗
interface SetSheetLocaleInput

Input for setting the editor-local language.

propertylocale
readonly locale: string
interfaceSheetI18nLocaleEntrysource ↗
interface SheetI18nLocaleEntry

Normalized locale contribution stored by the editor-local registry.

propertycellFormatLocale
readonly cellFormatLocale: CellFormatLocale

Sheet cell number and date/time display defaults for this locale.

propertydateTimeLocale
readonly dateTimeLocale: FormulaDateTimeLocale

Formula date/time parser and formatter for this locale.

propertydateTimeSymbols
readonly dateTimeSymbols?: FormulaDateTimeSymbols

Locale-specific date/time symbols used by the shared Excel parser.

propertydisplayName
readonly displayName: string

User-facing language label supplied by the owner.

propertylocale
readonly locale: string

Stable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.

propertytextLocale
readonly textLocale: FormulaTextLocale

Formula text byte/width strategy for DBCS-compatible functions.

interfaceSheetI18nLocaleRegistrationsource ↗
interface SheetI18nLocaleRegistration

Locale contribution registered with the editor-local i18n registry.

propertycellFormatLocale
readonly cellFormatLocale?: CellFormatLocale

Sheet cell number and date/time display defaults for this locale.

propertydateTimeLocale
readonly dateTimeLocale?: FormulaDateTimeLocale

Formula date/time parser and formatter for this locale.

propertydateTimeSymbols
readonly dateTimeSymbols?: FormulaDateTimeSymbols

Locale-specific date/time symbols used by the shared Excel parser.

propertydisplayName
readonly displayName: string

User-facing language label supplied by the owner.

propertylocale
readonly locale: string

Stable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.

propertytextLocale
readonly textLocale?: FormulaTextLocale

Formula text byte/width strategy for DBCS-compatible functions.

interfaceSheetI18nStatesource ↗
interface SheetI18nState

Snapshot published by the sheet i18n observation.

propertylocale
readonly locale: string
typeSheetI18nLocalesource ↗
type SheetI18nLocale = string

Locale ids are open so third-party plugins can register their own BCP-47 tags.

variableSetSheetLocaleCommandsource ↗
SetSheetLocaleCommand: SheetCommandDefinition<SetSheetLocaleInput, SheetCommandResult>

Command that updates the editor-local language.

variableSheetI18nBuiltInLocalesource ↗
SheetI18nBuiltInLocale: { Chinese: "zh"; English: "en" }

Built-in locale identifiers registered by sear-plugin-i18n.

variableSheetI18nLocaleRegistryCapabilitysource ↗
SheetI18nLocaleRegistryCapability: RuntimeCapability<SheetI18nLocaleRegistry>

Runtime capability that exposes the sheet i18n locale registry to plugins and hosts.

variableSheetI18nSessionStateDefinitionsource ↗
SheetI18nSessionStateDefinition: SessionStateDefinition<SheetI18nState>

Local sheet i18n locale retained during in-memory editor remounts.

variableSheetI18nStateObservationsource ↗
SheetI18nStateObservation: StateObservationDefinition<SheetI18nState>

Editor-local sheet i18n locale state.

variableToggleSheetLocaleCommandsource ↗
ToggleSheetLocaleCommand: SheetCommandDefinition<void, SheetCommandResult>

Command that toggles between the built-in English and Chinese locales.

variableUnregisterSheetI18nLocaleCommandsource ↗
UnregisterSheetI18nLocaleCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one editor-local locale contribution.

functionisSheetI18nLocalesource ↗
isSheetI18nLocale(value: unknown): value

Returns whether a value is a non-empty locale id.

value: unknown
functionregisterBuiltInSheetI18nLocalessource ↗
registerBuiltInSheetI18nLocales(registry: SheetI18nLocaleRegistry): void

Registers the default English and Chinese locale contributions.

registry: SheetI18nLocaleRegistry

Package

@searsuite/sear-plugin-resize

45 exports

Sheet row and column dimensions, resize interaction, rendering, and persistence.

classSheetResizePluginsource ↗
class SheetResizePlugin extends Plugin<SearCoreSheet, CellProperties, ResizeState>

Owns row and column resize state, interaction, and visual feedback.

constructorconstructor
SheetResizePlugin(coordEngine: CoordinateEngine, cursorEngine: CursorEngine, textShaper: TextShaper, displayTextRegistry: CellDisplayTextReader, pointerCapture: PointerCapture, commands?: SheetCommandBus, platform?: Platform, cursorRegistry?: CursorRegistry, dimensions?: SheetResizeDimensions | null, commandDataEngine?: DataEngine): SheetResizePlugin

Creates a SheetResizePlugin instance.

coordEngine: CoordinateEngine
cursorEngine: CursorEngine
textShaper: TextShaper
displayTextRegistry: CellDisplayTextReader
pointerCapture: PointerCapture
commands: SheetCommandBus
platform: Platform
cursorRegistry: CursorRegistry
dimensions: SheetResizeDimensions | null
commandDataEngine: DataEngine
propertydepth
depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
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<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string } | { capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string }[]

SheetResizePlugin owns persisted dimension export modules.

propertyinterestedIn
interestedIn: string[]

Resize owns dimension OT and tracks sheet-structure shifts.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Resize transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
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<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string } | { capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<unknown> } | undefined; codec: { deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<unknown> }; key: string; serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<unknown> | undefined }; key: string }[]

Document-state export contributions for resize-owned dimensions.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all resize plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetResizePlugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: ResizeState, transaction: Transaction): ResizeState | null

Applies dimension and hidden-size operations owned by the resize plugin.

ReturnsUpdated plugin state, or null when the transaction does not affect dimensions.

pluginState: ResizeState
Current resize plugin state.
transaction: Transaction
Transaction containing resize or sheet-structure operations.
methodbeginResizeDrag
beginResizeDrag(input: SheetBeginResizeDragInput): void

Applies a command-owned resize drag start to local interaction state.

input: SheetBeginResizeDragInput
methoddirtyRect
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: SearCoreSheet
Sheet core containing render and scroll services.
transaction: Transaction
Transaction to inspect for resize operations.
methodendResizeDrag
endResizeDrag(): void

Clears command-owned resize drag state.

methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodgetResizeState
getResizeState(): ResizeDragState

Returns a detached view of the local drag session.

methodgetStateinherited
getState(): ResizeState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: ResizeState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: ResizeState
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClick
onDblClick(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

searCore: SearCoreSheet
_event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDown
onMouseDown(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove
onMouseMove(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: ResizeState, 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.

state: ResizeState
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the commands.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (resizeState: unknown): unknown; viewKey: string }[] }; key: PluginKey; state: ResizeState }[]

Registers the state.

methodrender
render(searCore: SearCoreSheet): Node<CellProperties>[] | null

Renders SheetResizePlugin scene output.

searCore: SearCoreSheet
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetResizeDimensions
setResizeDimensions(dimensions: SheetResizeDimensions): void

Installs the dimension matrices owned by this resize plugin instance.

dimensions: SheetResizeDimensions
Shared row, column, and hidden-size matrices for the sheet.
methodsetStateinherited
setState(state: ResizeState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: ResizeState
commitToken: object
methodupdateResizeDrag
updateResizeDrag(input: SheetUpdateResizeDragInput): void

Applies a command-owned resize drag move to local interaction state.

input: SheetUpdateResizeDragInput
interfaceSheetBeginResizeDragInputsource ↗
interface SheetBeginResizeDragInput

Public input for starting a resize drag session.

propertyaxis
readonly axis: SheetResizeAxis
propertyinitialSizes
readonly initialSizes: readonly SheetResizeDragInitialSize[]
propertyprimaryIndex
readonly primaryIndex: number
propertyworld
readonly world: { x: number; y: number }
interfaceSheetDimensionResizeInputsource ↗
interface SheetDimensionResizeInput

One explicit dimension change used by batch resize commands.

propertyindex
readonly index: number
propertypreviousSize
readonly previousSize?: number
propertysize
readonly size: number
interfaceSheetHideColumnsInputsource ↗
interface SheetHideColumnsInput

Public input for hiding columns starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetHideRowsInputsource ↗
interface SheetHideRowsInput

Public input for hiding rows starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetResizeColumnsBatchInputsource ↗
interface SheetResizeColumnsBatchInput

Public input for resizing arbitrary columns to explicit sizes.

propertysizes
readonly sizes: readonly SheetDimensionResizeInput[]
interfaceSheetResizeColumnsRangeInputsource ↗
interface SheetResizeColumnsRangeInput

Public input for resizing columns starting at index to a shared size.

propertycount
readonly count?: number
propertyindex
readonly index: number
propertysize
readonly size: number
interfaceSheetResizeDimensionCommandDataSourcesource ↗
interface SheetResizeDimensionCommandDataSource

Resize-owned data required to create invertible row and column dimension operations.

propertytarget
readonly target: PluginKey

Plugin key that owns row and column dimension state.

methodgetColumnCount
getColumnCount(): number

Current column dimension count.

methodgetDefaultColumnSize
getDefaultColumnSize(): number

Default column width used when no sparse override is stored.

methodgetDefaultRowSize
getDefaultRowSize(): number

Default row height used when no sparse override is stored.

methodgetRowCount
getRowCount(): number

Current row dimension count.

methodreadColumnHiddenOriginalSize
readColumnHiddenOriginalSize(index: number): number | null

Reads the cached original size for a hidden column, if one exists.

index: number
methodreadColumnSize
readColumnSize(index: number): number

Reads the current column width at index.

index: number
methodreadRowHiddenOriginalSize
readRowHiddenOriginalSize(index: number): number | null

Reads the cached original size for a hidden row, if one exists.

index: number
methodreadRowSize
readRowSize(index: number): number

Reads the current row height at index.

index: number
interfaceSheetResizeDimensionssource ↗
interface SheetResizeDimensions

Resize-owned dimension matrices accepted by SheetResizePlugin during setup.

propertycolumnHiddenOriginalSizes
columnHiddenOriginalSizes: CSRMatrix<number>

Original column sizes captured while columns are hidden.

propertycolumnSizes
columnSizes: DimensionsCSRMatrix

Column dimension matrix used for column width state.

propertyrowHiddenOriginalSizes
rowHiddenOriginalSizes: CSRMatrix<number>

Original row sizes captured while rows are hidden.

propertyrowSizes
rowSizes: DimensionsCSRMatrix

Row dimension matrix used for row height state.

interfaceSheetResizeDragCommandControllersource ↗
interface SheetResizeDragCommandController

Resize drag-session state controller owned by SheetResizePlugin.

methodbeginResizeDrag
beginResizeDrag(input: SheetBeginResizeDragInput): void
input: SheetBeginResizeDragInput
methodendResizeDrag
endResizeDrag(): void
methodupdateResizeDrag
updateResizeDrag(input: SheetUpdateResizeDragInput): void
input: SheetUpdateResizeDragInput
interfaceSheetResizeDragInitialSizesource ↗
interface SheetResizeDragInitialSize

One captured size at the start of a resize drag.

propertyindex
readonly index: number
propertysize
readonly size: number
interfaceSheetResizeRowsBatchInputsource ↗
interface SheetResizeRowsBatchInput

Public input for resizing arbitrary rows to explicit sizes.

propertysizes
readonly sizes: readonly SheetDimensionResizeInput[]
interfaceSheetResizeRowsRangeInputsource ↗
interface SheetResizeRowsRangeInput

Public input for resizing rows starting at index to a shared size.

propertycount
readonly count?: number
propertyindex
readonly index: number
propertysize
readonly size: number
interfaceSheetUnhideColumnsInputsource ↗
interface SheetUnhideColumnsInput

Public input for unhiding columns starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetUnhideRowsInputsource ↗
interface SheetUnhideRowsInput

Public input for unhiding rows starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetUpdateResizeDragInputsource ↗
interface SheetUpdateResizeDragInput

Public input for moving an active resize drag session.

propertyworld
readonly world: { x: number; y: number }
typeSheetResizeAxissource ↗
type SheetResizeAxis = "row" | "col"

Supported resize interaction axis.

typeSheetResizeColumnsInputsource ↗
type SheetResizeColumnsInput = SheetResizeColumnsRangeInput | SheetResizeColumnsBatchInput

Public input for resizing columns.

typeSheetResizeRowsInputsource ↗
type SheetResizeRowsInput = SheetResizeRowsRangeInput | SheetResizeRowsBatchInput

Public input for resizing rows.

variableBeginSheetResizeDragCommandsource ↗
BeginSheetResizeDragCommand: SheetCommandDefinition<SheetBeginResizeDragInput, SheetCommandResult>

Command that starts resize drag-session state through the command bus.

variableEndSheetResizeDragCommandsource ↗
EndSheetResizeDragCommand: SheetCommandDefinition<void, SheetCommandResult>

Command that clears resize drag-session state through the command bus.

variableHideSheetColumnsCommandsource ↗
HideSheetColumnsCommand: SheetCommandDefinition<SheetHideColumnsInput, SheetCommandResult>

Hides one or more columns by resizing them to zero.

variableHideSheetRowsCommandsource ↗
HideSheetRowsCommand: SheetCommandDefinition<SheetHideRowsInput, SheetCommandResult>

Hides one or more rows by resizing them to zero.

variableResizeSheetColumnsCommandsource ↗
ResizeSheetColumnsCommand: SheetCommandDefinition<SheetResizeColumnsInput, SheetCommandResult>

Resizes one or more column widths.

variableResizeSheetRowsCommandsource ↗
ResizeSheetRowsCommand: SheetCommandDefinition<SheetResizeRowsInput, SheetCommandResult>

Resizes one or more row heights.

variableSheetColumnHiddenOriginalSizesFieldKeysource ↗
SheetColumnHiddenOriginalSizesFieldKey: "sheet.resize.columnHiddenOriginalSizes"

DataEngine field for original dimensions of hidden columns owned by SheetResizePlugin.

variableSheetColumnSizesFieldKeysource ↗
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"

DataEngine field for column dimensions owned by SheetResizePlugin.

variableSheetRowHiddenOriginalSizesFieldKeysource ↗
SheetRowHiddenOriginalSizesFieldKey: "sheet.resize.rowHiddenOriginalSizes"

DataEngine field for original dimensions of hidden rows owned by SheetResizePlugin.

variableSheetRowSizesFieldKeysource ↗
SheetRowSizesFieldKey: "sheet.resize.rowSizes"

DataEngine field for row dimensions owned by SheetResizePlugin.

variableUnhideSheetColumnsCommandsource ↗
UnhideSheetColumnsCommand: SheetCommandDefinition<SheetUnhideColumnsInput, SheetCommandResult>

Restores one or more hidden columns from resize-owned hidden-size state.

variableUnhideSheetRowsCommandsource ↗
UnhideSheetRowsCommand: SheetCommandDefinition<SheetUnhideRowsInput, SheetCommandResult>

Restores one or more hidden rows from resize-owned hidden-size state.

variableUpdateSheetResizeDragCommandsource ↗
UpdateSheetResizeDragCommand: SheetCommandDefinition<SheetUpdateResizeDragInput, SheetCommandResult>

Command that updates resize drag-session state through the command bus.

functioncreateHideColumnOperationssource ↗
createHideColumnOperations(input: SheetHideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]

Creates column hide operations from public command input.

input: SheetHideColumnsInput
dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">
functioncreateHideRowOperationssource ↗
createHideRowOperations(input: SheetHideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]

Creates row hide operations from public command input.

input: SheetHideRowsInput
dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">
functioncreateResizeColumnOperationssource ↗
createResizeColumnOperations(input: SheetResizeColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]

Creates column resize operations from public command input.

input: SheetResizeColumnsInput
dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">
functioncreateResizeRowOperationssource ↗
createResizeRowOperations(input: SheetResizeRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]

Creates row resize operations from public command input.

input: SheetResizeRowsInput
dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">
functioncreateUnhideColumnOperationssource ↗
createUnhideColumnOperations(input: SheetUnhideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "getDefaultColumnSize" | "readColumnHiddenOriginalSize" | "readColumnSize">): Operation[]

Creates column unhide operations from public command input.

input: SheetUnhideColumnsInput
dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "getDefaultColumnSize" | "readColumnHiddenOriginalSize" | "readColumnSize">
functioncreateUnhideRowOperationssource ↗
createUnhideRowOperations(input: SheetUnhideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "getDefaultRowSize" | "readRowHiddenOriginalSize" | "readRowSize">): Operation[]

Creates row unhide operations from public command input.

input: SheetUnhideRowsInput
dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "getDefaultRowSize" | "readRowHiddenOriginalSize" | "readRowSize">
functionreadSheetColumnHiddenOriginalSizessource ↗
readSheetColumnHiddenOriginalSizes(dataEngine: DataEngine): CSRMatrix<number> | null

Reads original column sizes captured while columns are hidden.

dataEngine: DataEngine
functionreadSheetColumnSizessource ↗
readSheetColumnSizes(dataEngine: DataEngine): DimensionsCSRMatrix | null

Reads column dimensions published by SheetResizePlugin.

dataEngine: DataEngine
functionreadSheetRowHiddenOriginalSizessource ↗
readSheetRowHiddenOriginalSizes(dataEngine: DataEngine): CSRMatrix<number> | null

Reads original row sizes captured while rows are hidden.

dataEngine: DataEngine
functionreadSheetRowSizessource ↗
readSheetRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | null

Reads row dimensions published by SheetResizePlugin.

dataEngine: DataEngine
functionregisterSheetResizeCommandssource ↗
registerSheetResizeCommands(commands: SheetCommandBus, dataSource: SheetResizeDimensionCommandDataSource, controller: SheetResizeDragCommandController): void

Registers the complete command surface owned by SheetResizePlugin.

commands: SheetCommandBus
Command bus owned by the current sheet editor.
dataSource: SheetResizeDimensionCommandDataSource
Resize state reader used by semantic dimension commands.
controller: SheetResizeDragCommandController
functionregisterSheetResizeDimensionCommandssource ↗
registerSheetResizeDimensionCommands(commands: SheetCommandBus, dataSource: SheetResizeDimensionCommandDataSource): void

Registers row and column dimension commands on one sheet command bus.

commands: SheetCommandBus
dataSource: SheetResizeDimensionCommandDataSource
functionregisterSheetResizeDragCommandssource ↗
registerSheetResizeDragCommands(commands: SheetCommandBus, controller: SheetResizeDragCommandController): void

Registers resize drag-session command factories on one editor command bus.

commands: SheetCommandBus
Command bus owned by the current sheet editor.
controller: SheetResizeDragCommandController
Resize plugin controller that owns local drag-session state.

Package

@searsuite/sear-plugin-selection

47 exports

Sheet selection state, navigation, observations, highlights, and commands.

enumSheetAdditionalSelectionModesource ↗
enum SheetAdditionalSelectionMode

How a selection command updates disjoint local selections.

enum memberAppendCurrent
AppendCurrent: "append-current"
enum memberClear
Clear: "clear"
enum memberPreserve
Preserve: "preserve"
enumSheetHighlightPipelineStepNamesource ↗
enum SheetHighlightPipelineStepName

Observable pipeline steps owned by the generic range-highlight host.

enum memberRefresh
Refresh: "sheet-highlight.refresh"
enumSheetSelectionInteractionNamesource ↗
enum SheetSelectionInteractionName

Enumerates SheetSelectionInteractionName values.

enum memberChanged
Changed: "selection-changed"
enumSheetSelectionPipelineNamesource ↗
enum SheetSelectionPipelineName

Observable pipeline and step names owned by the Selection module.

enum memberSelectionChange
SelectionChange: "selection-change"
enumSheetSelectionPipelineStepNamesource ↗
enum SheetSelectionPipelineStepName

Enumerates SheetSelectionPipelineStepName values.

enum memberEnsureSelectionVisible
EnsureSelectionVisible: "selection.ensure-selection-visible"
enum memberRecordSelectionChange
RecordSelectionChange: "selection.record-selection-change"
enum memberUpdateSelection
UpdateSelection: "selection.update-selection"
enumSheetSelectionPointerActionsource ↗
enum SheetSelectionPointerAction

Pointer-session transitions owned by the Sheet selection plugin.

enum memberDown
Down: "down"
enum memberMove
Move: "move"
enum memberTick
Tick: "tick"
enum memberUp
Up: "up"
enumSheetSelectionSourcesource ↗
enum SheetSelectionSource

Enumerates SheetSelectionSource values.

enum memberApi
Api: "api"
enum memberKeyboard
Keyboard: "keyboard"
enum memberPointer
Pointer: "pointer"
classSheetHighlightPluginsource ↗
class SheetHighlightPlugin extends Plugin<SearCoreSheet, CellProperties, Record<string, never>>

Renders registered range-highlighter output as a single managed scene layer.

constructorconstructor
SheetHighlightPlugin(registry: SheetHighlightRegistry): SheetHighlightPlugin

Creates a SheetHighlightPlugin instance.

registry: SheetHighlightRegistry
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<Record<string, never>, object> | readonly PluginDocumentStateContribution<Record<string, never>, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetHighlightPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetHighlightPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: Record<string, never>, _transaction: Transaction): Record<string, never> | null

Applies a transaction to SheetHighlightPlugin state.

_state: Record<string, never>
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodgetStateinherited
getState(): Record<string, never>

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
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.

state: PluginStateType
transaction: Transaction
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { key: PluginKey; state: Record<string, never> }

Registers the state.

methodrender
render(searCore: SearCoreSheet): Node<CellProperties>[]

Renders SheetHighlightPlugin scene output.

searCore: SearCoreSheet
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
classSheetHighlightRegistrysource ↗
class SheetHighlightRegistry

Registry for independently replaceable sheet-range highlighters.

The registry owns provider activation and change notification; the paired
SheetHighlightPlugin owns scene-node creation and teardown.

constructorconstructor
SheetHighlightRegistry(platform?: Platform): SheetHighlightRegistry
platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetHighlightRegistry.

methodgetHighlights
getHighlights(context: SheetHighlightContext): SheetRangeHighlight[]

Returns the highlights.

context: SheetHighlightContext
methodinvalidate
invalidate(): void

Requests a new provider evaluation when state read by a provider (for
example selection, search terms, or remote cursors) changes externally.

methodregister
register(provider: SheetHighlightProvider): (): void

Registers the value.

provider: SheetHighlightProvider
methodsetEnabled
setEnabled(providerKey: string, enabled: boolean): void

Updates the enabled.

providerKey: string
enabled: boolean
methodsubscribe
subscribe(listener: (): void): (): void

Subscribes to state changes and returns an idempotent disposer.

listener: (): void
classSheetRangeDragsource ↗
class SheetRangeDrag

Owns one local range-border gesture; document changes enter through the move command.

constructorconstructor
SheetRangeDrag(commands: SheetCommandBus, queries: SheetQueryRegistry, coordinates: CoordinateEngine, pointer: PointerCapture, keyboard: KeyboardRouter, cursorRules: CursorRegistry, cursor: CursorEngine, highlights: SheetHighlightRegistry, platform: Platform, interactions: SheetInteractionStore): SheetRangeDrag
commands: SheetCommandBus
queries: SheetQueryRegistry
coordinates: CoordinateEngine
pointer: PointerCapture
keyboard: KeyboardRouter
cursorRules: CursorRegistry
cursor: CursorEngine
highlights: SheetHighlightRegistry
platform: Platform
interactions: SheetInteractionStore
propertysymbolstatic
readonly symbol: typeof symbol
methodbind
bind(core: SearCoreSheet, readSelection: (): Rect, ownerToken: object): void

Installs editor-local cursor and preview contributions once Core is available.

core: SearCoreSheet
readSelection: (): Rect
ownerToken: object
methoddestroy
destroy(ownerToken?: object): void

Idempotently releases preview, cursor, pointer capture and animation resources.

ownerToken: object
methodisActive
isActive(): boolean
methodonMouseDown
onMouseDown(event: EventWithOffsetAndTarget<CellProperties>): boolean

Starts on selection borders or already selected axis headers.

event: EventWithOffsetAndTarget<CellProperties>
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Routes local pointer and animation inputs through the editor command boundary.

commands: SheetCommandBus
methodsetUserInteraction
setUserInteraction(service: UserInteractionService | undefined): void

Binds the optional host-owned confirmation service during assembly.

service: UserInteractionService | undefined
classSheetRangeMoveErrorsource ↗
class SheetRangeMoveError extends SearError

A range move rejected before any document state was staged.

constructorconstructor
SheetRangeMoveError(code: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED", message: string, details: SearErrorDetails): SheetRangeMoveError
code: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED"
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycodeinherited
readonly code: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetSelectionPluginsource ↗
class SheetSelectionPlugin extends Plugin<SearCoreSheet, CellProperties, [RectRange, RectRange]>

Owns Sheet selections, navigation, commands, and observations.

constructorconstructor
SheetSelectionPlugin(sheetCellMergePlugin: SheetCellMergePlugin, keyboardRouter: KeyboardRouter, platform?: Platform, interactionReducers?: SheetInteractionReducerRegistry, commands?: SheetCommandBus, rangeMoves?: SheetRangeMoveRegistry, rangeDrag?: SheetRangeDrag, highlights?: SheetHighlightRegistry): SheetSelectionPlugin

Creates a SheetSelectionPlugin instance.

sheetCellMergePlugin: SheetCellMergePlugin
keyboardRouter: KeyboardRouter
platform: Platform
interactionReducers: SheetInteractionReducerRegistry
commands: SheetCommandBus
rangeMoves: SheetRangeMoveRegistry
rangeDrag: SheetRangeDrag
highlights: SheetHighlightRegistry
propertydepth
depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<[Rect, Rect], object> | readonly PluginDocumentStateContribution<[Rect, Rect], object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetSelectionPlugin.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetSelectionPlugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: [Rect, Rect], transaction: Transaction): [Rect, Rect] | null

Applies a transaction to SheetSelectionPlugin state.

pluginState: [Rect, Rect]
transaction: Transaction
methodbindCore
bindCore(core: SearCoreSheet): void

Binds this plugin to the core owned by its editor-local container.

core: SearCoreSheet
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodextendForDownwardEntry
extendForDownwardEntry(): void

Adds a destination row only when Enter would otherwise keep the active cell in place.

methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): null

Returns the plugin config.

searCore: SearCoreSheet
methodgetStateinherited
getState(): [Rect, Rect]

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodisInMergedCell
isInMergedCell(rangeRect: Rect): Rect | null

Returns whether in merged cell.

rangeRect: Rect
methodlockCommittedState
lockCommittedState(state: [Rect, Rect]): void

Locks committed selection rectangles while transaction clones remain writable.

state: [Rect, Rect]
methodnavigate
navigate(direction: "left" | "right" | "up" | "down", shiftKey?: boolean, metaKey?: boolean): void

Moves the current Sheet selection according to the requested direction.

direction: "left" | "right" | "up" | "down"
shiftKey: boolean
metaKey: boolean
methodnavigateDown
navigateDown(): void

Moves the current Sheet selection to the next selectable row.

methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClick
onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the dbl click lifecycle event.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroy
onEditorDestroy(): void

Cancels transient pointer work before this editor is released.

methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDown
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the mouse down lifecycle event.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the mouse move lifecycle event.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp
onMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the mouse up lifecycle event.

_searCore: SearCoreSheet
_event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

Rebases local keyboard anchors only after structural transactions commit.

transaction: Transaction
methodprojectTransactioninherited
projectTransaction(state: [Rect, Rect], 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.

state: [Rect, Rect]
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the commands.

commands: SheetCommandBus
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ defaultBorderColor: string }>; key: PluginKey }[]

Registers default configuration values owned by this plugin.

methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

Registers the active selection as a typed query rather than a DataEngine field.

queries: SheetQueryRegistry
methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers selection-owned local remount state.

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: [Rect, Rect] }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders SheetSelectionPlugin scene output.

searCore: SearCoreSheet
offset: { x: number; y: number }
methodrestartNavigation
restartNavigation(): void

Restarts selection navigation from the current active cell.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: [Rect, Rect], commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: [Rect, Rect]
commitToken: object
interfaceMoveSheetRangeInputsource ↗
interface MoveSheetRangeInput

Moves a single rectangle to a new top-left coordinate on the same sheet.

propertyoverwrite
readonly overwrite?: boolean

Explicit authorization to replace existing destination data.

propertysource
readonly source: SheetMoveRange
propertytarget
readonly target: readonly [number, number]
interfaceSelectionChangedInteractionSignalsource ↗
interface SelectionChangedInteractionSignal extends SheetInteractionSignal

Public contract for SelectionChangedInteractionSignal.

propertyanchor
anchor: Point
propertyfocus
focus: Point
propertysource
source: SheetSelectionSource
propertytype
type: SheetSelectionInteractionName
interfaceSheetEnsureSelectionVisibleInputsource ↗
interface SheetEnsureSelectionVisibleInput extends SheetSelectRangeInput

Public contract for SheetEnsureSelectionVisibleInput.

propertyactiveAnchorinherited
readonly activeAnchor?: Point

Optional active anchor stored for in-progress pointer or keyboard interactions.

propertyactiveFocusinherited
readonly activeFocus?: Point

Optional active focus stored for in-progress pointer or keyboard interactions.

propertyadditionalSelectionModeinherited
readonly additionalSelectionMode?: SheetAdditionalSelectionMode

Transition applied to disjoint local selections at commit.

propertyanchorinherited
readonly anchor: Point

Final selected range anchor.

propertyensureVisibleinherited
readonly ensureVisible?: boolean

Whether the command should also scroll the selection into view.

propertyfocusinherited
readonly focus: Point

Final selected range focus.

propertynavigationinherited
readonly navigation?: { cursor: Point; origin: Point }

Keyboard navigation anchor and cursor to publish with this selection.

propertysourceinherited
readonly source?: SheetSelectionSource

Origin of this selection change.

interfaceSheetFillRangeInputsource ↗
interface SheetFillRangeInput
propertysource
readonly source: { end: readonly [number, number]; start: readonly [number, number] }
propertytarget
readonly target: readonly [number, number]
interfaceSheetHighlightContextsource ↗
interface SheetHighlightContext

Read-only sheet state made available to every range-highlight provider.

propertysearCore
searCore: SearCoreSheet
interfaceSheetHighlightProvidersource ↗
interface SheetHighlightProvider

Extension point for range decorations such as formula precedents, search
results, validation errors, collaboration selections, and audit trails.

propertykey
key: string
methodgetHighlights
getHighlights(context: SheetHighlightContext): SheetRangeHighlight[]
context: SheetHighlightContext
interfaceSheetRangeHighlightsource ↗
interface SheetRangeHighlight

A visual-only cell range supplied by an independently registered provider.

propertydepth
depth?: number
propertyedge
edge?: SheetHighlightEdge
propertyend
end: Point
propertyfill
fill?: string
propertyinset
inset?: number

Insets the visual box from the resolved cell-range boundary.

propertyskipHit
skipHit?: boolean
propertystart
start: Point
propertystroke
stroke?: string
propertystrokeWidth
strokeWidth?: number
propertytype
type?: string
interfaceSheetSelectionPointerInputsource ↗
interface SheetSelectionPointerInput

Detached input coordinates for a selection pointer transition.

propertyaction
readonly action: SheetSelectionPointerAction
propertyctrlKey
readonly ctrlKey?: boolean
propertymetaKey
readonly metaKey?: boolean
propertyshiftKey
readonly shiftKey?: boolean
propertytarget
readonly target?: { endColIndex: number | undefined; endRowIndex: number | undefined; region: CellRegion | undefined; startColIndex: number | undefined; startRowIndex: number | undefined } | null
propertyview
readonly view?: { x: number; y: number }
interfaceSheetSelectRangeInputsource ↗
interface SheetSelectRangeInput

Public programmatic input for selecting a rectangular sheet range.

propertyactiveAnchor
readonly activeAnchor?: Point

Optional active anchor stored for in-progress pointer or keyboard interactions.

propertyactiveFocus
readonly activeFocus?: Point

Optional active focus stored for in-progress pointer or keyboard interactions.

propertyadditionalSelectionMode
readonly additionalSelectionMode?: SheetAdditionalSelectionMode

Transition applied to disjoint local selections at commit.

propertyanchor
readonly anchor: Point

Final selected range anchor.

propertyensureVisible
readonly ensureVisible?: boolean

Whether the command should also scroll the selection into view.

propertyfocus
readonly focus: Point

Final selected range focus.

propertynavigation
readonly navigation?: { cursor: Point; origin: Point }

Keyboard navigation anchor and cursor to publish with this selection.

propertysource
readonly source?: SheetSelectionSource

Origin of this selection change.

typeSheetDragAxissource ↗
type SheetDragAxis = typeof SheetDragAxis[keyof typeof SheetDragAxis]

Canonical axes for complete row/column selection gestures.

typeSheetHighlightEdgesource ↗
type SheetHighlightEdge = typeof SheetHighlightEdge[keyof typeof SheetHighlightEdge]

Viewport-spanning overlay guide anchored to a cell-range edge.

typeSheetRangeDragInputsource ↗
type SheetRangeDragInput = { action: typeof SheetRangeDragAction.Begin | typeof SheetRangeDragAction.FillBegin | typeof SheetRangeDragAction.Update | typeof SheetRangeDragAction.Release; point: PointerCapturePoint } | { action: typeof SheetRangeDragAction.Cancel | typeof SheetRangeDragAction.Tick }

Portable inputs for one local gesture, never persisted as document state.

typeSheetSelectionSessionStatesource ↗
type SheetSelectionSessionState = readonly [RectRange, RectRange]

Local selection state retained while remounting one workbook sheet.

variableAnalyzeSheetRangeMovesource ↗
AnalyzeSheetRangeMove: SheetQueryDefinition<MoveSheetRangeInput, SheetRangeMoveAnalysis>

Reads the latest legal destination and owner constraints for a range move.

variableClearSelectedContentsCommandsource ↗
ClearSelectedContentsCommand: SheetCommandDefinition<void, SheetCommandResult>

Clears every rectangle of a disjoint selection in one data transaction.

variableEnsureSelectionVisibleCommandsource ↗
EnsureSelectionVisibleCommand: SheetCommandDefinition<SheetEnsureSelectionVisibleInput, SheetCommandResult>
variableFillSheetRangeCommandsource ↗
FillSheetRangeCommand: SheetCommandDefinition<SheetFillRangeInput, SheetCommandResult>

Fills cells from a selected source rectangle through the pointer destination.

variableGetActiveCellsource ↗
GetActiveCell: SheetQueryDefinition<void, readonly [number, number] | null>

Reads the cell where the current selection began, including reversed ranges.

variableGetSelectionsource ↗
GetSelection: SheetQueryDefinition<void, SheetRangeBounds | null>

Typed query for the active rectangular selection, independent of selection storage.

variableGetSelectionNavigationsource ↗
GetSelectionNavigation: SheetQueryDefinition<void, { cursor: Point | null; origin: Point | null }>

Detached keyboard navigation anchors for diagnostics and extensions.

variableGetSelectionssource ↗
GetSelections: SheetQueryDefinition<void, readonly SheetRangeBounds[]>

All disjoint selections, with the current active rectangle last.

variableGetSheetRangeMoveConflictsource ↗
GetSheetRangeMoveConflict: SheetQueryDefinition<MoveSheetRangeInput, boolean>

Validates a move and reports whether replacement requires user authorization.

variableHandleSheetRangeDragCommandsource ↗
HandleSheetRangeDragCommand: SheetCommandDefinition<SheetRangeDragInput, SheetCommandResult>
variableHandleSheetSelectionPointerCommandsource ↗
HandleSheetSelectionPointerCommand: SheetCommandDefinition<SheetSelectionPointerInput, SheetCommandResult>

Routes selection pointer-session changes through the editor command bus.

variableMoveSheetRangeCommandsource ↗
MoveSheetRangeCommand: SheetCommandDefinition<MoveSheetRangeInput, SheetCommandResult>
variableRestartSheetSelectionNavigationCommandsource ↗
RestartSheetSelectionNavigationCommand: SheetCommandDefinition<void, SheetCommandResult>

Restarts selection keyboard navigation after another editor releases focus.

variableSelectRangeCommandsource ↗
SelectRangeCommand: SheetCommandDefinition<SheetSelectRangeInput, SheetCommandResult>
variableSheetDragAxissource ↗
SheetDragAxis: { Column: 1; Row: 0 }

Canonical axes for complete row/column selection gestures.

variableSheetHighlightEdgesource ↗
SheetHighlightEdge: { Bottom: "bottom"; Left: "left"; Right: "right"; Top: "top" }

Viewport-spanning overlay guide anchored to a cell-range edge.

variableSheetRangeDragActionsource ↗
SheetRangeDragAction: { Begin: "begin"; Cancel: "cancel"; FillBegin: "fill-begin"; Release: "release"; Tick: "tick"; Update: "update" }

Canonical phases of a local range-border gesture.

variableSheetRangeMoveErrorCodesource ↗
SheetRangeMoveErrorCode: { DestinationOccupied: "SHEET_MOVE_DESTINATION_OCCUPIED"; InvalidRange: "SHEET_MOVE_INVALID_RANGE" }

Stable range-move validation failures exposed to hosts.

variableSheetSelectionRenderSemanticssource ↗
SheetSelectionRenderSemantics: { outlineRole: "selection-outline"; owner: "sheet-selection" }

Stable semantic attributes emitted by retained render targets for Selection.

variableSheetSelectionSessionStateDefinitionsource ↗
SheetSelectionSessionStateDefinition: SessionStateDefinition<SheetSelectionSessionState>

Stable session-state identity owned by SheetSelectionPlugin.

functionregisterSelectionQueriessource ↗
registerSelectionQueries(queries: SheetQueryRegistry, readSelection: (): SheetRangeBounds | null): void

Registers the selection query against an editor-local query registry.

queries: SheetQueryRegistry
readSelection: (): SheetRangeBounds | null
functionregisterSheetSelectionInteractionReducerssource ↗
registerSheetSelectionInteractionReducers(registry: SheetInteractionReducerRegistry): void

Registers Selection's local interaction projection once per DI container.

registry: SheetInteractionReducerRegistry

Package

@searsuite/sear-plugin-sheet-demo

17 exports

A complete, optional Sheet state-owner plugin example.

classSheetDemoMatrixsource ↗
class SheetDemoMatrix extends CSRMatrix<SheetDemoMarker | null>

One marker per cell; absence and null both mean no marker.

constructorconstructor
SheetDemoMatrix(data?: SheetDemoMatrixData, shape?: [number, number]): SheetDemoMatrix
data: SheetDemoMatrixData
shape: [number, number]
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: SheetDemoMarker | null[]): SheetDemoMatrix

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: number
The index where the new column should be inserted.
col: SheetDemoMarker | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddItem
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: number
The row index.
column: number
marker: SheetDemoMarker | null
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: SheetDemoMarker | null[]): SheetDemoMatrix

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: number
The index at which to add the row.
row: SheetDemoMarker | null[]
The row to add.
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: SheetDemoMarker | null): SheetDemoMarker | null): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: SheetDemoMarker | null): SheetDemoMarker | null
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetDemoMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): SheetDemoMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<SheetDemoMarker | null>[]): SheetDemoMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<SheetDemoMarker | null>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: SheetDemoMarker | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: SheetDemoMarker | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: SheetDemoMarker | null, 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).

callback: (value: SheetDemoMarker | null, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: SheetDemoMarker | null, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: SheetDemoMarker | null, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: SheetDemoMarker | null, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: SheetDemoMarker | null, col: number): void
methodfromDenseinherited
fromDense(denseArray: SheetDemoMarker | null[][]): SheetDemoMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: SheetDemoMarker | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): SheetDemoMarker | null | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): SheetDemoMarker | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): SheetDemoMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: SheetDemoMarker | null): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: SheetDemoMarker | null
The default value to return for missing elements
methodsetItem
setItem(row: number, column: number, marker: SheetDemoMarker | null): this
row: number
column: number
marker: SheetDemoMarker | null
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): SheetDemoMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): SheetDemoMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): SheetDemoMarker | null[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

classSheetDemoPluginsource ↗
class SheetDemoPlugin extends SheetPlugin<SheetDemoPluginState>

Reference implementation of a collaborative, matrix-backed Sheet feature.

constructorconstructor
SheetDemoPlugin(state: SheetDemoPluginState): SheetDemoPlugin
state: SheetDemoPluginState
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetDemoPluginState, SheetDemoPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetDemoPluginState, SheetDemoPluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(state: SheetDemoPluginState, transaction: Transaction): SheetDemoPluginState | null

Applies a transaction to plugin-owned state and returns the next state.

state: SheetDemoPluginState
transaction: Transaction
methodconfigureinherited
configure(context: SheetPluginSetupContext): void

Configures the Sheet editor before its Core is created.

context: SheetPluginSetupContext
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): SheetDemoPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitializeinherited
initialize(context: SheetPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before
the first frame and other runtime effects.

context: SheetPluginRuntimeContext
methodlockCommittedStateinherited
lockCommittedState(state: SheetDemoPluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetDemoPluginState
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroyinherited
onEditorDestroy(context: SheetPluginRuntimeContext): void

Releases resources owned by this plugin before the Core is destroyed.

This deliberately does not use the name destroy: DI containers may
treat a no-argument destroy() method as an owned-instance disposer.

context: SheetPluginRuntimeContext
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetDemoPluginState, 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.

state: SheetDemoPluginState
transaction: Transaction
methodregisterCapabilitiesinherited
registerCapabilities(registry: SheetRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this plugin.

registry: SheetRuntimeExtensionRegistry
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

This is an override because cell fill already has a separate owner.

registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers every stable command id owned by this plugin.

commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterFormatTransfersinherited
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Contributes owner-defined format capture and transfer plans.

registry: SheetFormatTransferRegistry
methodregisterObservationsinherited
registerObservations(observations: ObservationRegistry): void

Registers typed state and event observations owned by this plugin.

observations: ObservationRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes state-owner planning for same-sheet cell moves.

registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterSessionStateinherited
registerSessionState(registry: SessionStateRegistry): void

Registers local state that must survive an in-memory editor remount.

registry: SessionStateRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): SheetDemoMatrix; viewKey: string }[] }; key: PluginKey; state: SheetDemoPluginState }

Registers one or more plugin-owned state records with the host manager.

methodregisterStructureMovesinherited
registerStructureMoves(registry: SheetStructureMoveRegistry): void

Contributes preflight and dependent operation planning for whole-axis reordering.

registry: SheetStructureMoveRegistry
methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetDemoPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetDemoPluginState
commitToken: object
methodstartinherited
start(context: SheetPluginRuntimeContext): void

Starts runtime behavior after the Core has rendered its first frame.

context: SheetPluginRuntimeContext
methodregisterServicesstaticinherited
registerServices(context: SheetPluginServiceContext): void

Registers bindings required before this Sheet plugin is instantiated.

context: SheetPluginServiceContext
interfaceSetSheetDemoMarkerInputsource ↗
interface SetSheetDemoMarkerInput extends SheetDemoCellInput
propertycolumninherited
readonly column: number
propertymarker
readonly marker: SheetDemoMarker | null
propertyrowinherited
readonly row: number
interfaceSheetDemoCellInputsource ↗
interface SheetDemoCellInput
propertycolumn
readonly column: number
propertyrow
readonly row: number
interfaceSheetDemoCommandSourcesource ↗
interface SheetDemoCommandSource
propertytarget
readonly target: PluginKey
methodreadMatrix
readMatrix(): SheetDemoMatrix
interfaceSheetDemoMatrixDatasource ↗
interface SheetDemoMatrixData
propertydata
readonly data: SheetDemoMarker | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetDemoPluginStatesource ↗
interface SheetDemoPluginState
propertymarkers
readonly markers: SheetDemoMatrix
typeSheetDemoMarkersource ↗
type SheetDemoMarker = typeof SheetDemoMarker[keyof typeof SheetDemoMarker]

Canonical persisted values owned by the demo feature.

variableReadSheetDemoMarkerQuerysource ↗
ReadSheetDemoMarkerQuery: SheetQueryDefinition<SheetDemoCellInput, SheetDemoMarker | null>
variableSetSheetDemoMarkerCommandsource ↗
SetSheetDemoMarkerCommand: SheetCommandDefinition<SetSheetDemoMarkerInput, SheetCommandResult>
variableSheetDemoFieldKeysource ↗
SheetDemoFieldKey: "sheet.demo.markers"
variableSheetDemoMarkersource ↗
SheetDemoMarker: { Approved: "approved"; Review: "review" }

Canonical persisted values owned by the demo feature.

variableSheetDemoStateTokensource ↗
SheetDemoStateToken: typeof SheetDemoStateToken

The host binds one state object per Sheet editor before plugin construction.

functionassertSheetDemoMarkersource ↗
assertSheetDemoMarker(value: unknown): value
value: unknown
functionreadSheetDemoMarkerssource ↗
readSheetDemoMarkers(dataEngine: DataEngine): SheetDemoMatrix | null
dataEngine: DataEngine
functionregisterSheetDemoCommandssource ↗
registerSheetDemoCommands(commands: SheetCommandBus, source: SheetDemoCommandSource): void
commands: SheetCommandBus
source: SheetDemoCommandSource
functionregisterSheetDemoQueriessource ↗
registerSheetDemoQueries(queries: SheetQueryRegistry, readMatrix: (): SheetDemoMatrix): void
queries: SheetQueryRegistry
readMatrix: (): SheetDemoMatrix

Package

@searsuite/sear-plugin-sheet-doc-adapter

17 exports

The default Doc-backed rich-text editor adapter for Sheet cells.

classSearCoreEditorAdaptersource ↗
class SearCoreEditorAdapter extends SheetEmbeddedEditor

Sheet adapter that owns one lightweight SearCoreDoc for all embedded cells.

constructorconstructor
SearCoreEditorAdapter(options?: SearCoreEditorAdapterOptions): SearCoreEditorAdapter
options: SearCoreEditorAdapterOptions
propertyformatting
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.

propertyobservations
readonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

methodbindTeardownToken
bindTeardownToken(token: object): void

Restricts runtime teardown to the owning Sheet editor when supported.

token: object
methodcreateEditSession
createEditSession(context: SheetEmbeddedEditorContext): SheetEditSession
context: SheetEmbeddedEditorContext
methodcreateRenderSession
createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSession
context: SheetEmbeddedEditorContext
methoddispose
dispose(ownerToken?: object): void
ownerToken: object
methodinitialize
initialize(context: SheetEmbeddedEditorContext): void
context: SheetEmbeddedEditorContext
classSheetCellContextPluginsource ↗
class SheetCellContextPlugin extends SheetEmbeddedEditorPlugin

Adapts Sheet cell geometry and pointer coordinates for embedded sessions.

constructorconstructor
SheetCellContextPlugin(): SheetCellContextPlugin
propertykey
readonly key: "sheet.cell-context"

Stable identity used to reject duplicate registrations.

methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void

Called once when the adapter is initialized.

context: SheetEmbeddedEditorPluginContext
methodtoLocalPoint
toLocalPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPoint
context: SheetEmbeddedEditorContext
point: SheetEditorPoint
methodtoSheetPoint
toSheetPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPoint
context: SheetEmbeddedEditorContext
point: SheetEditorPoint
classSheetClipboardPluginsource ↗
class SheetClipboardPlugin extends SheetEmbeddedEditorPlugin

Sheet clipboard codec for the shared rich-document snapshot protocol.

constructorconstructor
SheetClipboardPlugin(): SheetClipboardPlugin
propertykey
readonly key: "sheet.clipboard"

Stable identity used to reject duplicate registrations.

methoddeserialize
deserialize(value: string): SheetDocument
value: string
methodserialize
serialize(document: SheetDocument): string
document: SheetDocument
classSheetDocIntegrationPluginsource ↗
class SheetDocIntegrationPlugin extends SheetEmbeddedEditorPlugin

Extension point for Sheet-to-Doc integration policies.

constructorconstructor
SheetDocIntegrationPlugin(): SheetDocIntegrationPlugin
propertykey
readonly key: "sheet.doc-integration"

Stable identity used to reject duplicate registrations.

classSheetEmbeddedEditorPluginRegistrysource ↗
class SheetEmbeddedEditorPluginRegistry

Ordered registry used by the lightweight Sheet embedded editor.

constructorconstructor
SheetEmbeddedEditorPluginRegistry(): SheetEmbeddedEditorPluginRegistry
methoddispose
dispose(ownerToken?: object): void
ownerToken: object
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Restricts plugin changes after the embedded editor joins a Sheet command bus.

assertWrite: (): void
teardownToken: object
methodget
get(key: string): SheetEmbeddedEditorPlugin | undefined
key: string
methodgetAll
getAll(): readonly SheetEmbeddedEditorPlugin[]
methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void
context: SheetEmbeddedEditorPluginContext
methodnotifyCancel
notifyCancel(context: SheetEmbeddedEditorPluginContext): void
context: SheetEmbeddedEditorPluginContext
methodnotifyCommit
notifyCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void
document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodnotifyRender
notifyRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void
update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
methodregister
register(plugin: SheetEmbeddedEditorPlugin): void
plugin: SheetEmbeddedEditorPlugin
methodtransformCommit
transformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): SheetDocument | null
document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodtransformInlineStyle
transformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): SheetInlineStyleUpdate | null
update: SheetInlineStyleUpdate
context: SheetEmbeddedEditorPluginContext
methodtransformInput
transformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): SheetEditInput | null
input: SheetEditInput
context: SheetEmbeddedEditorPluginContext
methodunregister
unregister(key: string): void
key: string
classSheetFormulaReferencePluginsource ↗
class SheetFormulaReferencePlugin extends SheetEmbeddedEditorPlugin

Finds formula-like references for Sheet overlays without changing document data.

constructorconstructor
SheetFormulaReferencePlugin(): SheetFormulaReferencePlugin
propertykey
readonly key: "sheet.formula-reference"

Stable identity used to reject duplicate registrations.

methoddispose
dispose(): void

Called before the adapter releases this plugin.

methodgetReferences
getReferences(): readonly string[]
methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void

Called once when the adapter is initialized.

context: SheetEmbeddedEditorPluginContext
methodonRender
onRender(_update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void

Called after a render pass has completed.

_update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
classSheetOverflowPluginsource ↗
class SheetOverflowPlugin extends SheetEmbeddedEditorPlugin

Keeps overflow sizing as a Sheet concern and requests geometry redraws.

constructorconstructor
SheetOverflowPlugin(): SheetOverflowPlugin
propertykey
readonly key: "sheet.overflow"

Stable identity used to reject duplicate registrations.

methoddispose
dispose(): void

Called before the adapter releases this plugin.

methodgetContentSize
getContentSize(): { height: number; width: number } | null
methodonCommit
onCommit(_document: SheetDocument, _context: SheetEmbeddedEditorPluginContext): void

Called after Sheet has committed the edited document.

_document: SheetDocument
_context: SheetEmbeddedEditorPluginContext
methodonRender
onRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void

Called after a render pass has completed.

update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
classSheetShortcutPluginsource ↗
class SheetShortcutPlugin extends SheetEmbeddedEditorPlugin

Optional key mapping hook for Sheet hosts that add cell-navigation shortcuts.

constructorconstructor
SheetShortcutPlugin(shortcuts?: Readonly<Record<string, SheetEditInput>>): SheetShortcutPlugin
shortcuts: Readonly<Record<string, SheetEditInput>>
propertykey
readonly key: "sheet.shortcuts"

Stable identity used to reject duplicate registrations.

methodtransformInput
transformInput(input: SheetEditInput, _context: SheetEmbeddedEditorPluginContext): SheetEditInput

Allows a plugin to normalize or consume Sheet keyboard/text input.

input: SheetEditInput
_context: SheetEmbeddedEditorPluginContext
interfaceEmbeddedDocConfigsource ↗
interface EmbeddedDocConfig

Configuration for the Doc instance embedded inside a Sheet cell.

propertyfontFamily
readonly fontFamily: string

Default font family and fallback list used by the active embedded document editor.

propertyfontSize
readonly fontSize: number

Default font size used by the active embedded document editor.

propertypadding
readonly padding: number

Padding between the cell edge and embedded document text.

interfaceSearCoreEditorAdapterOptionssource ↗
interface SearCoreEditorAdapterOptions

Configuration for the Sheet-specific SearCore document adapter.

propertyembeddedDocConfig
readonly embeddedDocConfig?: Partial<EmbeddedDocConfig>

Configuration scoped to the Doc embedded inside a Sheet cell.

propertyplugins
readonly plugins?: readonly SheetEmbeddedEditorPlugin | SheetEmbeddedEditorPluginImplementation[]

Optional Sheet-only plugins. Defaults to the built-in adapter plugins.

interfaceSheetEmbeddedEditorPluginsource ↗
interface SheetEmbeddedEditorPlugin

Extension point for behavior that belongs to the Sheet embedding rather than
the reusable Doc runtime. Plugins are deliberately expressed in contract
types so they can be replaced without changing Sheet or Doc packages.

propertykey
readonly key: string

Stable identity used to reject duplicate registrations.

methoddispose
dispose(): void

Called before the adapter releases this plugin.

methodinitialize
initialize(context: SheetEmbeddedEditorPluginContext): void

Called once when the adapter is initialized.

context: SheetEmbeddedEditorPluginContext
methodonCancel
onCancel(context: SheetEmbeddedEditorPluginContext): void

Called after an edit is cancelled.

context: SheetEmbeddedEditorPluginContext
methodonCommit
onCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void

Called after Sheet has committed the edited document.

document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodonRender
onRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): void

Called after a render pass has completed.

update: SheetRenderUpdate
context: SheetEmbeddedEditorPluginContext
methodtransformCommit
transformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void | SheetDocument | null

Allows a Sheet plugin to normalize the snapshot at the commit boundary.

document: SheetDocument
context: SheetEmbeddedEditorPluginContext
methodtransformInlineStyle
transformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): void | SheetInlineStyleUpdate | null

Allows a plugin to normalize an inline style update before Doc input runs.

update: SheetInlineStyleUpdate
context: SheetEmbeddedEditorPluginContext
methodtransformInput
transformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): void | SheetEditInput | null

Allows a plugin to normalize or consume Sheet keyboard/text input.

input: SheetEditInput
context: SheetEmbeddedEditorPluginContext
interfaceSheetEmbeddedEditorPluginContextsource ↗
interface SheetEmbeddedEditorPluginContext

Context delivered to Sheet-specific embedded-editor plugins.

propertydocument
readonly document: SheetDocument
propertyeditor
readonly editor: SheetEmbeddedEditorContext
interfaceSheetEmbeddedEditorPluginImplementationsource ↗
interface SheetEmbeddedEditorPluginImplementation

Constructor form accepted by adapter configuration for stateless plugins.

constructorconstructor
SheetEmbeddedEditorPluginImplementation(): SheetEmbeddedEditorPlugin
interfaceSheetEmbeddedInlineStyleObservationControllersource ↗
interface SheetEmbeddedInlineStyleObservationController
propertysource
readonly source: StateObservationSource<Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>>
methodnotify
notify(): void
variabledefaultEmbeddedDocConfigsource ↗
defaultEmbeddedDocConfig: EmbeddedDocConfig

Built-in defaults for a Doc instance embedded inside a Sheet cell.

functioncreateSheetEmbeddedSearCoreEditorsource ↗
createSheetEmbeddedSearCoreEditor(options?: SearCoreEditorAdapterOptions): SearCoreEditorAdapter

Creates the lightweight SearCore editor used by Sheet embedded cells.

options: SearCoreEditorAdapterOptions
functionregisterSheetEmbeddedInlineStyleObservationsource ↗
registerSheetEmbeddedInlineStyleObservation(observations: ObservationRegistry, input: DocInputPlugin, inlineStyles: RichTextInlineStyleRegistry, isEditing: (): boolean, readTypingStyle?: (): Readonly<Record<string, unknown>>): SheetEmbeddedInlineStyleObservationController

Registers the selection-derived inline-style state with an embedded editor.

observations: ObservationRegistry
input: DocInputPlugin
inlineStyles: RichTextInlineStyleRegistry
isEditing: (): boolean
readTypingStyle: (): Readonly<Record<string, unknown>>

Package

@searsuite/sear-plugin-sort

10 exports

Sheet range sorting commands and stable sparse row permutation helpers.

enumSheetSortDirectionsource ↗
enum SheetSortDirection
enum memberAscending
Ascending: "ascending"
enum memberDescending
Descending: "descending"
classSheetSortErrorsource ↗
class SheetSortError extends SearError

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.

constructorconstructor
SheetSortError(message: string, details: Record<string, unknown>): SheetSortError
message: string
details: Record<string, unknown>
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SHEET_SORT_INVALID_INPUT"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetSortPluginsource ↗
class SheetSortPlugin extends Plugin<unknown, CellProperties, Record<string, never>>

Stateless command owner for stable range sorting.

constructorconstructor
SheetSortPlugin(dependencies: SheetSortDependencies): SheetSortPlugin
dependencies: SheetSortDependencies
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<Record<string, never>, object> | readonly PluginDocumentStateContribution<Record<string, never>, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

Applies a transaction to plugin-owned state and returns the next state.

state: Record<string, never>
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodgetStateinherited
getState(): Record<string, never>

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
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.

state: PluginStateType
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: Record<string, never> }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): []

Produces scene nodes owned by this plugin for the current core state.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
interfaceSheetSortDependenciessource ↗
interface SheetSortDependencies
propertycompareText
readonly compareText: (left: string, right: string): number
propertyplatform
readonly platform: Pick<Platform, "toLowerCase">
propertyreadMatrix
readonly readMatrix: (): CSRMatrix<CellMatrixElement>
propertyreadValue
readonly readValue: (row: number, column: number): SheetSortValue
propertyreorders
readonly reorders: SheetRangeReorderRegistry
interfaceSheetSortKeysource ↗
interface SheetSortKey
propertycolumn
readonly column: number
propertydirection
readonly direction: SheetSortDirection
interfaceSheetSortPermutationsource ↗
interface SheetSortPermutation
propertychanged
readonly changed: boolean
propertydestinationOf
readonly destinationOf: (row: number): number
propertyrange
readonly range: SheetMoveRange
interfaceSheetSortRangeInputsource ↗
interface SheetSortRangeInput
propertyfirstRowIsHeader
readonly firstRowIsHeader?: boolean
propertykeys
readonly keys: readonly SheetSortKey[]
propertyrange
readonly range: SheetMoveRange
typeSheetSortValuesource ↗
type SheetSortValue = number | string | boolean | null
variableSortSheetRangeCommandsource ↗
SortSheetRangeCommand: SheetCommandDefinition<SheetSortRangeInput, SheetCommandResult>
functioncreateSheetSortPermutationsource ↗
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.

input: SheetSortRangeInput
matrix: CSRMatrix<CellMatrixElement>
readValue: (row: number, column: number): SheetSortValue
platform: Pick<Platform, "toLowerCase">
compareText: (left: string, right: string): number

Package

@searsuite/sear-plugin-web-doc-toolbar

1 exports

Web toolbar controls for standalone rich-document commands and observations.

classSearWebDocToolbarsource ↗
class SearWebDocToolbar extends SearToolbar

Browser toolbar adapter for standalone Doc editors.

constructorconstructor
SearWebDocToolbar(editor: Pick<DocEditor, "commands" | "observations">): SearWebDocToolbar
editor: Pick<DocEditor, "commands" | "observations">
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SearToolbar.

methoddestroy
destroy(): void

Releases resources owned by SearToolbar.

methodmount
mount(target: unknown): void

Attaches this adapter to its host surface.

target: unknown

Package

@searsuite/sear-plugin-web-sheet-tabbar

13 exports

Web workbook Sheet tabs and Sheet-structure commands.

classSearWebBottomBarsource ↗
class SearWebBottomBar extends SheetBottomBarAdapter<HTMLElement, SearWebBottomBarMountOptions>

Browser DOM implementation of the bottom sheet tab/status bar.

constructorconstructor
SearWebBottomBar(platform: Platform): SearWebBottomBar

Constructs a bottom bar adapter bound to one platform.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the browser bottom bar adapter.

methoddestroy
destroy(): void
methodmount
mount(target: HTMLElement, options?: SearWebBottomBarMountOptions): void
target: HTMLElement
options: SearWebBottomBarMountOptions
classSheetBottomBarAdaptersource ↗
class SheetBottomBarAdapter<TTarget, TOptions>

Platform-neutral lifecycle contract for a complete bottom-bar renderer.

constructorconstructor
SheetBottomBarAdapter<TTarget, TOptions>(): SheetBottomBarAdapter<TTarget, TOptions>
propertysymbolstatic
readonly symbol: symbol
methoddestroy
destroy(): void
methodmount
mount(target: TTarget, options?: TOptions): void
target: TTarget
options: TOptions
classSheetStatusBarAdaptersource ↗
class SheetStatusBarAdapter<TTarget>

Platform-neutral lifecycle contract for a sheet status-bar renderer.

constructorconstructor
SheetStatusBarAdapter<TTarget>(): SheetStatusBarAdapter<TTarget>
propertysymbolstatic
readonly symbol: symbol
methoddestroy
destroy(): void
methodmount
mount(target: TTarget, model: SheetStatusBarModel): void
target: TTarget
model: SheetStatusBarModel
methodupdate
update(model: SheetStatusBarModel): void
model: SheetStatusBarModel
classSheetTabBarAdaptersource ↗
class SheetTabBarAdapter<TTarget>

Platform-neutral lifecycle contract for a sheet tab-bar renderer.

constructorconstructor
SheetTabBarAdapter<TTarget>(): SheetTabBarAdapter<TTarget>
propertysymbolstatic
readonly symbol: symbol
methoddestroy
destroy(): void
methodmount
mount(target: TTarget, model: SheetTabBarModel): void
target: TTarget
model: SheetTabBarModel
methodupdate
update(model: SheetTabBarModel): void
model: SheetTabBarModel
classWebSheetStatusBarsource ↗
class WebSheetStatusBar extends SheetStatusBarAdapter<HTMLElement>

Browser DOM adapter for the status and zoom segment of the bottom bar.

constructorconstructor
WebSheetStatusBar(): WebSheetStatusBar
propertysymbolstaticinherited
readonly symbol: symbol
methoddestroy
destroy(): void
methodmount
mount(target: HTMLElement, model: SheetStatusBarModel): void
target: HTMLElement
model: SheetStatusBarModel
methodupdate
update(model: SheetStatusBarModel): void
model: SheetStatusBarModel
classWebSheetTabBarsource ↗
class WebSheetTabBar extends SheetTabBarAdapter<HTMLElement>

Browser DOM adapter for the sheet tabs segment of the bottom bar.

constructorconstructor
WebSheetTabBar(): WebSheetTabBar
propertysymbolstaticinherited
readonly symbol: symbol
methoddestroy
destroy(): void
methodmount
mount(target: HTMLElement, model: SheetTabBarModel): void
target: HTMLElement
model: SheetTabBarModel
methodupdate
update(model: SheetTabBarModel): void
model: SheetTabBarModel
interfaceSearWebBottomBarCreateSheetStateInputsource ↗
interface SearWebBottomBarCreateSheetStateInput

Input passed when the bottom bar needs a new sheet payload.

propertyindex
readonly index: number

Destination index in WorkbookDocumentState.sheets.

propertyname
readonly name: string

User-facing sheet name generated for the workbook command.

propertysheetId
readonly sheetId: string

Stable sheet id generated for the workbook command.

interfaceSearWebBottomBarMountOptionssource ↗
interface SearWebBottomBarMountOptions

Mount options for the browser bottom bar.

propertystatusBar
readonly statusBar?: SheetStatusBarAdapter<HTMLElement>

Optional status adapter. Hosts may provide a custom implementation.

propertystatusText
readonly statusText?: string

Status text shown at the right edge.

propertytabBar
readonly tabBar?: SheetTabBarAdapter<HTMLElement>

Optional tabs adapter. Hosts may provide a custom implementation.

propertyworkbook
readonly workbook?: SearWebBottomBarWorkbookBinding

Optional workbook binding. Without it, the bottom bar renders the static replica.

propertyzoomText
readonly zoomText?: string

Zoom label shown in the bottom bar.

interfaceSearWebBottomBarWorkbookBindingsource ↗
interface SearWebBottomBarWorkbookBinding

Workbook binding used by SearWebBottomBar.

propertycreateSheetState
readonly createSheetState?: (input: SearWebBottomBarCreateSheetStateInput): SheetDocumentState

Creates the initial SheetDocumentState for a newly added sheet.

propertyeditor
readonly editor: WorkbookEditor

Workbook editor whose command bus owns sheet-list actions.

interfaceSheetStatusBarModelsource ↗
interface SheetStatusBarModel

Platform-neutral view model for status and zoom controls.

propertyonViewOptionsClick
readonly onViewOptionsClick: (): void
propertyonZoomInClick
readonly onZoomInClick: (): void
propertyonZoomOutClick
readonly onZoomOutClick: (): void
propertystatusText
readonly statusText: string
propertyzoomText
readonly zoomText: string
interfaceSheetTabBarItemsource ↗
interface SheetTabBarItem

Stable sheet item data shared by all tab-bar renderers.

propertyactive
readonly active: boolean
propertycolor
readonly color?: string
propertyid
readonly id: string
propertyname
readonly name: string
interfaceSheetTabBarModelsource ↗
interface SheetTabBarModel

Platform-neutral view model for the sheet tabs segment.

propertyonActivateSheetClick
readonly onActivateSheetClick: (sheetId: string): void
propertyonAddSheetClick
readonly onAddSheetClick: (): void
propertyonSheetsButtonClick
readonly onSheetsButtonClick: (): void
propertysheets
readonly sheets: readonly SheetTabBarItem[]
variableSHEET_BOTTOM_BAR_CSSsource ↗
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__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__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__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"

CSS injected by SearWebBottomBar for the browser sheet bottom bar.

Package

@searsuite/sear-plugin-web-toolbar

9 exports

Web Sheet toolbar controls built on typed commands and observations.

classSearWebToolbarsource ↗
class SearWebToolbar extends SearToolbar

Browser DOM toolbar implementation for the sheet editor.

constructorconstructor
SearWebToolbar(searCore: SearCoreSheet, platform: Platform, embeddedEditor: SheetEmbeddedEditor, clipboard: SheetClipboard, userInteraction: UserInteractionService, commands?: SheetCommandBus, history?: SheetHistoryStatusProvider, queries?: SheetQueryRegistry, observations?: ObservationRegistry, fileDownload?: FileDownload): SearWebToolbar

Constructs the toolbar adapter for one sheet editor.

searCore: SearCoreSheet
platform: Platform
embeddedEditor: SheetEmbeddedEditor
clipboard: SheetClipboard
userInteraction: UserInteractionService
commands: SheetCommandBus
history: SheetHistoryStatusProvider
queries: SheetQueryRegistry
observations: ObservationRegistry
fileDownload: FileDownload
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the web toolbar adapter.

methoddestroy
destroy(): void

Removes DOM nodes and subscriptions owned by the toolbar.

methodmount
mount(target: unknown): void

Mounts the toolbar into a host DOM element.

target: unknown
classWebFormulaBarsource ↗
class WebFormulaBar extends SearFormulaBar

Web formula input surface backed by the Sheet editor's own edit session.

constructorconstructor
WebFormulaBar(platform: Platform, commands: SheetCommandBus, queries: SheetQueryRegistry, observations: ObservationRegistry, core: SearCoreSheet): WebFormulaBar
platform: Platform
commands: SheetCommandBus
queries: SheetQueryRegistry
observations: ObservationRegistry
core: SearCoreSheet
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void
methodmount
mount(target: unknown): void
target: unknown
classWebSheetClipboardsource ↗
class WebSheetClipboard extends SheetClipboard

Browser Clipboard API adapter; DOM events never cross this boundary.

constructorconstructor
WebSheetClipboard(): WebSheetClipboard
propertysymbolstaticinherited
readonly symbol: typeof symbol
methodread
read(): Promise<SheetClipboardPayload | null>
methodwrite
write(payload: SheetClipboardPayload): Promise<void>
payload: SheetClipboardPayload
variableTOOLBAR_CSSsource ↗
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; padding: 12px; background: #fff; color: #222; border: 1px solid #dcdde5; border-radius: 8px; box-shadow: 0 8px 24px #0002; font: 14px sans-serif; max-width: calc(100vw - 16px); }\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: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-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-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-number-format-dialog::backdrop {\n background: rgba(24, 31, 42, 0.36);\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 > 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\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-details input:not([type=\"checkbox\"]) {\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-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 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: 10020; 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-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-fields { display: grid; gap: 12px; }\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-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; width: 212px; 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.

variableWebSheetAdapterDefaultssource ↗
WebSheetAdapterDefaults: { clipboard: typeof WebSheetClipboard; createTextShaper: (context: RenderContext): WebTextShaper; fileDownload: typeof WebFileDownload; userInteraction: typeof WebUserInteractionService }

Web implementations supplied by a Sheet host at its composition root.

functionensureSheetToolbarCommandssource ↗
ensureSheetToolbarCommands(commands: SheetCommandBus, core: SearCoreSheet): void

Ensures web toolbar hosts receive the official sheet command surface.

commands: SheetCommandBus
core: SearCoreSheet
functionregisterSheetToolbarCommandssource ↗
registerSheetToolbarCommands(commands: SheetCommandBus, core: SearCoreSheet): void

Registers official sheet commands needed by web toolbar hosts.

commands: SheetCommandBus
core: SearCoreSheet
classHeadlessToolbarsource ↗
class HeadlessToolbar extends SearToolbar

Toolbar implementation for hosts without a UI surface.

constructorconstructor
HeadlessToolbar(): HeadlessToolbar
propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessToolbar.

methoddestroy
destroy(): void

Releases resources owned by SearToolbar.

methodmount
mount(_target: unknown): void

Attaches this adapter to its host surface.

_target: unknown
classSearToolbarsource ↗
class SearToolbar

Platform-neutral toolbar lifecycle contract.

constructorconstructor
SearToolbar(): SearToolbar
propertysymbolstatic
readonly symbol: symbol

DI token for resolving SearToolbar.

methoddestroy
destroy(): void

Releases resources owned by SearToolbar.

methodmount
mount(target: unknown): void

Attaches this adapter to its host surface.

target: unknown

Package

@searsuite/sear-plugin-zoom

3 exports

Editor-local zoom state, commands, observations, and render integration.

classSheetZoomPluginsource ↗
class SheetZoomPlugin extends Plugin<SearCoreSheet, CellProperties, Record<string, never>>

Local-only Excel-style sheet view zoom. It never changes document data or OT state.

constructorconstructor
SheetZoomPlugin(keyboardRouter: KeyboardRouter, commands?: SheetCommandBus, platform?: Platform): SheetZoomPlugin

Creates a SheetZoomPlugin instance.

keyboardRouter: KeyboardRouter
commands: SheetCommandBus
platform: Platform
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<Record<string, never>, object> | readonly PluginDocumentStateContribution<Record<string, never>, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for SheetZoomPlugin.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving SheetZoomPlugin.

memberkeyinherited
key: unknown
methodapply
apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

Applies a transaction to SheetZoomPlugin state.

state: Record<string, never>
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): unknown

Returns the plugin config.

methodgetScale
getScale(): number

Returns the scale.

methodgetStateinherited
getState(): Record<string, never>

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
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.

state: PluginStateType
transaction: Transaction
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the commands.

commands: SheetCommandBus
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ maxScale: number; minScale: number; step: number }>; key: PluginKey }[]

Registers default configuration values owned by this plugin.

methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers local view scale after Core initialization makes zoom effects available.

registry: SessionStateRegistry
methodregisterState
registerState(): { key: PluginKey; state: Record<string, never> }

Registers the state.

methodrender
render(core: SearCoreSheet): Node<CellProperties>[]

Renders SheetZoomPlugin scene output.

core: SearCoreSheet
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetScale
setScale(nextScale: number): void

Updates the scale.

nextScale: number
methodsetStateinherited
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
variableSetSheetZoomCommandsource ↗
SetSheetZoomCommand: SheetCommandDefinition<number, SheetCommandResult>

Command that updates local sheet view zoom; input is the next zoom scale.

variableSheetZoomSessionStateDefinitionsource ↗
SheetZoomSessionStateDefinition: SessionStateDefinition<number>

Stable session-state identity owned by SheetZoomPlugin.

Package

@searsuite/sear-render-context

20 exports

Platform-neutral drawing contracts with Web Canvas, SVG, WebGL, and headless adapters.

classCoordinateTransformersource ↗
class CoordinateTransformer

Single authority for host-view, world, and raster coordinate conversion.

constructorconstructor
CoordinateTransformer(scrollManager: ScrollManager, renderContext: RenderContext, hitRenderContext: RenderContext): CoordinateTransformer

Creates a CoordinateTransformer instance.

scrollManager: ScrollManager
renderContext: RenderContext
hitRenderContext: RenderContext
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the host-neutral coordinate transformer.

methodgetVisibleWorldRect
getVisibleWorldRect(): PositionRect<unknown>

Returns the visible world rect.

methodviewToRaster
viewToRaster(point: CoordinatePoint): CoordinatePoint

Converts a host-view point into raster coordinates for pixel reads.

point: CoordinatePoint
methodviewToWorld
viewToWorld(point: CoordinatePoint, scroll?: Pick<ScrollManagerState, "x" | "y">): CoordinatePoint

Converts a host-view point into world coordinates.

point: CoordinatePoint
scroll: Pick<ScrollManagerState, "x" | "y">
methodworldToView
worldToView(point: CoordinatePoint, scroll?: Pick<ScrollManagerState, "x" | "y">): CoordinatePoint

Converts a world point into host-view coordinates.

point: CoordinatePoint
scroll: Pick<ScrollManagerState, "x" | "y">
classHeadlessHitRenderContextsource ↗
class HeadlessHitRenderContext extends HeadlessRenderContext

Hit-test layer marker for a headless render pipeline.

constructorconstructor
HeadlessHitRenderContext(): HeadlessHitRenderContext
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessHitRenderContext.

methodaddClickEventListenerinherited
addClickEventListener(_callback: (event: EventWithOffset): void): void

Attaches a click listener.

_callback: (event: EventWithOffset): void
methodaddEventListenerinherited
addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

_type: string
_callback: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited
addMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

_callback: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited
addMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

_callback: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited
addMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

_callback: (event: EventWithOffset): void
methodaddResizeListenerinherited
addResizeListener(_callback: (): void): void

Attaches a resize listener for host target size changes.

_callback: (): void
methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPathinherited
beginPath(): void

Begins a new path.

methodclearRectinherited
clearRect(_x: number, _y: number, _width: number, _height: number): void

Clears a rectangle from the target.

_x: number
_y: number
_width: number
_height: number
methodclipinherited
clip(): void

Clips future drawing to the active path.

methodcloneNodeinherited
cloneNode(): RenderContext

Creates a same-kind render context for an auxiliary render layer.

methodclosePathinherited
closePath(): void

Closes the active path.

methodcreateHitNodeinherited
createHitNode(): RenderContext

Creates a same-kind render context configured for hit testing.

methoddrawImageinherited
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.

_image: unknown
_x: number
_y: number
_width: number
_height: number
_sx: number
_sy: number
_sWidth: number
_sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfillinherited
fill(): void

Fills the active path with the current fill style.

methodfillTextinherited
fillText(_text: string, _x: number, _y: number, _maxWidth?: number): void

Draws text at the given position.

_text: string
_x: number
_y: number
_maxWidth: number
methodgetAttributeinherited
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageDatainherited
getImageData(_x: number, _y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

_x: number
_y: number
width: number
height: number
methodgetLineWidthinherited
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidthinherited
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScaleinherited
getRasterScale(): number

Raster units represented by one host-view unit for this context.

methodgetRenderTargetinherited
getRenderTarget(): unknown

Returns the native backing target owned by this render context.

methodgetRootinherited
getRoot(): unknown

Returns the event root associated with this render context.

methodgetViewScaleinherited
getViewScale(): number

Returns the current logical view scale.

methodinitializeinherited
initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

scale: number
methodlineToinherited
lineTo(_x: number, _y: number): void

Adds a line from the current path cursor.

_x: number
_y: number
methodmeasureTextinherited
measureText(text: string): { height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveToinherited
moveTo(_x: number, _y: number): void

Moves the active path cursor.

_x: number
_y: number
methodputImageDatainherited
putImageData(_imageData: RenderImageData, _x: number, _y: number): void

Writes raster pixels to the target.

_imageData: RenderImageData
_x: number
_y: number
methodrectinherited
rect(_x: number, _y: number, _width: number, _height: number): void

Adds a rectangle to the active path.

_x: number
_y: number
_width: number
_height: number
methodremoveClickEventListenerinherited
removeClickEventListener(_callback: (event: EventWithOffset): void): void

Removes a click listener.

_callback: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited
removeMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-press listener.

_callback: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited
removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-move listener.

_callback: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited
removeMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-release listener.

_callback: (event: EventWithOffset): void
methodremoveResizeListenerinherited
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransforminherited
resetTransform(): void

Resets the current transform to the identity transform.

methodresizeinherited
resize(_width: number, _height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

_width: number
_height: number
scale: number
methodrestoreinherited
restore(): void

Restores the most recently saved drawing state.

methodsaveinherited
save(): void

Saves the current drawing state.

methodsetAttributeinherited
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyleinherited
setFillStyle(_fillStyle: RenderPaint): void

Sets the current fill style.

_fillStyle: RenderPaint
methodsetFontinherited
setFont(_font: string): void

Sets the active platform-neutral font descriptor.

_font: string
methodsetLineDashinherited
setLineDash(_segments: number[]): void

Sets the current line dash pattern.

_segments: number[]
methodsetLineWidthinherited
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyleinherited
setStrokeStyle(_strokeStyle: RenderPaint): void

Sets the current stroke style.

_strokeStyle: RenderPaint
methodsetTransforminherited
setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): void

Replaces the current transform matrix.

_a: number
_b: number
_c: number
_d: number
_e: number
_f: number
methodsetViewScaleinherited
setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

scale: number
methodstrokeinherited
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRectinherited
strokeRect(_x: number, _y: number, _width: number, _height: number): void

Strokes a rectangle without requiring a separate path.

_x: number
_y: number
_width: number
_height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslateinherited
translate(_x: number, _y: number): void

Translates the current drawing transform.

_x: number
_y: number
classHeadlessOffScreenRenderContextsource ↗
class HeadlessOffScreenRenderContext extends HeadlessRenderContext

Off-screen layer marker for a headless render pipeline.

constructorconstructor
HeadlessOffScreenRenderContext(): HeadlessOffScreenRenderContext
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessOffScreenRenderContext.

methodaddClickEventListenerinherited
addClickEventListener(_callback: (event: EventWithOffset): void): void

Attaches a click listener.

_callback: (event: EventWithOffset): void
methodaddEventListenerinherited
addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

_type: string
_callback: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited
addMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

_callback: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited
addMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

_callback: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited
addMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

_callback: (event: EventWithOffset): void
methodaddResizeListenerinherited
addResizeListener(_callback: (): void): void

Attaches a resize listener for host target size changes.

_callback: (): void
methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPathinherited
beginPath(): void

Begins a new path.

methodclearRectinherited
clearRect(_x: number, _y: number, _width: number, _height: number): void

Clears a rectangle from the target.

_x: number
_y: number
_width: number
_height: number
methodclipinherited
clip(): void

Clips future drawing to the active path.

methodcloneNodeinherited
cloneNode(): RenderContext

Creates a same-kind render context for an auxiliary render layer.

methodclosePathinherited
closePath(): void

Closes the active path.

methodcreateHitNodeinherited
createHitNode(): RenderContext

Creates a same-kind render context configured for hit testing.

methoddrawImageinherited
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.

_image: unknown
_x: number
_y: number
_width: number
_height: number
_sx: number
_sy: number
_sWidth: number
_sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfillinherited
fill(): void

Fills the active path with the current fill style.

methodfillTextinherited
fillText(_text: string, _x: number, _y: number, _maxWidth?: number): void

Draws text at the given position.

_text: string
_x: number
_y: number
_maxWidth: number
methodgetAttributeinherited
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageDatainherited
getImageData(_x: number, _y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

_x: number
_y: number
width: number
height: number
methodgetLineWidthinherited
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidthinherited
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScaleinherited
getRasterScale(): number

Raster units represented by one host-view unit for this context.

methodgetRenderTargetinherited
getRenderTarget(): unknown

Returns the native backing target owned by this render context.

methodgetRootinherited
getRoot(): unknown

Returns the event root associated with this render context.

methodgetViewScaleinherited
getViewScale(): number

Returns the current logical view scale.

methodinitializeinherited
initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

scale: number
methodlineToinherited
lineTo(_x: number, _y: number): void

Adds a line from the current path cursor.

_x: number
_y: number
methodmeasureTextinherited
measureText(text: string): { height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveToinherited
moveTo(_x: number, _y: number): void

Moves the active path cursor.

_x: number
_y: number
methodputImageDatainherited
putImageData(_imageData: RenderImageData, _x: number, _y: number): void

Writes raster pixels to the target.

_imageData: RenderImageData
_x: number
_y: number
methodrectinherited
rect(_x: number, _y: number, _width: number, _height: number): void

Adds a rectangle to the active path.

_x: number
_y: number
_width: number
_height: number
methodremoveClickEventListenerinherited
removeClickEventListener(_callback: (event: EventWithOffset): void): void

Removes a click listener.

_callback: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited
removeMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-press listener.

_callback: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited
removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-move listener.

_callback: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited
removeMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-release listener.

_callback: (event: EventWithOffset): void
methodremoveResizeListenerinherited
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransforminherited
resetTransform(): void

Resets the current transform to the identity transform.

methodresizeinherited
resize(_width: number, _height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

_width: number
_height: number
scale: number
methodrestoreinherited
restore(): void

Restores the most recently saved drawing state.

methodsaveinherited
save(): void

Saves the current drawing state.

methodsetAttributeinherited
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyleinherited
setFillStyle(_fillStyle: RenderPaint): void

Sets the current fill style.

_fillStyle: RenderPaint
methodsetFontinherited
setFont(_font: string): void

Sets the active platform-neutral font descriptor.

_font: string
methodsetLineDashinherited
setLineDash(_segments: number[]): void

Sets the current line dash pattern.

_segments: number[]
methodsetLineWidthinherited
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyleinherited
setStrokeStyle(_strokeStyle: RenderPaint): void

Sets the current stroke style.

_strokeStyle: RenderPaint
methodsetTransforminherited
setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): void

Replaces the current transform matrix.

_a: number
_b: number
_c: number
_d: number
_e: number
_f: number
methodsetViewScaleinherited
setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

scale: number
methodstrokeinherited
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRectinherited
strokeRect(_x: number, _y: number, _width: number, _height: number): void

Strokes a rectangle without requiring a separate path.

_x: number
_y: number
_width: number
_height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslateinherited
translate(_x: number, _y: number): void

Translates the current drawing transform.

_x: number
_y: number
classHeadlessRenderContextsource ↗
class HeadlessRenderContext extends RenderContext

Render context that preserves engine state while producing no raster output.

constructorconstructor
HeadlessRenderContext(): HeadlessRenderContext
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the headless render context.

methodaddClickEventListener
addClickEventListener(_callback: (event: EventWithOffset): void): void

Attaches a click listener.

_callback: (event: EventWithOffset): void
methodaddEventListener
addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

_type: string
_callback: (event: EventWithOffset): void
methodaddMouseDownEventListener
addMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

_callback: (event: EventWithOffset): void
methodaddMouseMoveEventListener
addMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

_callback: (event: EventWithOffset): void
methodaddMouseUpEventListener
addMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

_callback: (event: EventWithOffset): void
methodaddResizeListener
addResizeListener(_callback: (): void): void

Attaches a resize listener for host target size changes.

_callback: (): void
methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPath
beginPath(): void

Begins a new path.

methodclearRect
clearRect(_x: number, _y: number, _width: number, _height: number): void

Clears a rectangle from the target.

_x: number
_y: number
_width: number
_height: number
methodclip
clip(): void

Clips future drawing to the active path.

methodcloneNode
cloneNode(): RenderContext

Creates a same-kind render context for an auxiliary render layer.

methodclosePath
closePath(): void

Closes the active path.

methodcreateHitNode
createHitNode(): RenderContext

Creates a same-kind render context configured for hit testing.

methoddrawImage
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.

_image: unknown
_x: number
_y: number
_width: number
_height: number
_sx: number
_sy: number
_sWidth: number
_sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfill
fill(): void

Fills the active path with the current fill style.

methodfillText
fillText(_text: string, _x: number, _y: number, _maxWidth?: number): void

Draws text at the given position.

_text: string
_x: number
_y: number
_maxWidth: number
methodgetAttribute
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageData
getImageData(_x: number, _y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

_x: number
_y: number
width: number
height: number
methodgetLineWidth
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidth
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScale
getRasterScale(): number

Raster units represented by one host-view unit for this context.

methodgetRenderTarget
getRenderTarget(): unknown

Returns the native backing target owned by this render context.

methodgetRoot
getRoot(): unknown

Returns the event root associated with this render context.

methodgetViewScale
getViewScale(): number

Returns the current logical view scale.

methodinitialize
initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

scale: number
methodlineTo
lineTo(_x: number, _y: number): void

Adds a line from the current path cursor.

_x: number
_y: number
methodmeasureText
measureText(text: string): { height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveTo
moveTo(_x: number, _y: number): void

Moves the active path cursor.

_x: number
_y: number
methodputImageData
putImageData(_imageData: RenderImageData, _x: number, _y: number): void

Writes raster pixels to the target.

_imageData: RenderImageData
_x: number
_y: number
methodrect
rect(_x: number, _y: number, _width: number, _height: number): void

Adds a rectangle to the active path.

_x: number
_y: number
_width: number
_height: number
methodremoveClickEventListener
removeClickEventListener(_callback: (event: EventWithOffset): void): void

Removes a click listener.

_callback: (event: EventWithOffset): void
methodremoveMouseDownEventListener
removeMouseDownEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-press listener.

_callback: (event: EventWithOffset): void
methodremoveMouseMoveEventListener
removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-move listener.

_callback: (event: EventWithOffset): void
methodremoveMouseUpEventListener
removeMouseUpEventListener(_callback: (event: EventWithOffset): void): void

Removes a pointer-release listener.

_callback: (event: EventWithOffset): void
methodremoveResizeListener
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransform
resetTransform(): void

Resets the current transform to the identity transform.

methodresize
resize(_width: number, _height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

_width: number
_height: number
scale: number
methodrestore
restore(): void

Restores the most recently saved drawing state.

methodsave
save(): void

Saves the current drawing state.

methodsetAttribute
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyle
setFillStyle(_fillStyle: RenderPaint): void

Sets the current fill style.

_fillStyle: RenderPaint
methodsetFont
setFont(_font: string): void

Sets the active platform-neutral font descriptor.

_font: string
methodsetLineDash
setLineDash(_segments: number[]): void

Sets the current line dash pattern.

_segments: number[]
methodsetLineWidth
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyle
setStrokeStyle(_strokeStyle: RenderPaint): void

Sets the current stroke style.

_strokeStyle: RenderPaint
methodsetTransform
setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): void

Replaces the current transform matrix.

_a: number
_b: number
_c: number
_d: number
_e: number
_f: number
methodsetViewScale
setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

scale: number
methodstroke
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRect
strokeRect(_x: number, _y: number, _width: number, _height: number): void

Strokes a rectangle without requiring a separate path.

_x: number
_y: number
_width: number
_height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslate
translate(_x: number, _y: number): void

Translates the current drawing transform.

_x: number
_y: number
classRenderContextsource ↗
class RenderContext

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.

constructorconstructor
RenderContext(): RenderContext
propertyisDrawn
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstatic
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstatic
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for the primary visible render layer.

methodaddClickEventListener
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

callBack: (event: EventWithOffset): void
methodaddEventListener
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

type: string
callBack: (event: EventWithOffset): void
methodaddMouseDownEventListener
addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener
addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

callBack: (event: EventWithOffset): void
methodaddResizeListener
addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

callBack: (): void
methodbeginFrame
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemantics
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPath
beginPath(): void

Begins a new path.

methodclearRect
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

x: number
y: number
width: number
height: number
methodclip
clip(): void

Clips future drawing to the active path.

methodcloneNode
cloneNode(): RenderContext

Creates a same-kind render context for an auxiliary render layer.

methodclosePath
closePath(): void

Closes the active path.

methodcreateHitNode
createHitNode(): RenderContext

Creates a same-kind render context configured for hit testing.

methoddrawImage
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.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemantics
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfill
fill(): void

Fills the active path with the current fill style.

methodfillText
fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

text: string
x: number
y: number
maxWidth: number
methodgetAttribute
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageData
getImageData(x: number, y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

x: number
y: number
width: number
height: number
methodgetLineWidth
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidth
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScale
getRasterScale(): number

Raster units represented by one host-view unit for this context.

methodgetRenderTarget
getRenderTarget(): unknown

Returns the native backing target owned by this render context.

methodgetRoot
getRoot(): unknown

Returns the event root associated with this render context.

methodgetViewScale
getViewScale(): number

Returns the current logical view scale.

methodinitialize
initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

scale: number
methodlineTo
lineTo(x: number, y: number): void

Adds a line from the current path cursor.

x: number
y: number
methodmeasureText
measureText(text: string): { fontAscent?: number; fontDescent?: number; fontLineGap?: number; height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveTo
moveTo(x: number, y: number): void

Moves the active path cursor.

x: number
y: number
methodputImageData
putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

imageData: RenderImageData
x: number
y: number
methodrect
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

x: number
y: number
width: number
height: number
methodremoveClickEventListener
removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

callBack: (event: EventWithOffset): void
methodremoveResizeListener
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClear
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuild
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrame
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransform
resetTransform(): void

Resets the current transform to the identity transform.

methodresize
resize(width: number, height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

width: number
height: number
scale: number
methodrestore
restore(): void

Restores the most recently saved drawing state.

methodsave
save(): void

Saves the current drawing state.

methodsetAttribute
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyle
setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

fillStyle: RenderPaint
methodsetFont
setFont(font: string): void

Sets the active platform-neutral font descriptor.

font: string
methodsetLineDash
setLineDash(segments: number[]): void

Sets the current line dash pattern.

segments: number[]
methodsetLineWidth
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyle
setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

strokeStyle: RenderPaint
methodsetTransform
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScale
setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

scale: number
methodstroke
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRect
strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedraw
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslate
translate(x: number, y: number): void

Translates the current drawing transform.

x: number
y: number
classWebCanvasRenderContextsource ↗
class WebCanvasRenderContext extends RenderContext

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.

constructorconstructor
WebCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebCanvasRenderContext

Constructs a Canvas render context from a host canvas.

renderTarget: unknown
HTMLCanvasElement supplied by the host adapter.
readbackOptimized: boolean
platform: Platform
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the visible canvas render context.

methodaddClickEventListener
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

callBack: (event: EventWithOffset): void
methodaddEventListener
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Registers a host pointer event listener on the canvas root.

type: string
callBack: (event: EventWithOffset): void
methodaddMouseDownEventListener
addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener
addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

callBack: (event: EventWithOffset): void
methodaddResizeListener
addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

callBack: (): void
methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPath
beginPath(): void

Begins a new path.

methodclearRect
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

x: number
y: number
width: number
height: number
methodclip
clip(): void

Clips future drawing to the active path.

methodcloneNode
cloneNode(): WebCanvasRenderContext

Clones the backing canvas dimensions into a detached WebCanvasRenderContext.

methodclosePath
closePath(): void

Closes the active path.

methodcreateHitNode
createHitNode(): WebCanvasRenderContext

Creates a detached render context used by hit rendering.

methoddrawImage
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.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfill
fill(): void

Fills the active path with the current fill style.

methodfillText
fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

text: string
x: number
y: number
maxWidth: number
methodgetAttribute
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageData
getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number }

Reads raster pixels from the target.

x: number
y: number
width: number
height: number
methodgetLineWidth
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidth
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScale
getRasterScale(): number

Returns the host-view to raster scale, excluding logical sheet zoom.

methodgetRenderTarget
getRenderTarget(): HTMLCanvasElement

Returns the native backing target owned by this render context.

methodgetRoot
getRoot(): HTMLCanvasElement

Returns the event root associated with this render context.

methodgetViewScale
getViewScale(): number

Returns the logical view scale.

methodinitialize
initialize(scale: number): void

Initializes canvas sizing and marks the canvas with the shared render-context token.

scale: number
Device pixel ratio used for backing-store dimensions.
methodlineTo
lineTo(x: number, y: number): void

Adds a line from the current path cursor.

x: number
y: number
methodmeasureText
measureText(text: string): { fontAscent?: number; fontDescent?: number; height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveTo
moveTo(x: number, y: number): void

Moves the active path cursor.

x: number
y: number
methodputImageData
putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raw pixel data to the backing context.

imageData: RenderImageData
Compact image data shape used by RenderContext.
x: number
Raster x-coordinate.
y: number
Raster y-coordinate.
methodrect
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

x: number
y: number
width: number
height: number
methodremoveClickEventListener
removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

callBack: (event: EventWithOffset): void
methodremoveResizeListener
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransform
resetTransform(): void

Resets the current transform to the identity transform.

methodresize
resize(width: number, height: number, scale?: number): void

Resizes the canvas backing store for a logical host viewport.

width: number
Host-view width.
height: number
Host-view height.
scale: number
Raster scale to apply to the backing store.
methodrestore
restore(): void

Restores the most recently saved drawing state.

methodsave
save(): void

Saves the current drawing state.

methodsetAttribute
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyle
setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

fillStyle: RenderPaint
methodsetFont
setFont(font: string): void

Sets the active platform-neutral font descriptor.

font: string
methodsetLineDash
setLineDash(segments: number[]): void

Sets the current line dash pattern.

segments: number[]
methodsetLineWidth
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyle
setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

strokeStyle: RenderPaint
methodsetTransform
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.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScale
setViewScale(scale: number): void

Updates the logical view scale used by sheet zoom.

scale: number
New view scale.
methodstroke
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRect
strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslate
translate(x: number, y: number): void

Translates the current drawing transform.

x: number
y: number
classWebHitCanvasRenderContextsource ↗
class WebHitCanvasRenderContext extends WebCanvasRenderContext

Canvas render context specialization for the hit-test layer.

constructorconstructor
WebHitCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebHitCanvasRenderContext

Constructs a Canvas render context from a host canvas.

renderTarget: unknown
HTMLCanvasElement supplied by the host adapter.
readbackOptimized: boolean
platform: Platform
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the hit canvas context.

methodaddClickEventListenerinherited
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

callBack: (event: EventWithOffset): void
methodaddEventListenerinherited
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Registers a host pointer event listener on the canvas root.

type: string
callBack: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited
addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

callBack: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited
addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

callBack: (event: EventWithOffset): void
methodaddResizeListenerinherited
addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

callBack: (): void
methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPathinherited
beginPath(): void

Begins a new path.

methodclearRectinherited
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

x: number
y: number
width: number
height: number
methodclipinherited
clip(): void

Clips future drawing to the active path.

methodcloneNodeinherited
cloneNode(): WebCanvasRenderContext

Clones the backing canvas dimensions into a detached WebCanvasRenderContext.

methodclosePathinherited
closePath(): void

Closes the active path.

methodcreateHitNodeinherited
createHitNode(): WebCanvasRenderContext

Creates a detached render context used by hit rendering.

methoddrawImageinherited
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.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfillinherited
fill(): void

Fills the active path with the current fill style.

methodfillTextinherited
fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

text: string
x: number
y: number
maxWidth: number
methodgetAttributeinherited
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageDatainherited
getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number }

Reads raster pixels from the target.

x: number
y: number
width: number
height: number
methodgetLineWidthinherited
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidthinherited
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScaleinherited
getRasterScale(): number

Returns the host-view to raster scale, excluding logical sheet zoom.

methodgetRenderTargetinherited
getRenderTarget(): HTMLCanvasElement

Returns the native backing target owned by this render context.

methodgetRootinherited
getRoot(): HTMLCanvasElement

Returns the event root associated with this render context.

methodgetViewScaleinherited
getViewScale(): number

Returns the logical view scale.

methodinitializeinherited
initialize(scale: number): void

Initializes canvas sizing and marks the canvas with the shared render-context token.

scale: number
Device pixel ratio used for backing-store dimensions.
methodlineToinherited
lineTo(x: number, y: number): void

Adds a line from the current path cursor.

x: number
y: number
methodmeasureTextinherited
measureText(text: string): { fontAscent?: number; fontDescent?: number; height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveToinherited
moveTo(x: number, y: number): void

Moves the active path cursor.

x: number
y: number
methodputImageDatainherited
putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raw pixel data to the backing context.

imageData: RenderImageData
Compact image data shape used by RenderContext.
x: number
Raster x-coordinate.
y: number
Raster y-coordinate.
methodrectinherited
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

x: number
y: number
width: number
height: number
methodremoveClickEventListenerinherited
removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

callBack: (event: EventWithOffset): void
methodremoveResizeListenerinherited
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransforminherited
resetTransform(): void

Resets the current transform to the identity transform.

methodresizeinherited
resize(width: number, height: number, scale?: number): void

Resizes the canvas backing store for a logical host viewport.

width: number
Host-view width.
height: number
Host-view height.
scale: number
Raster scale to apply to the backing store.
methodrestoreinherited
restore(): void

Restores the most recently saved drawing state.

methodsaveinherited
save(): void

Saves the current drawing state.

methodsetAttributeinherited
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyleinherited
setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

fillStyle: RenderPaint
methodsetFontinherited
setFont(font: string): void

Sets the active platform-neutral font descriptor.

font: string
methodsetLineDashinherited
setLineDash(segments: number[]): void

Sets the current line dash pattern.

segments: number[]
methodsetLineWidthinherited
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyleinherited
setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

strokeStyle: RenderPaint
methodsetTransforminherited
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.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScaleinherited
setViewScale(scale: number): void

Updates the logical view scale used by sheet zoom.

scale: number
New view scale.
methodstrokeinherited
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRectinherited
strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslateinherited
translate(x: number, y: number): void

Translates the current drawing transform.

x: number
y: number
classWebOffScreenCanvasRenderContextsource ↗
class WebOffScreenCanvasRenderContext extends WebCanvasRenderContext

Canvas render context specialization for scroll optimization buffers.

constructorconstructor
WebOffScreenCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebOffScreenCanvasRenderContext

Constructs a Canvas render context from a host canvas.

renderTarget: unknown
HTMLCanvasElement supplied by the host adapter.
readbackOptimized: boolean
platform: Platform
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the off-screen canvas context.

methodaddClickEventListenerinherited
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

callBack: (event: EventWithOffset): void
methodaddEventListenerinherited
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Registers a host pointer event listener on the canvas root.

type: string
callBack: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited
addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

callBack: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited
addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

callBack: (event: EventWithOffset): void
methodaddResizeListenerinherited
addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

callBack: (): void
methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPathinherited
beginPath(): void

Begins a new path.

methodclearRectinherited
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

x: number
y: number
width: number
height: number
methodclipinherited
clip(): void

Clips future drawing to the active path.

methodcloneNodeinherited
cloneNode(): WebCanvasRenderContext

Clones the backing canvas dimensions into a detached WebCanvasRenderContext.

methodclosePathinherited
closePath(): void

Closes the active path.

methodcreateHitNodeinherited
createHitNode(): WebCanvasRenderContext

Creates a detached render context used by hit rendering.

methoddrawImageinherited
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.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfillinherited
fill(): void

Fills the active path with the current fill style.

methodfillTextinherited
fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

text: string
x: number
y: number
maxWidth: number
methodgetAttributeinherited
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageDatainherited
getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number }

Reads raster pixels from the target.

x: number
y: number
width: number
height: number
methodgetLineWidthinherited
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidthinherited
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScaleinherited
getRasterScale(): number

Returns the host-view to raster scale, excluding logical sheet zoom.

methodgetRenderTargetinherited
getRenderTarget(): HTMLCanvasElement

Returns the native backing target owned by this render context.

methodgetRootinherited
getRoot(): HTMLCanvasElement

Returns the event root associated with this render context.

methodgetViewScaleinherited
getViewScale(): number

Returns the logical view scale.

methodinitializeinherited
initialize(scale: number): void

Initializes canvas sizing and marks the canvas with the shared render-context token.

scale: number
Device pixel ratio used for backing-store dimensions.
methodlineToinherited
lineTo(x: number, y: number): void

Adds a line from the current path cursor.

x: number
y: number
methodmeasureTextinherited
measureText(text: string): { fontAscent?: number; fontDescent?: number; height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveToinherited
moveTo(x: number, y: number): void

Moves the active path cursor.

x: number
y: number
methodputImageDatainherited
putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raw pixel data to the backing context.

imageData: RenderImageData
Compact image data shape used by RenderContext.
x: number
Raster x-coordinate.
y: number
Raster y-coordinate.
methodrectinherited
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

x: number
y: number
width: number
height: number
methodremoveClickEventListenerinherited
removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

callBack: (event: EventWithOffset): void
methodremoveResizeListenerinherited
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransforminherited
resetTransform(): void

Resets the current transform to the identity transform.

methodresizeinherited
resize(width: number, height: number, scale?: number): void

Resizes the canvas backing store for a logical host viewport.

width: number
Host-view width.
height: number
Host-view height.
scale: number
Raster scale to apply to the backing store.
methodrestoreinherited
restore(): void

Restores the most recently saved drawing state.

methodsaveinherited
save(): void

Saves the current drawing state.

methodsetAttributeinherited
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyleinherited
setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

fillStyle: RenderPaint
methodsetFontinherited
setFont(font: string): void

Sets the active platform-neutral font descriptor.

font: string
methodsetLineDashinherited
setLineDash(segments: number[]): void

Sets the current line dash pattern.

segments: number[]
methodsetLineWidthinherited
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyleinherited
setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

strokeStyle: RenderPaint
methodsetTransforminherited
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.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScaleinherited
setViewScale(scale: number): void

Updates the logical view scale used by sheet zoom.

scale: number
New view scale.
methodstrokeinherited
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRectinherited
strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslateinherited
translate(x: number, y: number): void

Translates the current drawing transform.

x: number
y: number
classWebRenderContextsource ↗
class WebRenderContext extends RenderContext

Experimental Web-backed render context used for element-based rendering experiments.

constructorconstructor
WebRenderContext(container: HTMLDivElement, platform?: Platform): WebRenderContext

Creates a Web render context attached to the provided container.

container: HTMLDivElement
platform: Platform
propertycache
cache: Set<HTMLElement>

Virtual path cache collected before a fill or stroke commits DOM elements.

propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyroot
root: HTMLDivElement

Root DOM element that receives generated render elements.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the Web render context.

methodaddClickEventListener
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

callBack: (event: EventWithOffset): void
methodaddEventListener
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

type: string
callBack: (event: EventWithOffset): void
methodaddMouseDownEventListener
addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener
addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

callBack: (event: EventWithOffset): void
methodaddResizeListener
addResizeListener(): void

Attaches a resize listener for host target size changes.

methodbeginFrameinherited
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPath
beginPath(): void

Clear timing
1、Virtual Path Again
2、beginPath
3、clearRect

methodclearRect
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

x: number
y: number
width: number
height: number
methodclip
clip(): void

Clips future drawing to the active path.

methodcloneNode
cloneNode(): RenderContext

Creates a same-kind render context for an auxiliary render layer.

methodclosePath
closePath(): void

Closes the active path.

methodcreateHitNode
createHitNode(): RenderContext

Creates a same-kind render context configured for hit testing.

methoddrawImage
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.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfill
fill(): void

Fills the active path with the current fill style.

methodfillText
fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

text: string
x: number
y: number
maxWidth: number
methodgetAttribute
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageData
getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number }

Reads raster pixels from the target.

x: number
y: number
width: number
height: number
methodgetLineWidth
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidth
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScale
getRasterScale(): number

Raster units represented by one host-view unit for this context.

methodgetRenderTarget
getRenderTarget(): unknown

Returns the native backing target owned by this render context.

methodgetRoot
getRoot(): HTMLDivElement

Returns the event root associated with this render context.

methodgetViewScale
getViewScale(): number

Returns the current logical view scale.

methodinitialize
initialize(): void

Initializes target sizing and adapter-specific state.

methodlineTo
lineTo(x: number, y: number): void

Adds a line from the current path cursor.

x: number
y: number
methodmeasureText
measureText(text: string): { height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveTo
moveTo(x: number, y: number): void

Moves the active path cursor.

x: number
y: number
methodputImageData
putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

imageData: RenderImageData
x: number
y: number
methodrect
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

x: number
y: number
width: number
height: number
methodremoveClickEventListener
removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

callBack: (event: EventWithOffset): void
methodremoveResizeListener
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClearinherited
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuildinherited
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransform
resetTransform(): void

Resets the current transform to the identity transform.

methodresize
resize(): void

Resizes the backing render target to the host view's logical size and raster scale.

methodrestore
restore(): void

Restores the most recently saved drawing state.

methodsave
save(): void

Saves the current drawing state.

methodsetAttribute
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyle
setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

fillStyle: RenderPaint
methodsetFont
setFont(font: string): void

Sets the active platform-neutral font descriptor.

font: string
methodsetLineDash
setLineDash(segments: number[]): void

Sets the current line dash pattern.

segments: number[]
methodsetLineWidth
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyle
setStrokeStyle(strokeStyle: string): void

Sets the current stroke style.

strokeStyle: string
methodsetTransform
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScale
setViewScale(_scale: number): void

Logical view scale (distinct from device pixel ratio).

_scale: number
methodstroke
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRect
strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedrawinherited
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslate
translate(x: number, y: number): void

Translates the current drawing transform.

x: number
y: number
classWebSvgRenderContextsource ↗
class WebSvgRenderContext extends RenderContext

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.

constructorconstructor
WebSvgRenderContext(root: unknown, platform?: Platform): WebSvgRenderContext

Creates an SVG render context with a detached raster mirror for Canvas-only APIs.

root: unknown
SVG element that receives retained draw output.
platform: Platform
Optional platform diagnostics adapter.
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the SVG render context.

methodaddClickEventListener
addClickEventListener(callBack: (event: EventWithOffset): void): void

Attaches a click listener.

callBack: (event: EventWithOffset): void
methodaddEventListener
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

type: string
callBack: (event: EventWithOffset): void
methodaddMouseDownEventListener
addMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener
addMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

callBack: (event: EventWithOffset): void
methodaddResizeListener
addResizeListener(callBack: (): void): void

Attaches a resize listener for host target size changes.

callBack: (): void
methodbeginFrame
beginFrame(): void

Replaces retained SVG output before a full shared-engine render pass.

methodbeginNodeSemantics
beginNodeSemantics(semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

semantics: RenderNodeSemantics
methodbeginPath
beginPath(): void

Begins a new path.

methodclearRect
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

x: number
y: number
width: number
height: number
methodclip
clip(): void

Clips future drawing to the active path.

methodcloneNode
cloneNode(): WebSvgRenderContext

Creates a same-kind render context for an auxiliary render layer.

methodclosePath
closePath(): void

Closes the active path.

methodcreateHitNode
createHitNode(): WebSvgRenderContext

Creates a same-kind render context configured for hit testing.

methoddrawImage
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.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemantics
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfill
fill(): void

Fills the active path with the current fill style.

methodfillText
fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

text: string
x: number
y: number
maxWidth: number
methodgetAttribute
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageData
getImageData(x: number, y: number, width: number, height: number): { data: [number, number, number, number][]; height: number; width: number }

Reads raster pixels from the target.

x: number
y: number
width: number
height: number
methodgetLineWidth
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidth
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScale
getRasterScale(): number

Raster units represented by one host-view unit for this context.

methodgetRenderTarget
getRenderTarget(): SVGSVGElement

Returns the native backing target owned by this render context.

methodgetRoot
getRoot(): SVGSVGElement

Returns the event root associated with this render context.

methodgetViewScale
getViewScale(): number

Returns the current logical view scale.

methodinitialize
initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

scale: number
methodlineTo
lineTo(x: number, y: number): void

Adds a line from the current path cursor.

x: number
y: number
methodmeasureText
measureText(text: string): { fontAscent?: number; fontDescent?: number; height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveTo
moveTo(x: number, y: number): void

Moves the active path cursor.

x: number
y: number
methodputImageData
putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

imageData: RenderImageData
x: number
y: number
methodrect
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

x: number
y: number
width: number
height: number
methodremoveClickEventListener
removeClickEventListener(callBack: (event: EventWithOffset): void): void

Removes a click listener.

callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-press listener.

callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-move listener.

callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): void

Removes a pointer-release listener.

callBack: (event: EventWithOffset): void
methodremoveResizeListener
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClear
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuild
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrame
resetHitFrame(_width: number, _height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

_width: number
_height: number
methodresetTransform
resetTransform(): void

Resets the current transform to the identity transform.

methodresize
resize(width: number, height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

width: number
height: number
scale: number
methodrestore
restore(): void

Restores the most recently saved drawing state.

methodsave
save(): void

Saves the current drawing state.

methodsetAttribute
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyle
setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

fillStyle: RenderPaint
methodsetFont
setFont(font: string): void

Sets the active platform-neutral font descriptor.

font: string
methodsetLineDash
setLineDash(segments: number[]): void

Sets the current line dash pattern.

segments: number[]
methodsetLineWidth
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyle
setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

strokeStyle: RenderPaint
methodsetTransform
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScale
setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

scale: number
methodstroke
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRect
strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedraw
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslate
translate(x: number, y: number): void

Translates the current drawing transform.

x: number
y: number
classWebWebGLRenderContextsource ↗
class WebWebGLRenderContext extends RenderContext

Native WebGL implementation of the platform-neutral RenderContext.

Geometry, images, and glyph quads are submitted directly to GPU buffers.
Canvas2D is used only to measure text and rasterize glyphs into texture
atlases; it never receives scene or complete-frame drawing.

Example
const context = new WebWebGLRenderContext(canvas, platform);
context.initialize(window.devicePixelRatio);
constructorconstructor
WebWebGLRenderContext(renderTarget: unknown, platform?: Platform): WebWebGLRenderContext
renderTarget: unknown
platform: Platform
propertyisDrawninherited
isDrawn: boolean

Whether the target has received at least one draw operation.

propertyhitSymbolstaticinherited
readonly hitSymbol: symbol

DI token for the hit-test render layer.

propertyoffScreenSymbolstaticinherited
readonly offScreenSymbol: symbol

DI token for the scroll-optimization render layer.

propertysymbolstatic
readonly symbol: symbol

DI token for the primary visible render layer.

methodaddClickEventListener
addClickEventListener(callback: (event: EventWithOffset): void): void

Attaches a click listener.

callback: (event: EventWithOffset): void
methodaddEventListener
addEventListener(type: string, callback: (event: EventWithOffset): void): (): void

Attaches a normalized event listener and returns an idempotent disposer.

type: string
callback: (event: EventWithOffset): void
methodaddMouseDownEventListener
addMouseDownEventListener(callback: (event: EventWithOffset): void): void

Attaches a pointer-press listener.

callback: (event: EventWithOffset): void
methodaddMouseMoveEventListener
addMouseMoveEventListener(callback: (event: EventWithOffset): void): void

Attaches a pointer-move listener.

callback: (event: EventWithOffset): void
methodaddMouseUpEventListener
addMouseUpEventListener(callback: (event: EventWithOffset): void): void

Attaches a pointer-release listener.

callback: (event: EventWithOffset): void
methodaddResizeListener
addResizeListener(callback: (): void): void

Attaches a resize listener for host target size changes.

callback: (): void
methodbeginFrame
beginFrame(): void

Starts a new render frame when the target rebuilds its visual state.

methodbeginNodeSemanticsinherited
beginNodeSemantics(_semantics: RenderNodeSemantics): void

Marks subsequent drawing operations as belonging to one semantic scene node.

_semantics: RenderNodeSemantics
methodbeginPath
beginPath(): void

Begins a new path.

methodclearRect
clearRect(x: number, y: number, width: number, height: number): void

Clears a rectangle from the target.

x: number
y: number
width: number
height: number
methodclip
clip(): void

Clips future drawing to the active path.

methodcloneNode
cloneNode(): WebWebGLRenderContext

Creates a same-kind render context for an auxiliary render layer.

methodclosePath
closePath(): void

Closes the active path.

methodcreateHitNode
createHitNode(): WebCanvasRenderContext

Creates a same-kind render context configured for hit testing.

methoddrawImage
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.

image: unknown
x: number
y: number
width: number
height: number
sx: number
sy: number
sWidth: number
sHeight: number
methodendNodeSemanticsinherited
endNodeSemantics(): void

Ends the semantic scene-node boundary started by beginNodeSemantics.

methodfill
fill(): void

Fills the active path with the current fill style.

methodfillText
fillText(text: string, x: number, y: number, maxWidth?: number): void

Draws text at the given position.

text: string
x: number
y: number
maxWidth: number
methodgetAttribute
getAttribute(name: string): string

Reads a host-visible attribute from the backing target.

name: string
methodgetImageData
getImageData(x: number, y: number, width: number, height: number): RenderImageData

Reads raster pixels from the target.

x: number
y: number
width: number
height: number
methodgetLineWidth
getLineWidth(): number

Returns the current stroke line width.

methodgetMaxLineWidth
getMaxLineWidth(): number

Returns the largest stroke width tracked for erase padding.

methodgetRasterScale
getRasterScale(): number

Raster units represented by one host-view unit for this context.

methodgetRenderTarget
getRenderTarget(): HTMLCanvasElement

Returns the native backing target owned by this render context.

methodgetRoot
getRoot(): HTMLCanvasElement

Returns the event root associated with this render context.

methodgetViewScale
getViewScale(): number

Returns the current logical view scale.

methodinitialize
initialize(scale?: number): void

Initializes target sizing and adapter-specific state.

scale: number
methodlineTo
lineTo(x: number, y: number): void

Adds a line from the current path cursor.

x: number
y: number
methodmeasureText
measureText(text: string): { fontAscent?: number; fontDescent?: number; fontLineGap?: number; height: number; width: number }

Measures text using the active font and returns normalized metrics.

text: string
methodmoveTo
moveTo(x: number, y: number): void

Moves the active path cursor.

x: number
y: number
methodputImageData
putImageData(imageData: RenderImageData, x: number, y: number): void

Writes raster pixels to the target.

imageData: RenderImageData
x: number
y: number
methodrect
rect(x: number, y: number, width: number, height: number): void

Adds a rectangle to the active path.

x: number
y: number
width: number
height: number
methodremoveClickEventListener
removeClickEventListener(): void

Removes a click listener.

methodremoveMouseDownEventListener
removeMouseDownEventListener(): void

Removes a pointer-press listener.

methodremoveMouseMoveEventListener
removeMouseMoveEventListener(): void

Removes a pointer-move listener.

methodremoveMouseUpEventListener
removeMouseUpEventListener(): void

Removes a pointer-release listener.

methodremoveResizeListener
removeResizeListener(): void

Removes the active resize listener, if any.

methodrequiresExplicitNodeClear
requiresExplicitNodeClear(): boolean

Whether an existing node must erase its prior output before it is redrawn.

methodrequiresFrameRebuild
requiresFrameRebuild(): boolean

Whether the target must rebuild a complete visual frame instead of reusing a pixel cache.

methodresetHitFrameinherited
resetHitFrame(width: number, height: number): void

Resets the complete hit-test frame using the target's native lifecycle.

width: number
height: number
methodresetTransform
resetTransform(): void

Resets the current transform to the identity transform.

methodresize
resize(width: number, height: number, scale?: number): void

Resizes the backing render target to the host view's logical size and raster scale.

width: number
height: number
scale: number
methodrestore
restore(): void

Restores the most recently saved drawing state.

methodsave
save(): void

Saves the current drawing state.

methodsetAttribute
setAttribute(name: string, value: string): void

Sets a host-visible attribute on the backing target.

name: string
value: string
methodsetFillStyle
setFillStyle(fillStyle: RenderPaint): void

Sets the current fill style.

fillStyle: RenderPaint
methodsetFont
setFont(font: string): void

Sets the active platform-neutral font descriptor.

font: string
methodsetLineDash
setLineDash(segments: number[]): void

Sets the current line dash pattern.

segments: number[]
methodsetLineWidth
setLineWidth(width: number): void

Sets the current stroke line width.

width: number
methodsetStrokeStyle
setStrokeStyle(strokeStyle: RenderPaint): void

Sets the current stroke style.

strokeStyle: RenderPaint
methodsetTransform
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void

Replaces the current transform matrix.

a: number
b: number
c: number
d: number
e: number
f: number
methodsetViewScale
setViewScale(scale: number): void

Logical view scale (distinct from device pixel ratio).

scale: number
methodstroke
stroke(): void

Strokes the active path with the current stroke style.

methodstrokeRect
strokeRect(x: number, y: number, width: number, height: number): void

Strokes a rectangle without requiring a separate path.

x: number
y: number
width: number
height: number
methodsupportsDirtyRedraw
supportsDirtyRedraw(): boolean

Whether the target can apply a redraw to only its accumulated dirty regions.

methodtranslate
translate(x: number, y: number): void

Translates the current drawing transform.

x: number
y: number
interfaceCoordinatePointsource ↗
interface CoordinatePoint

Public contract for viewport/world/raster coordinate points.

propertyx
x: number
propertyy
y: number
interfaceEventWithOffsetsource ↗
interface EventWithOffset extends RenderPointerEvent

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.

propertyaltKeyinherited
readonly altKey?: boolean
propertybuttoninherited
readonly button?: number

Normalized button index: zero is the primary pointer button.

propertyclickCount
readonly clickCount?: number

Consecutive click count normalized by host adapters when available.

propertyclientXinherited
readonly clientX?: number
propertyclientYinherited
readonly clientY?: number
propertyctrlKeyinherited
readonly ctrlKey?: boolean
propertydetailinherited
readonly detail?: number
propertymetaKeyinherited
readonly metaKey?: boolean
propertyoffsetXinherited
readonly offsetX: number
propertyoffsetYinherited
readonly offsetY: number
propertyshiftKeyinherited
readonly shiftKey?: boolean
propertytargetinherited
readonly target?: unknown
methodpreventDefaultinherited
preventDefault(): void
methodstopPropagationinherited
stopPropagation(): void
interfaceRenderImageDatasource ↗
interface RenderImageData
propertydata
readonly data: [number, number, number, number][]
propertyheight
readonly height: number
propertywidth
readonly width: number
interfaceRenderNodeSemanticssource ↗
interface RenderNodeSemantics

Semantic ownership metadata attached to drawing for retained targets and diagnostics.

propertyowner
readonly owner?: string

Plugin or scene owner responsible for the drawn node.

propertyrole
readonly role?: string

Semantic role of the drawn node, such as cell, header or overlay.

interfaceRenderPointerEventsource ↗
interface RenderPointerEvent

Pointer event shape shared by renderers without requiring host-native event types.

propertyaltKey
readonly altKey?: boolean
propertybutton
readonly button?: number

Normalized button index: zero is the primary pointer button.

propertyclickCount
readonly clickCount?: number
propertyclientX
readonly clientX?: number
propertyclientY
readonly clientY?: number
propertyctrlKey
readonly ctrlKey?: boolean
propertydetail
readonly detail?: number
propertymetaKey
readonly metaKey?: boolean
propertyoffsetX
readonly offsetX: number
propertyoffsetY
readonly offsetY: number
propertyshiftKey
readonly shiftKey?: boolean
propertytarget
readonly target?: unknown
methodpreventDefault
preventDefault(): void
methodstopPropagation
stopPropagation(): void
typeRenderGradientsource ↗
type RenderGradient = object

Opaque paint handles supplied by a concrete renderer.

typeRenderImageSourcesource ↗
type RenderImageSource = unknown
typeRenderPaintsource ↗
type RenderPaint = string | RenderGradient | RenderPattern
typeRenderPatternsource ↗
type RenderPattern = object

Opaque pattern handles supplied by a concrete renderer.

Package

@searsuite/sear-render-coord

4 exports

Conversions between document, viewport, screen, and host-view coordinates.

classCoordinateEnginesource ↗
class CoordinateEngine extends Plugin<SearCoreSheet, CellProperties, CoordinateState>

Sheet plugin that tracks pointer and scroll coordinates.

CoordinateEngine is the plugin-facing facade over CoordinateTransformer:
it caches the latest host pointer position, reads ScrollManager state, and
exposes conversions between view and world coordinates.

constructorconstructor
CoordinateEngine(scrollManager: ScrollManager, coordinates: CoordinateTransformer): CoordinateEngine

Constructs the coordinate engine and subscribes it to scroll updates.

scrollManager: ScrollManager
Scroll state manager for the current sheet.
coordinates: CoordinateTransformer
Shared coordinate transformer.
propertydepth
depth: number

Coordinate state is metadata and should render before visible plugins if queried.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<CoordinateState, object> | readonly PluginDocumentStateContribution<CoordinateState, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key for coordinate state registration.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the coordinate engine.

memberkeyinherited
key: unknown
methodapply
apply(state: CoordinateState, _transaction: Transaction): CoordinateState | null

Keeps coordinate state unchanged for data transactions.

ReturnsThe unchanged coordinate state.

state: CoordinateState
Current coordinate state.
_transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetCoordinateState
getCoordinateState(): CoordinateState

Returns a detached projection of the current input and viewport coordinates.

methodgetCurrentMouseScreen
getCurrentMouseScreen(): CoordinatePoint

Returns the latest pointer position in host-event coordinates.

ReturnsCurrent pointer coordinate as recorded from mouse events.

methodgetCurrentMouseView
getCurrentMouseView(): CoordinatePoint

Returns the latest pointer position in viewport coordinates.

methodgetCurrentMouseWorld
getCurrentMouseWorld(): CoordinatePoint

Returns the latest pointer position in scrolled sheet-world coordinates.

ReturnsCurrent pointer converted through the active scroll transform.

methodgetPluginConfig
getPluginConfig(): unknown

CoordinateEngine has no plugin-specific configuration.

methodgetStateinherited
getState(): CoordinateState

Returns the plugin-owned state currently registered with the manager.

methodgetVisibleScreenRect
getVisibleScreenRect(): PositionRect<unknown>

Returns the current host-view viewport rectangle.

ReturnsVisible screen-space rectangle starting at the viewport origin.

methodgetVisibleWorldRect
getVisibleWorldRect(): PositionRect<unknown>

Returns the currently visible sheet-world rectangle.

ReturnsVisible world-space viewport rectangle.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: CoordinateState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: CoordinateState
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove
onMouseMove(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

Tracks the latest pointer position from sheet mouse-move events.

_searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
Pointer event carrying host-view offsets.
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: CoordinateState, 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.

state: CoordinateState
transaction: Transaction
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: CoordinateState }

Registers coordinate state under the plugin key.

methodrender
render(): Node<CellProperties>[] | null

CoordinateEngine does not render scene nodes directly.

methodscreenToView
screenToView(screenX: number, screenY: number): CoordinatePoint

Converts a host-event point into an unscrolled viewport point.

screenX: number
screenY: number
methodscreenToWorld
screenToWorld(screenX: number, screenY: number): CoordinatePoint

Converts a host-event point into sheet-world coordinates.

ReturnsPoint in sheet-world coordinates.

screenX: number
Host-event x-coordinate.
screenY: number
Host-event y-coordinate.
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: CoordinateState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: CoordinateState
commitToken: object
methodworldToScreen
worldToScreen(worldX: number, worldY: number): CoordinatePoint

Converts a sheet-world point into host-view coordinates.

ReturnsPoint in host-view coordinates.

worldX: number
Sheet-world x-coordinate.
worldY: number
Sheet-world y-coordinate.
interfaceCoordinatePointsource ↗
interface CoordinatePoint

Two-dimensional point in the sheet coordinate system returned by this engine.

propertyx
x: number

Horizontal coordinate.

propertyy
y: number

Vertical coordinate.

interfaceCoordinateStatesource ↗
interface CoordinateState

Local coordinate state tracked by CoordinateEngine.

propertymouseScreenX
mouseScreenX: number

Latest pointer x-position in host-event view coordinates.

propertymouseScreenY
mouseScreenY: number

Latest pointer y-position in host-event view coordinates.

propertyscrollX
scrollX: number

Latest horizontal scroll offset in world coordinates.

propertyscrollY
scrollY: number

Latest vertical scroll offset in world coordinates.

functioncreateDefaultCoordinateStatesource ↗
createDefaultCoordinateState(): CoordinateState

Creates the default coordinate plugin state.

ReturnsInitial pointer and scroll coordinates.

Package

@searsuite/sear-render-cursor

15 exports

Portable cursor policies with Web and headless host adapters.

classCursorEnginesource ↗
class CursorEngine

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.

constructorconstructor
CursorEngine(): CursorEngine
propertysymbolstatic
readonly symbol: symbol

DI token for resolving CursorEngine.

methodapply
apply(token: CursorToken): void

Applies a transaction to CursorEngine state.

token: CursorToken
methodmount
mount(target: unknown): void

Attaches this adapter to its host surface.

target: unknown
methodoverride
override(token: CursorToken | null): void

Lock the cursor to a fixed token (e.g. during cell editing). Pass null to release.

token: CursorToken | null
methodunmount
unmount(): void

Detaches this adapter from its host surface.

classCursorRegistrysource ↗
class CursorRegistry

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'

constructorconstructor
CursorRegistry(platform?: Platform): CursorRegistry

Creates a registry and optionally enables position-rule conflict diagnostics.

platform: Platform
propertysymbolstatic
readonly symbol: symbol

DI token for resolving CursorRegistry.

methodregister
register(rule: CursorRule): (): void

Registers a cursor rule and returns an idempotent disposer that restores
the previous rule for the same key when applicable.

rule: CursorRule
methodregisterPosition
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: Omit<PositionCursorRule, "kind">
Position rule fields excluding the fixed kind discriminator.
methodresolve
resolve(properties: CellProperties | null, position?: CursorPosition): CursorToken

Resolves a logical cursor token without exposing presentation details.

properties: CellProperties | null
Hit-tested cell properties, if any.
position: CursorPosition
Pointer context used by registered coordinate rules.
classHeadlessCursorEnginesource ↗
class HeadlessCursorEngine extends CursorEngine

Cursor adapter for environments that have no visible pointer.

constructorconstructor
HeadlessCursorEngine(): HeadlessCursorEngine
propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessCursorEngine.

methodapply
apply(_token: CursorToken): void

Applies a transaction to HeadlessCursorEngine state.

_token: CursorToken
methodmount
mount(_target: unknown): void

Attaches this adapter to its host surface.

_target: unknown
methodoverride
override(_token: CursorToken | null): void

Applies a temporary host cursor override.

_token: CursorToken | null
methodunmount
unmount(): void

Detaches this adapter from its host surface.

classSheetCursorPluginsource ↗
class SheetCursorPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetCursorState>

Projects Sheet interaction state into host cursor behavior.

constructorconstructor
SheetCursorPlugin(cursorRegistry: CursorRegistry, cursorEngine: CursorEngine, coordinates: CoordinateEngine, renderContext: RenderContext): SheetCursorPlugin

Creates a SheetCursorPlugin instance.

cursorRegistry: CursorRegistry
cursorEngine: CursorEngine
coordinates: CoordinateEngine
renderContext: RenderContext
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<ISheetCursorState, object> | readonly PluginDocumentStateContribution<ISheetCursorState, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetCursorPlugin.

memberkeyinherited
key: unknown
methodapply
apply(_state: ISheetCursorState, _tx: Transaction): ISheetCursorState | null

Applies a transaction to SheetCursorPlugin state.

_state: ISheetCursorState
_tx: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): { }

Returns the plugin config.

methodgetStateinherited
getState(): ISheetCursorState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: ISheetCursorState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: ISheetCursorState
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove
onMouseMove(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

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.

_searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: ISheetCursorState, 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.

state: ISheetCursorState
transaction: Transaction
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { key: PluginKey; state: { } }

Registers the state.

methodrender
render(): null

Returns null: this plugin produces no scene nodes.
Nothing is written to SceneGraph → DirtyTree, StickyRenderStrategy, and Hit Canvas
are completely unaffected (Rule.md §1.4, §1.5).

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: ISheetCursorState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: ISheetCursorState
commitToken: object
classWebCursorEnginesource ↗
class WebCursorEngine extends CursorEngine

Browser CSS cursor implementation.
Maps CursorToken to CSS cursor values (including SVG data URI custom cursors).

constructorconstructor
WebCursorEngine(): WebCursorEngine
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving CursorEngine.

methodapply
apply(token: CursorToken): void

Applies a transaction to WebCursorEngine state.

token: CursorToken
methodmount
mount(target: unknown): void

Attaches this adapter to its host surface.

target: unknown
methodoverride
override(token: CursorToken | null): void

Applies a temporary host cursor override.

token: CursorToken | null
methodregisterToken
registerToken(token: string, cssCursor: string): void

Allow third parties to extend or override Token → CSS mapping.

token: string
cssCursor: string
methodunmount
unmount(): void

Detaches this adapter from its host surface.

interfaceCursorPositionsource ↗
interface CursorPosition

Pointer coordinates supplied to a position cursor rule for one pointer event.

propertycore
core: SearCoreSheet

Sheet core whose current data and interaction state may inform the cursor decision.

propertyorigin
origin: EventWithOffset

Original host pointer event.

propertytarget
target: CellProperties | null

Hit-tested cell properties, or null when the pointer is not over a scene node.

propertyview
view: { x: number; y: number }

Pointer location relative to the rendered viewport.

propertyworld
world: { x: number; y: number }

Pointer location in scrollable sheet-world coordinates.

interfacePositionCursorRulesource ↗
interface PositionCursorRule

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.

propertycursor
cursor: CursorToken

Logical cursor presented while this rule owns the pointer.

propertykey
key: string | symbol

Stable owner key used for replacement, removal, and conflict diagnostics.

propertykind
kind: "position"
propertylayer
layer: number

Precedence among position rules; larger values take precedence.

propertytest
test: (position: CursorPosition): boolean

Returns whether this rule owns the supplied pointer location.

interfacePredicateCursorRulesource ↗
interface PredicateCursorRule

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).

propertycursor
cursor: CursorToken
propertykey
key?: string | symbol

Predicates need an explicit key to replace a previous predicate rule.

propertykind
kind: "predicate"
propertypriority
priority?: "high" | "low"
propertytest
test: (properties: CellProperties): boolean
interfaceRegionCursorRulesource ↗
interface RegionCursorRule

Exact region-match rule (highest priority among structural rules).

propertycursor
cursor: CursorToken
propertykey
key?: string | symbol

Optional extension key; defaults to the region identifier.

propertykind
kind: "region"
propertyregion
region: CellRegion
interfaceTypeCursorRulesource ↗
interface TypeCursorRule

Type-field match rule (secondary match).

propertycellType
cellType: string | symbol
propertycursor
cursor: CursorToken
propertykey
key?: string | symbol

Optional extension key; defaults to the cell type.

propertykind
kind: "type"
typeCursorRulesource ↗
type CursorRule = RegionCursorRule | TypeCursorRule | PredicateCursorRule | PositionCursorRule

Type contract for CursorRule.

typeCursorTokensource ↗
type CursorToken = typeof CursorToken[keyof typeof CursorToken] | string & { }

Built-in tokens plus an extension point for third-party plugins.

variableCursorRuleKindsource ↗
CursorRuleKind: { Position: "position"; Predicate: "predicate"; Region: "region"; Type: "type" }
variableCursorRulePrioritysource ↗
CursorRulePriority: { High: "high"; Low: "low" }
variableCursorTokensource ↗
CursorToken: { Cell: "cell"; ColumnResize: "col-resize"; ColumnSelect: "col-select"; Copy: "copy"; Default: "default"; Grab: "grab"; Grabbing: "grabbing"; Move: "move"; … }

Built-in logical cursor names, unbound to any rendering technology.

Package

@searsuite/sear-render-engine

37 exports

Frame scheduling, dirty-region coordination, and Sheet render orchestration.

classDataEnginesource ↗
class DataEngine

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.

constructorconstructor
DataEngine(): DataEngine
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the abstract data engine singleton.

methodenforceWriteBoundary
enforceWriteBoundary(token: object): void

Restricts registered state and view changes to the owning runtime after setup.

token: object
methodgetDataType
getDataType<T>(key: PluginKey): T | undefined

Retrieves a plugin-owned data value.

ReturnsRegistered value, or void 0 when absent.

key: PluginKey
Plugin key to read.
methodgetDataTypeOptions
getDataTypeOptions(key: PluginKey): DataEngineRegistrationOptions<unknown> | undefined

Reads registration metadata for a plugin-owned data value.

ReturnsRegistration metadata, or void 0 when the key is not registered.

key: PluginKey
Plugin key to inspect.
methodgetDataViewFieldKeys
getDataViewFieldKeys(viewKey: string): string[]

Lists fields registered for one named data view.

ReturnsField names in registration order.

viewKey: string
Named data view to inspect.
methodgetRegisteredDataTypeKey
getRegisteredDataTypeKey(key: string): PluginKey | undefined

Resolves a transport-safe plugin-key string to the registered key object.

PluginKey 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 PluginKey, or void 0 when no state owner has that key.

key: string
Stable key string carried by a transport message.
methodhasDataType
hasDataType(key: PluginKey): boolean

Reports whether a plugin state has been registered with this engine.

ReturnsTrue when the key owns a DataEngine-visible state value.

key: PluginKey
Plugin key to inspect.
methodinitialize
initialize(): void

Initializes engine-owned registries or projections.

methodreadDataViewField
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: string
Named data view containing the field.
fieldKey: string
Field to read.
methodregisterDataType
registerDataType<StateType>(key: PluginKey, value: StateType, options?: DataEngineRegistrationOptions<StateType>, token?: object): void

Registers a plugin-owned data value.

key: PluginKey
Plugin key owning the data.
value: StateType
Data value to store.
options: DataEngineRegistrationOptions<StateType>
token: object
methodregisterDataViewField
registerDataViewField<StateType>(ownerKey: PluginKey, 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: PluginKey
Plugin key whose current state feeds the selector.
field: DataEngineViewFieldRegistration<StateType>
Named view field selector.
token: object
methodreplaceDataType
replaceDataType(key: PluginKey, value: unknown, token?: object): void

Replaces a plugin-owned data value.

key: PluginKey
Plugin key owning the data.
value: unknown
New data value.
token: object
classDataViewFieldDuplicateErrorsource ↗
class DataViewFieldDuplicateError extends SearError

Error thrown when two different state owners try to publish the same data view field.

constructorconstructor
DataViewFieldDuplicateError(details: { existingOwnerKey: string; fieldKey: string; ownerKey: string; viewKey: string }): DataViewFieldDuplicateError

Creates a duplicate data view field error.

details: { existingOwnerKey: string; fieldKey: string; ownerKey: string; viewKey: string }
View key, field key, existing owner, and conflicting owner.
propertycauseinherited
cause?: unknown
propertycode
readonly code: "DATA_VIEW_FIELD_DUPLICATE"

Stable machine-readable code for duplicate data view field registrations.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classRenderContextFactorysource ↗
class RenderContextFactory

Factory registry for render-context implementations.

constructorconstructor
RenderContextFactory(): RenderContextFactory
methodcreateContextstatic
createContext(type: string | symbol, args: unknown): RenderContext

Creates a render context for a registered type.

ReturnsNew render context instance.

type: string | symbol
Context type key.
args: unknown
Adapter-specific construction input.
methodregisterContextstatic
registerContext(type: string | symbol, contextCreator: (args: unknown): RenderContext): void

Registers a render-context creator.

type: string | symbol
Context type key.
contextCreator: (args: unknown): RenderContext
Factory invoked by createContext().
classRenderEnginesource ↗
class RenderEngine<NodeType, RenderCoordinatorManagerType>

Schedules frames and applies a render strategy to the current scene.

constructorconstructor
RenderEngine<NodeType, RenderCoordinatorManagerType>(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManagerType, renderStrategyManager: RenderStrategyManager<NodeType>): RenderEngine<NodeType, RenderCoordinatorManagerType>

Creates a RenderEngine instance.

scrollManager: ScrollManager
renderContext: RenderContext
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManagerType
renderStrategyManager: RenderStrategyManager<NodeType>
propertyconfigEngine
readonly configEngine: ConfigEngine
propertyrenderContext
readonly renderContext: RenderContext
propertyrenderCoordinatorManager
readonly renderCoordinatorManager: RenderCoordinatorManagerType
propertyrenderStrategyManager
readonly renderStrategyManager: RenderStrategyManager<NodeType>
propertyscrollManager
readonly scrollManager: ScrollManager
propertysymbolstatic
readonly symbol: symbol

DI token for resolving RenderEngine.

methodinitialize
initialize(): void

Initializes RenderEngine.

methodinvalidateScreenCache
invalidateScreenCache(): void

Discard pixel-cache reuse before the next render.

methodmarkDirty
markDirty(rect: PositionRect<templateLiteral>): void

Marks a region or the current scene for rendering on the next frame.

rect: PositionRect<templateLiteral>
methodrender
render(node: Node<NodeType>): void

Renders RenderEngine scene output.

node: Node<NodeType>
methodresize
resize(width: number, height: number, scale: number): void

Resizes the render target and invalidates dependent frame state.

width: number
height: number
scale: number
methodsetViewScale
setViewScale(scale: number): void

Updates the view scale.

scale: number
classSheetDataEnginesource ↗
class SheetDataEngine extends DataEngine

Data engine specialization for sheet matrix state.

constructorconstructor
SheetDataEngine(): SheetDataEngine
propertysymbolstaticinherited
readonly symbol: typeof symbol

DI token for resolving the abstract data engine singleton.

methodenforceWriteBoundaryinherited
enforceWriteBoundary(token: object): void

Restricts registered state and view changes to the owning runtime after setup.

token: object
methodgetDataTypeinherited
getDataType<T>(key: PluginKey): T | undefined

Retrieves a plugin-owned data value.

ReturnsRegistered value, or void 0 when absent.

key: PluginKey
Plugin key to read.
methodgetDataTypeOptionsinherited
getDataTypeOptions(key: PluginKey): DataEngineRegistrationOptions<unknown> | undefined

Reads registration metadata for a plugin-owned data value.

ReturnsRegistration metadata, or void 0 when the key is not registered.

key: PluginKey
Plugin key to inspect.
methodgetDataViewFieldKeysinherited
getDataViewFieldKeys(viewKey: string): string[]

Lists fields registered for one named data view.

ReturnsField names in registration order.

viewKey: string
Named data view to inspect.
methodgetRegisteredDataTypeKeyinherited
getRegisteredDataTypeKey(key: string): PluginKey | undefined

Resolves a transport-safe plugin-key string to the registered key object.

PluginKey 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 PluginKey, or void 0 when no state owner has that key.

key: string
Stable key string carried by a transport message.
methodhasDataTypeinherited
hasDataType(key: PluginKey): boolean

Reports whether a plugin state has been registered with this engine.

ReturnsTrue when the key owns a DataEngine-visible state value.

key: PluginKey
Plugin key to inspect.
methodinitialize
initialize(): void

Initializes sheet data projections.

methodreadDataViewFieldinherited
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: string
Named data view containing the field.
fieldKey: string
Field to read.
methodregisterDataTypeinherited
registerDataType<StateType>(key: PluginKey, value: StateType, options?: DataEngineRegistrationOptions<StateType>, token?: object): void

Registers a plugin-owned data value.

key: PluginKey
Plugin key owning the data.
value: StateType
Data value to store.
options: DataEngineRegistrationOptions<StateType>
token: object
methodregisterDataViewFieldinherited
registerDataViewField<StateType>(ownerKey: PluginKey, 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: PluginKey
Plugin key whose current state feeds the selector.
field: DataEngineViewFieldRegistration<StateType>
Named view field selector.
token: object
methodreplaceDataTypeinherited
replaceDataType(key: PluginKey, value: unknown, token?: object): void

Replaces a plugin-owned data value.

key: PluginKey
Plugin key owning the data.
value: unknown
New data value.
token: object
classSheetDataPluginsource ↗
class SheetDataPlugin extends Plugin<unknown, CellProperties, SheetDataPluginState>

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.

constructorconstructor
SheetDataPlugin(state: SheetDataPluginState, formatCodecs?: (): CellFormatTransferRegistry): SheetDataPlugin

Constructs the sheet data plugin.

state: SheetDataPluginState
Shared sheet data state.
formatCodecs: (): CellFormatTransferRegistry
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetDataPluginState, SheetDataPluginState>

SheetDataPlugin owns the persisted sheet-data export module.

propertyinterestedIn
interestedIn: string[]

Sheet data reacts to cell changes and row/column structure edits from any command owner.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Sheet data transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Sheet data is state-only; duplicate render/event depth diagnostics do not apply.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetDataPluginState, SheetDataPluginState>

Document-state export contribution for persisted sheet cells.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all sheet data plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the sheet data plugin.

memberkeyinherited
key: unknown
methodapply
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: SheetDataPluginState
Current sheet data state.
transaction: Transaction
Transaction containing MatrixOT-compatible operations.
methoddirtyRectinherited
dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: unknown
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(): null

Sheet data has no render-time configuration.

methodgetStateinherited
getState(): SheetDataPluginState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: SheetDataPluginState): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: SheetDataPluginState
methodonClickinherited
onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: unknown
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: unknown): void

Called after the final cell of the shared startup scan is delivered.

searCore: unknown
methodonMouseDowninherited
onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: unknown
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: SheetDataPluginState, 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.

state: SheetDataPluginState
transaction: Transaction
methodregisterConfiginherited
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Contributes this owner's cell state to atomic range moves.

registry: SheetFormatTransferRegistry
methodregisterQueries
registerQueries(queries: SheetDataQueryRegistry): void

Publishes a live read-only projection for consumers that do not need an export snapshot.

queries: SheetDataQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): SheetMatrix; viewKey: string }[] }; key: PluginKey; state: SheetDataPluginState }

Registers the sheet data matrix for commands, rendering, and collaboration.

methodrender
render(): Node<CellProperties>[]

Sheet data does not render scene nodes directly.

ReturnsAn empty node list.

methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: SheetDataPluginState, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: SheetDataPluginState
commitToken: object
classSheetRenderEnginesource ↗
class SheetRenderEngine extends RenderEngine<CellProperties, SheetRenderCoordinatorManager>

Coordinates Sheet invalidation, frame scheduling, and screen-cache reuse.

constructorconstructor
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

Creates a SheetRenderEngine instance.

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>
propertyconfigEngineinherited
readonly configEngine: ConfigEngine
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: SheetRenderCoordinatorManager
propertyrenderStrategyManagerinherited
readonly renderStrategyManager: RenderStrategyManager<CellProperties>
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving RenderEngine.

methodapply
apply(operations: MatrixOTOperation<number>[]): void

Applies a transaction to SheetRenderEngine state.

operations: MatrixOTOperation<number>[]
methodgetLayer
getLayer(): void

Returns the layer.

methodgetStage
getStage(): void

Returns the stage.

methodinitialize
initialize(): void

Initializes SheetRenderEngine.

methodinvalidateScreenCache
invalidateScreenCache(): void

Drops retained screen content so the next frame repaints it.

methodmarkDirty
markDirty(rect: PositionRect<templateLiteral>): void

Marks a region or the current scene for rendering on the next frame.

rect: PositionRect<templateLiteral>
methodonClick
onClick(): void

Handles the click lifecycle event.

methodonScroll
onScroll(scrollManagerState: ScrollManagerState): void

Handles the scroll lifecycle event.

scrollManagerState: ScrollManagerState
methodrender
render(node: Node<CellProperties>): void

Renders SheetRenderEngine scene output.

node: Node<CellProperties>
methodresize
resize(width: number, height: number, scale: number): void

Resizes every canvas layer and invalidates scroll optimization buffers.

width: number
height: number
scale: number
methodsetViewScale
setViewScale(scale: number): void

Updates the view scale.

scale: number
classVisibleRowDimensionssource ↗
class VisibleRowDimensions extends DimensionsCSRMatrix

Dimension view shared by layout, hit testing, and rendering.

constructorconstructor
VisibleRowDimensions(source: DimensionsCSRMatrix, visibility: SheetRowVisibility): VisibleRowDimensions
source: DimensionsCSRMatrix
visibility: SheetRowVisibility
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, column: number | null[]): this

Inserts a column while omitting values equal to the configured default dimension.

targetIndex: number
column: number | null[]
methodaddIteminherited
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: number
Matrix row receiving the dimension value.
col: number
Matrix column receiving the dimension value.
value: number
Requested dimension size.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: number | null[]): this

Inserts a row while omitting values equal to the configured default dimension.

targetIndex: number
row: number | null[]
methodcloneinherited
clone(): this

Creates an independent copy of this value and its mutable data.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: number): number): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: number): number
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): VisibleRowDimensions

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): VisibleRowDimensions

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<number>[]): VisibleRowDimensions

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<number>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: number | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: number | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: number, 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).

callback: (value: number, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: number, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: number, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: number, col: number): void
methodfromDenseinherited
fromDense(denseArray: number | null[][]): VisibleRowDimensions

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: number | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValue
getDefaultValue(): number | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetDimensionLeftBoundaryByIndexinherited
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: number
The column index (0-based)
methodgetDimensionRightBoundaryByIndexinherited
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: number
The column index (0-based)
methodgetDimensionsMap
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]
methodgetItem
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: number
The row index.
column: number
methodgetLeftBoundaryColIndexByDimensioninherited
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: number
The cumulative dimension value to search for
methodgetRightBoundaryColIndexByDimensioninherited
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: number
The cumulative dimension value to search for
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): VisibleRowDimensions | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: number): void

Sets the dimension fallback and removes matching entries so only overrides remain stored.

value: number
Default row height or column width returned for absent entries.
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): VisibleRowDimensions

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): VisibleRowDimensions

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): number[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

interfaceDataEngineRegistrationOptionssource ↗
interface DataEngineRegistrationOptions<StateType>

Metadata associated with one DataEngine state registration.

propertydataView
readonly dataView?: readonly DataEngineViewFieldRegistration<StateType>[]

Field selectors contributed by the registered state to named data views.

interfaceDataEngineViewFieldRegistrationsource ↗
interface DataEngineViewFieldRegistration<StateType>

Field metadata associated with one DataEngine state registration.

propertyfieldKey
readonly fieldKey: string

Field name written into the named view.

propertyrequired
readonly required?: boolean

When false, missing owner state or void field values do not make the containing view unavailable.

propertyselect
readonly select: (state: StateType): unknown

Reads the field value from the current owner state.

propertyviewKey
readonly viewKey: string

Named read model that receives the selected field.

interfaceSheetCellDataReadersource ↗
interface SheetCellDataReader

Read-only live cell-data projection exposed by SheetDataPlugin.

propertyshape
readonly shape: readonly number[]
methodforEachStoredInRange
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (cell: CellMatrixElement, row: number, column: number): void): void
startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (cell: CellMatrixElement, row: number, column: number): void
methodgetItem
getItem(row: number, column: number): CellMatrixElement | null
row: number
column: number
interfaceSheetDataPluginStatesource ↗
interface SheetDataPluginState

State owned by SheetDataPlugin.

propertysheetData
sheetData: SheetMatrix

Main sheet matrix containing persisted cell values.

interfaceSheetDataQueryRegistrysource ↗
interface SheetDataQueryRegistry

Minimal query registry surface consumed by SheetDataPlugin.

methodregister
register(definition: ReadSheetCellDataQueryDefinition, handler: (input: void): SheetCellDataReader): (): void
definition: ReadSheetCellDataQueryDefinition
handler: (input: void): SheetCellDataReader
interfaceSheetRowVisibilitysource ↗
interface SheetRowVisibility

A Sheet presentation contribution that can suppress rows without changing their stored heights.

propertyactive
readonly active: boolean
propertyversion
readonly version: number
methodisRowFiltered
isRowFiltered(row: number): boolean
row: number
typeDataEngineViewFieldSelectorsource ↗
type DataEngineViewFieldSelector = { select: unknown }["select"]

Selector used to publish one registered state field into a named data view.

variableReadSheetCellDataQuerysource ↗
ReadSheetCellDataQuery: ReadSheetCellDataQueryDefinition

Reads the mounted editor's live cell matrix without creating a document snapshot.

variableSheetDataFieldNamespacesource ↗
SheetDataFieldNamespace: "SheetDataFields"

Shared DataEngine view containing Sheet feature projections.

variableSheetDataMatrixFieldKeysource ↗
SheetDataMatrixFieldKey: "sheet.data"

DataEngine field owned by SheetDataPlugin.

functioncreateInvertibleProjectedOperationssource ↗
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: CSRMatrix<T>
Projection matrix before the transaction.
operations: Operation[]
Source transaction operations.
createInvertible: (matrix: CSRMatrix<T>, operation: Operation): MatrixOTOperation<T> | null
Projection-specific operation builder.
functionreadDenseColumnsource ↗
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: CSRMatrix<T>
Matrix to read.
colIndex: number
Column index to snapshot.
functionreadDenseRowsource ↗
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: CSRMatrix<T>
Matrix to read.
rowIndex: number
Row index to snapshot.
functionreadSheetDataMatrixsource ↗
readSheetDataMatrix(dataEngine: DataEngine): SheetMatrix | null

Reads the persisted cell matrix published by SheetDataPlugin.

dataEngine: DataEngine
functionreadSheetRawRowSizessource ↗
readSheetRawRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | null

Reads the resize owner's stored row heights, without presentation visibility.

dataEngine: DataEngine
functionregisterReadSheetCellDataQuerysource ↗
registerReadSheetCellDataQuery(queries: SheetDataQueryRegistry, read: (): SheetMatrix): void

Registers the live, read-only cell-data projection owned by SheetDataPlugin.

queries: SheetDataQueryRegistry
read: (): SheetMatrix
interfaceCellMatrixElementsource ↗
interface CellMatrixElement

Persisted cell payload stored in the sheet matrix.

propertyformula
formula?: string

Formula source text for formula cells; calculated results live in formula plugin state.

propertyformulaEvaluationMode
formulaEvaluationMode?: "dynamic" | "legacy"

Array evaluation mode used when the formula was entered.

propertytype
type: string

Cell type identifier owned by the cell type catalog.

propertyvalue
value?: unknown

Raw value whose shape is owned by the cell type.

classDocRenderEnginesource ↗
class DocRenderEngine extends RenderEngine<NodeProperties, RenderCoordinatorManager>

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.

constructorconstructor
DocRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeProperties>, renderStrategyManager: RenderStrategyManager<NodeProperties>, screenRenderStrategy: ScreenRenderStrategy<NodeProperties>, dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>, stickyRenderStrategy: StickyRenderStrategy<NodeProperties>, overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>): DocRenderEngine

Creates a render engine for one document editor instance.

scrollManager: ScrollManager
renderContext: RenderContext
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeProperties>
renderStrategyManager: RenderStrategyManager<NodeProperties>
screenRenderStrategy: ScreenRenderStrategy<NodeProperties>
dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>
stickyRenderStrategy: StickyRenderStrategy<NodeProperties>
overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>
propertyconfigEngineinherited
readonly configEngine: ConfigEngine
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyrenderStrategyManagerinherited
readonly renderStrategyManager: RenderStrategyManager<NodeProperties>
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertysymbolstatic
readonly symbol: symbol

DI token for resolving DocRenderEngine.

methodgetLastScreenRenderMode
getLastScreenRenderMode(): ScreenRenderFrameMode | null

Returns the screen strategy mode used by the last render pass, if it painted.

methodinitialize
initialize(): void

Initializes DocRenderEngine.

methodinvalidateScreenCache
invalidateScreenCache(): void

Invalidates the off-screen body cache used by the screen strategy.

methodmarkDirty
markDirty(rect: PositionRect<templateLiteral>): void

Marks one document-world rectangle dirty for the next dirty pass.

rect: PositionRect<templateLiteral>
methodrender
render(node: Node<NodeProperties>): void

Runs the configured document render strategies over the current scene graph.

node: Node<NodeProperties>
methodresize
resize(width: number, height: number, scale: number): void

Resizes all Doc render layers and invalidates screen-cache reuse.

width: number
height: number
scale: number
methodsetBlockRasterCopyPlan
setBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): void

Supplies one layout-shift raster-copy plan for the next screen render pass.

plan: BlockRasterCopyPlan | null
methodsetViewport
setViewport(viewport: DocRenderViewport): void

Updates the viewport model used by subsequent render frames.

viewport: DocRenderViewport
methodsetViewScale
setViewScale(scale: number): void

Updates the view scale on every render strategy context.

scale: number
interfaceDocRenderViewportsource ↗
interface DocRenderViewport

Snapshot of the current document viewport used by render strategies.

propertycontentRect
readonly contentRect: PositionRectProps

Editable content rectangle inside the viewport.

propertyheight
readonly height: number

Visible viewport height in host-view units.

propertywidth
readonly width: number

Visible viewport width in host-view units.

functionreadSheetColumnHiddenOriginalSizessource ↗
readSheetColumnHiddenOriginalSizes(dataEngine: DataEngine): CSRMatrix<number> | null

Reads original column sizes captured while columns are hidden.

dataEngine: DataEngine
functionreadSheetColumnSizessource ↗
readSheetColumnSizes(dataEngine: DataEngine): DimensionsCSRMatrix | null

Reads column dimensions published by SheetResizePlugin.

dataEngine: DataEngine
functionreadSheetRowHiddenOriginalSizessource ↗
readSheetRowHiddenOriginalSizes(dataEngine: DataEngine): CSRMatrix<number> | null

Reads original row sizes captured while rows are hidden.

dataEngine: DataEngine
functionreadSheetRowSizessource ↗
readSheetRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | null

Reads row dimensions published by SheetResizePlugin.

dataEngine: DataEngine
variableSheetColumnHiddenOriginalSizesFieldKeysource ↗
SheetColumnHiddenOriginalSizesFieldKey: "sheet.resize.columnHiddenOriginalSizes"

DataEngine field for original dimensions of hidden columns owned by SheetResizePlugin.

variableSheetColumnSizesFieldKeysource ↗
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"

DataEngine field for column dimensions owned by SheetResizePlugin.

classSheetMatrixsource ↗
class SheetMatrix extends CSRMatrix<CellMatrixElement>

SheetMatrix public API.

constructorconstructor
SheetMatrix(data?: { data: CellMatrixElement[]; indices: number[]; indptr: number[] }, shape?: [number, number]): SheetMatrix

Constructs a CSRMatrix instance.

data: { data: CellMatrixElement[]; indices: number[]; indptr: number[] }
The data for the matrix.
shape: [number, number]
The shape of the matrix as [numRows, numCols].
propertynameinherited
name: string

The name of the matrix state.

propertyndiminherited
readonly ndim: number

Number of dimensions in the matrix.
For a standard sparse matrix, this is always 2 (rows and columns).
Kept as a property for potential future extensions (e.g., 3D arrays).

membernnzinherited
nnz: unknown
membershapeinherited
shape: unknown
methodaddColumninherited
addColumn(targetIndex: number, col: CellMatrixElement | null[]): SheetMatrix

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: number
The index where the new column should be inserted.
col: CellMatrixElement | null[]
An array representing the column to be added. The length of this array must match the number of rows in the matrix.
methodaddIteminherited
addItem(row: number, col: number, value: CellMatrixElement): SheetMatrix

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
value: CellMatrixElement
The value to add.
methodaddListenerinherited
addListener(listener: Listener): void

Registers a listener for future state changes.

listener: Listener
Callback invoked after notifyListeners().
methodaddRowinherited
addRow(targetIndex: number, row: CellMatrixElement | null[]): SheetMatrix

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: number
The index at which to add the row.
row: CellMatrixElement | null[]
The row to add.
methodclone
clone(): this

Copies stored cell payloads as well as sparse indexes.

methodcloneCommittedViewinherited
cloneCommittedView(detachExtra?: (value: unknown): unknown): this

Detaches subclass-private slots while sharing already frozen sparse storage.

detachExtra: (value: unknown): unknown
methodcloneDetachedinherited
cloneDetached(cloneValue: (value: CellMatrixElement): CellMatrixElement): this

Copies stored values for a detached snapshot without probing empty cells.

cloneValue: (value: CellMatrixElement): CellMatrixElement
methodcloneForStaginginherited
cloneForStaging(cloneValue?: <Value>(value: Value): Value): this

Copies visible sparse state without invoking subclass constructors or clone hooks.

cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited
deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetMatrix

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: number
The index of the first column to be deleted.
numDeleteColumns: number
The number of columns to delete. Defaults to 1.
methoddeleteRowsinherited
deleteRows(targetIndex: number, numDeleteRows?: number): SheetMatrix

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: number
The index at which to start deleting rows.
numDeleteRows: number
The number of rows to delete.
methoddispatchinherited
dispatch(operations: MatrixOTOperation<CellMatrixElement>[]): SheetMatrix

Applies a set of matrix operations to the current matrix.

ReturnsThe updated matrix instance.

operations: MatrixOTOperation<CellMatrixElement>[]
An array of operations to be applied to the matrix.
methoddotinherited
dot<U>(other: SparseMatrix<U>): void

Computes the dot product with another sparse matrix.

The dot product (scalar product) of two matrices is a standard linear algebra operation.
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the dot product

ThrowsUnless a subclass provides dot-product semantics.

other: SparseMatrix<U>
The other matrix to compute the dot product with
methodforEachinherited
forEach(callback: (value: CellMatrixElement | null, row: number, col: number): void): void

Iterates over every element in the matrix and applies a callback function.

This method iterates through all rows and columns, calling the callback for each position.
For a sparse matrix, this might iterate many times over empty/null values.
Consider using specialized iterators for better performance on large sparse matrices.

Example
let sum = 0;
matrix.forEach((value, row, col) => {
  if (value !== null) sum += value;
});
callback: (value: CellMatrixElement | null, row: number, col: number): void
The function to execute for each element
- value: The element at [row, col]
- row: The row index
- col: The column index

Time Complexity: O(rows * cols)
methodforEachStoredinherited
forEachStored(callback: (value: CellMatrixElement, 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).

callback: (value: CellMatrixElement, row: number, col: number): void
methodforEachStoredInRangeinherited
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, callback: (value: CellMatrixElement, row: number, column: number): void): void

Visits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.

startRow: number
startColumn: number
endRow: number
endColumn: number
callback: (value: CellMatrixElement, row: number, column: number): void
methodforEachStoredInRowinherited
forEachStoredInRow(row: number, callback: (value: CellMatrixElement, col: number): void): void

Visits the CSR segment for one row in O(stored entries in that row).

row: number
callback: (value: CellMatrixElement, col: number): void
methodfromDenseinherited
fromDense(denseArray: CellMatrixElement | null[][]): SheetMatrix

Converts a dense array to a CSRMatrix.

ReturnsThe current instance for chaining.

denseArray: CellMatrixElement | null[][]
The dense array to convert.
methodgetColinherited
getCol(colIndex: number): void

Retrieves a specific column from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
Similar to getRow but returns a single column instead.

ReturnsThe column as an array

ThrowsUnless a subclass provides column lookup.

colIndex: number
The index of the column to retrieve
methodgetDefaultValueinherited
getDefaultValue(): CellMatrixElement | undefined

Returns the configured fallback used for absent sparse entries, if one exists.

methodgetIteminherited
getItem(row: number, col: number): CellMatrixElement | 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: number
The row index.
col: number
The column index.
methodgetRowinherited
getRow(rowIndex: number): void

Retrieves a specific row from the matrix.

Abstract method - must be implemented by subclasses for efficiency.
A naive implementation would use getItem for each column, but sparse implementations
can optimize this significantly.

ReturnsThe row as an array

ThrowsUnless a subclass provides row lookup.

rowIndex: number
The index of the row to retrieve
methodlockMutationsinherited
lockMutations(): void

Prevents writes to a committed matrix while leaving clones mutable for transaction staging.

methodmultiplyinherited
multiply<U>(other: SparseMatrix<U>): void

Multiplies this matrix with another sparse matrix (matrix multiplication).

Standard matrix multiplication: result[i][j] = sum(this[i][k] * other[k][j])
For efficiency, implementations should take advantage of the sparse structure.

ReturnsThe resulting matrix from the multiplication

ThrowsUnless a subclass provides multiplication semantics.

other: SparseMatrix<U>
The matrix to multiply with
methodremoveIteminherited
removeItem(row: number, col: number): SheetMatrix | undefined

Removes an item from the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row: number
The row index.
col: number
The column index.
methodremoveListenerinherited
removeListener(listener: Listener): void

Removes a previously registered listener.

listener: Listener
Callback to detach from this state object.
methodsetDefaultValueinherited
setDefaultValue(value: CellMatrixElement): void

Sets the default value that will be returned for missing/unset elements.

By default, getItem returns null for missing values. If a default value is set,
missing values will return this default instead of null.

Example
matrix.setDefaultValue(0); // Return 0 for missing cells
const value = matrix.getItem(5, 5); // Returns 0 if not set
value: CellMatrixElement
The default value to return for missing elements
methodsuminherited
sum(axis: 0 | 1 | null): void

Sums the elements of the matrix along the specified axis.

ReturnsThe sum result (varies based on axis parameter)

ThrowsUnless a subclass provides summation semantics.

axis: 0 | 1 | null
The axis to sum along:
- null: Sum all elements (single value)
- 0: Sum along rows (column sums, returns row vector)
- 1: Sum along columns (row sums, returns column vector)
methodswapColumninherited
swapColumn(targetIndex: number, sourceIndex: number): SheetMatrix

Swaps two columns in the matrix at the specified indices.

ReturnsThe updated matrix instance.

targetIndex: number
The index of the first column to be swapped.
sourceIndex: number
The index of the second column to be swapped.
methodswapRowinherited
swapRow(targetIndex: number, sourceIndex: number): SheetMatrix

Swaps two rows in the matrix.

ReturnsThe current instance for chaining.

targetIndex: number
The index of the target row.
sourceIndex: number
The index of the source row.
methodtoArrayinherited
toArray(): CellMatrixElement[][]

Converts the matrix to a 2D array representation.

ReturnsA 2D array representing the matrix, with each element initialized to null if not set.

methodtransposeinherited
transpose(): void

Transposes the matrix (swaps rows and columns).

The transpose operation creates a new matrix where rows become columns and vice versa.
Sparse structure should be preserved in the result.

ReturnsThe transposed matrix

ThrowsUnless a subclass provides transpose semantics.

variableSheetRowHiddenOriginalSizesFieldKeysource ↗
SheetRowHiddenOriginalSizesFieldKey: "sheet.resize.rowHiddenOriginalSizes"

DataEngine field for original dimensions of hidden rows owned by SheetResizePlugin.

variableSheetRowSizesFieldKeysource ↗
SheetRowSizesFieldKey: "sheet.resize.rowSizes"

DataEngine field for row dimensions owned by SheetResizePlugin.

variableSheetRowVisibilityFieldKeysource ↗
SheetRowVisibilityFieldKey: "sheet.filter.rowVisibility"

Neutral field contract re-exported by the plugin that owns the contribution.

Package

@searsuite/sear-render-event-engine

8 exports

Hit testing and render-node event propagation.

classEventEnginesource ↗
class EventEngine<NodeTypeProperties> extends EventListener<string>

Coordinates render-context events, hit testing and plugin event dispatch.

constructorconstructor
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.

scrollManager: ScrollManager
renderContext: RenderContext
stageNode: SceneGraph<NodeTypeProperties>
configEngine: ConfigEngine
eventRenderStrategy: EventRenderStrategy<NodeTypeProperties>
hitRenderStrategy: HitRenderStrategy<NodeTypeProperties>
eventRegistrar: EventRegistrar
coordinates: CoordinateTransformer
propertyconfigEngine
readonly configEngine: ConfigEngine
propertyeventRegistrar
readonly eventRegistrar: EventRegistrar
propertyeventRenderStrategy
readonly eventRenderStrategy: EventRenderStrategy<NodeTypeProperties>
propertyhitRenderStrategy
readonly hitRenderStrategy: HitRenderStrategy<NodeTypeProperties>
propertyrenderContext
readonly renderContext: RenderContext
propertyscrollManager
readonly scrollManager: ScrollManager
propertystageNode
readonly stageNode: SceneGraph<NodeTypeProperties>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the event engine.

methodaddStrategy
addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Registers a named render strategy used by event handling.

name: string | Symbol
strategy: RenderStrategy<NodeTypeProperties>
methoddestroy
destroy(ownerToken?: object): void

Clears plugin handlers so a destroyed sheet cannot react to host events.

ownerToken: object
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetStrategy
getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefined

Returns a previously registered event render strategy.

name: string | Symbol
methodinitialize
initialize(): void

Registers built-in strategies and attaches render-context listeners.

methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): EventEngine<NodeTypeProperties>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodregisterEvent
registerEvent<Event>(eventKey: string, handler: (event: Event): void): (): void

Registers a plugin event handler for a normalized event key.

eventKey: string
handler: (event: Event): void
methodregisterEventListenersToRenderContext
registerEventListenersToRenderContext(): void

Attaches platform event listeners to the underlying render context.

methodrender
render(node: Node<NodeTypeProperties>): void

Rebuilds the hit layer for the given scene graph.

node: Node<NodeTypeProperties>
methodrenderHitOnNextFrame
renderHitOnNextFrame(node: Node<NodeTypeProperties>): void

Coalesces scroll-driven hit refreshes to at most one per animation frame.

node: Node<NodeTypeProperties>
methodrenderImmediate
renderImmediate(node: Node<NodeTypeProperties>): void

Render the hit canvas immediately, bypassing the debounce timer.

See HitRenderStrategy.renderImmediate() for details.

node: Node<NodeTypeProperties>
classEventRegistrarsource ↗
class EventRegistrar

Base registry for event names supported by one host event adapter.

constructorconstructor
EventRegistrar(): EventRegistrar
propertyregisteredEvents
registeredEvents: string[]

Normalized event names currently registered for dispatch.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the event registrar.

methodenforceCommandBoundary
enforceCommandBoundary(assertWrite: (): void): void

Publishes a read-only event-name view after editor assembly.

assertWrite: (): void
methodregister
register(eventKey: string): void

Registers an event name after normalizing platform casing.

eventKey: string
Event name requested by a plugin.
methodunregister
unregister(eventKey: string): void

Removes a registered event name.

eventKey: string
Event name requested by a plugin.
classHeadlessEventRegistrarsource ↗
class HeadlessEventRegistrar extends EventRegistrar

Event registrar for hosts without a native event source.

constructorconstructor
HeadlessEventRegistrar(): HeadlessEventRegistrar
propertyregisteredEventsinherited
registeredEvents: string[]

Normalized event names currently registered for dispatch.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessEventRegistrar.

methodenforceCommandBoundaryinherited
enforceCommandBoundary(assertWrite: (): void): void

Publishes a read-only event-name view after editor assembly.

assertWrite: (): void
methodregisterinherited
register(eventKey: string): void

Registers an event name after normalizing platform casing.

eventKey: string
Event name requested by a plugin.
methodunregisterinherited
unregister(eventKey: string): void

Removes a registered event name.

eventKey: string
Event name requested by a plugin.
classWebEventRegistrarsource ↗
class WebEventRegistrar extends EventRegistrar

Browser event registrar with the built-in mouse event surface enabled.

constructorconstructor
WebEventRegistrar(): WebEventRegistrar
propertyregisteredEvents
registeredEvents: string[]

Normalized mouse events supported by the browser registrar.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving the event registrar.

methodenforceCommandBoundaryinherited
enforceCommandBoundary(assertWrite: (): void): void

Publishes a read-only event-name view after editor assembly.

assertWrite: (): void
methodregisterinherited
register(eventKey: string): void

Registers an event name after normalizing platform casing.

eventKey: string
Event name requested by a plugin.
methodunregisterinherited
unregister(eventKey: string): void

Removes a registered event name.

eventKey: string
Event name requested by a plugin.
interfaceEventWithOffsetAndTargetsource ↗
interface EventWithOffsetAndTarget<NodeTypeProperties>

Plugin event payload enriched with hit-tested scene target.

propertyclickCount
clickCount?: number

Consecutive click count for this pointer activation, when known.

propertyorigin
origin: EventWithOffset

Original host event emitted by the render context.

propertytarget
target: Node<NodeTypeProperties> | null

Topmost scene node hit by the event, or null when empty.

functiongetPluginHandlerNamesource ↗
getPluginHandlerName(eventKey: string): string

Derives the plugin handler method name for a given event key.
e.g. mousedown / mouseDown → onMouseDown

eventKey: string
functionnormalizeEventKeysource ↗
normalizeEventKey(eventKey: string): string

Normalizes an event key (whether lowercased like mousedown or camelCased like mouseDown)
to its canonical engine identifier (mouseDown).

eventKey: string
interfaceEventWithOffsetsource ↗
interface EventWithOffset extends RenderPointerEvent

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.

propertyaltKeyinherited
readonly altKey?: boolean
propertybuttoninherited
readonly button?: number

Normalized button index: zero is the primary pointer button.

propertyclickCount
readonly clickCount?: number

Consecutive click count normalized by host adapters when available.

propertyclientXinherited
readonly clientX?: number
propertyclientYinherited
readonly clientY?: number
propertyctrlKeyinherited
readonly ctrlKey?: boolean
propertydetailinherited
readonly detail?: number
propertymetaKeyinherited
readonly metaKey?: boolean
propertyoffsetXinherited
readonly offsetX: number
propertyoffsetYinherited
readonly offsetY: number
propertyshiftKeyinherited
readonly shiftKey?: boolean
propertytargetinherited
readonly target?: unknown
methodpreventDefaultinherited
preventDefault(): void
methodstopPropagationinherited
stopPropagation(): void

Package

@searsuite/sear-render-input

17 exports

Keyboard, pointer, text-input, and composition routing contracts.

classHeadlessKeyboardRoutersource ↗
class HeadlessKeyboardRouter extends KeyboardRouter

Keyboard router for hosts that do not expose a keyboard event source.

constructorconstructor
HeadlessKeyboardRouter(): HeadlessKeyboardRouter
propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessKeyboardRouter.

methodemitinherited
emit(eventString: never, ...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: never
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: undefined, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: undefined
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: never, handler: Function): HeadlessKeyboardRouter

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: never
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodstartListener
startListener(): void

Starts listening to the host input source.

methodstopListener
stopListener(): void

Stops listening to the host input source.

methodsubscribe
subscribe(_handlers: KeyboardRouterHandlers): void

Subscribes to state changes and returns an idempotent disposer.

_handlers: KeyboardRouterHandlers
classHeadlessPointerCapturesource ↗
class HeadlessPointerCapture extends PointerCapture

No-op pointer capture adapter for hosts without a pointer event source.

constructorconstructor
HeadlessPointerCapture(): HeadlessPointerCapture
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving the pointer capture adapter.

methodstart
start(_handlers: PointerCaptureHandlers): (): void

Starts one capture session and returns a disposer for that session.

_handlers: PointerCaptureHandlers
methodstop
stop(): void

Stops the active session without invoking its release callback.

classHeadlessTextInputsource ↗
class HeadlessTextInput extends TextInput

Text-input adapter that intentionally owns no platform input element.

constructorconstructor
HeadlessTextInput(): HeadlessTextInput

Creates a TextInput instance.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessTextInput.

methodemitinherited
emit(eventString: never, ...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: never
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: undefined, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: undefined
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: never, handler: Function): HeadlessTextInput

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: never
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodrefocusinherited
refocus(): void

Restores focus to the hidden host text-input surface.

methodsetPositioninherited
setPosition(_x: number, _y: number): void

Updates the position.

_x: number
_y: number
methodstartListener
startListener(): void

Starts forwarding host text and composition events.

methodstopListener
stopListener(): void

Stops forwarding host text and composition events.

methodsubscribe
subscribe(_handlers: TextInputHandlers): void

Subscribes to state changes and returns an idempotent disposer.

_handlers: TextInputHandlers
methodisTextInputstaticinherited
isTextInput<T>(event: T): event

Classifies text events within a typed input-action union.

event: T
classInputsource ↗
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.

constructorconstructor
Input(): Input
methodemitinherited
emit(eventString: never, ...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: never
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: undefined, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: undefined
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: never, handler: Function): Input

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: never
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodstartListener
startListener(): void

Starts listening to the host input source.

methodstopListener
stopListener(): void

Stops listening to the host input source.

classInputManagersource ↗
class InputManager

Registry for input adapters owned by one editor instance.

constructorconstructor
InputManager(textInput: Input): InputManager

Constructs the manager with the configured text input adapter.

textInput: Input
Text input adapter resolved from the host.
propertytextInput
readonly textInput: Input

Text input adapter resolved from the host.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the input manager.

methodget
get<T>(symbol: symbol): T | undefined

Retrieves an input adapter by symbol.

ReturnsRegistered adapter, or void 0 when absent.

symbol: symbol
Adapter symbol.
methodgetTextInput
getTextInput(): TextInput | undefined

Returns the text-input adapter when it has been registered.

methodregister
register(symbol: symbol, input: Input): void

Registers an input adapter.

symbol: symbol
Adapter symbol.
input: Input
Adapter instance.
classKeyboardRoutersource ↗
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 keyboard listener (enter edit mode).
stopListener() – detach keyboard listener (commit / cancel).

constructorconstructor
KeyboardRouter(): KeyboardRouter
propertysymbolstatic
readonly symbol: symbol

DI token for resolving KeyboardRouter.

methodemitinherited
emit(eventString: never, ...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: never
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: undefined, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: undefined
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: never, handler: Function): KeyboardRouter

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: never
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodstartListenerinherited
startListener(): void

Starts listening to the host input source.

methodstopListenerinherited
stopListener(): void

Stops listening to the host input source.

methodsubscribe
subscribe(handlers: KeyboardRouterHandlers): void | (): void

Installs handlers; implementations may return a disposer that restores the previous handlers.

handlers: KeyboardRouterHandlers
classPointerCapturesource ↗
class PointerCapture

Platform-neutral, editor-local host-wide pointer capture contract.

constructorconstructor
PointerCapture(): PointerCapture
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the pointer capture adapter.

methodstart
start(handlers: PointerCaptureHandlers): (): void

Starts one capture session and returns a disposer for that session.

handlers: PointerCaptureHandlers
methodstop
stop(): void

Stops the active session without invoking its release callback.

classTextInputsource ↗
class TextInput extends Input

Routes host text and composition input through portable subscriptions.

constructorconstructor
TextInput(): TextInput

Creates a TextInput instance.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving TextInput.

methodemitinherited
emit(eventString: never, ...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: never
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: undefined, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: undefined
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: never, handler: Function): TextInput

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: never
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodrefocus
refocus(): void

Restores focus to the hidden host text-input surface.

methodsetPosition
setPosition(_x: number, _y: number): void

Updates the position.

_x: number
_y: number
methodstartListener
startListener(): void

Starts forwarding host text and composition events.

methodstopListener
stopListener(): void

Stops forwarding host text and composition events.

methodsubscribe
subscribe(_handlers: TextInputHandlers): void

Subscribes to state changes and returns an idempotent disposer.

_handlers: TextInputHandlers
methodisTextInputstatic
isTextInput<T>(event: T): event

Classifies text events within a typed input-action union.

event: T
classWebKeyboardRoutersource ↗
class WebKeyboardRouter extends KeyboardRouter

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
<input> 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().

constructorconstructor
WebKeyboardRouter(eventTarget: EventTarget): WebKeyboardRouter

Creates a WebKeyboardRouter instance.

eventTarget: EventTarget
propertyeventTargetSymbolstatic
readonly eventTargetSymbol: symbol

DI token for the keyboard event source, normally document.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving KeyboardRouter.

methodemitinherited
emit(eventString: never, ...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: never
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: undefined, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: undefined
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: never, handler: Function): WebKeyboardRouter

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: never
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodstartListener
startListener(): void

Starts listening to the host input source.

methodstopListener
stopListener(): void

Stops listening to the host input source.

methodsubscribe
subscribe(handlers: KeyboardRouterHandlers): (): void

Installs handlers; implementations may return a disposer that restores the previous handlers.

handlers: KeyboardRouterHandlers
classWebPointerCapturesource ↗
class WebPointerCapture extends PointerCapture

Browser pointer capture adapter that emits render-root view coordinates.

constructorconstructor
WebPointerCapture(renderContext: RenderContext, platform: Platform, eventTarget: unknown): WebPointerCapture

Creates one editor-local browser pointer capture adapter.

renderContext: RenderContext
platform: Platform
eventTarget: unknown
propertyeventTargetSymbolstatic
readonly eventTargetSymbol: symbol

DI token for the host-wide event source, normally document.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving the pointer capture adapter.

methodstart
start(handlers: PointerCaptureHandlers): (): void

Starts one capture session and returns a disposer for that session.

handlers: PointerCaptureHandlers
methodstop
stop(): void

Stops the active session without invoking its release callback.

classWebTextInputsource ↗
class WebTextInput extends TextInput

Browser implementation of TextInput.

Manages a hidden <input> 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.

constructorconstructor
WebTextInput(): WebTextInput

Creates a WebTextInput instance.

propertyonDelete
onDelete?: (): void

Handles the delete lifecycle event.

propertyonTextInput
onTextInput?: (event: TextInputEvent): void

Handles the input lifecycle event.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving TextInput.

methodemitinherited
emit(eventString: never, ...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: never
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: undefined, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: undefined
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: never, handler: Function): WebTextInput

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: never
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodrefocus
refocus(): void

Restore focus to the hidden input (e.g. after a canvas click moves focus away).

methodsetPosition
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.

x: number
y: number
methodstartListener
startListener(): void

Starts forwarding host text and composition events.

methodstopListener
stopListener(): void

Stops forwarding host text and composition events.

methodsubscribe
subscribe(handlers: TextInputHandlers): void

Subscribes to state changes and returns an idempotent disposer.

handlers: TextInputHandlers
methodisTextInputstaticinherited
isTextInput<T>(event: T): event

Classifies text events within a typed input-action union.

event: T
interfaceKeyboardRouterHandlerssource ↗
interface KeyboardRouterHandlers

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).

propertyonArrowDown
onArrowDown?: (shiftKey: boolean, metaKey: boolean): void
propertyonArrowLeft
onArrowLeft?: (shiftKey: boolean, metaKey: boolean): void
propertyonArrowRight
onArrowRight?: (shiftKey: boolean, metaKey: boolean): void
propertyonArrowUp
onArrowUp?: (shiftKey: boolean, metaKey: boolean): void
propertyonCopy
onCopy?: (): void

Ctrl/Cmd + C - copy the active sheet selection.

propertyonCut
onCut?: (): void

Ctrl/Cmd + X - cut the active sheet selection.

propertyonDelete
onDelete?: (): void

Backspace / Delete key.

propertyonEdit
onEdit?: (): void

Enters editing while retaining the selected cell's content.

propertyonEnd
onEnd?: (): void

Moves to the last occupied cell of the sheet.

propertyonEnter
onEnter?: (shiftKey: boolean, primaryModifier?: boolean): void

Enter key – commit the current edit.

propertyonEscape
onEscape?: (): void

Escape key – cancel the current edit.

propertyonHome
onHome?: (primaryModifier: boolean): void

Moves to the start of the active row, or sheet with a primary modifier.

propertyonPage
onPage?: (direction: -1 | 1): void

Moves the active selection by roughly one viewport.

propertyonPaste
onPaste?: (): void

Ctrl/Cmd + V - paste from the host clipboard.

propertyonRedo
onRedo?: (): void

Ctrl/Cmd + Shift + Z or Ctrl/Cmd + Y - redo the latest undone mutation.

propertyonSelectAll
onSelectAll?: (): void

Ctrl/Cmd + A – select all content in the editor.

propertyonSelectColumn
onSelectColumn?: (): void

Selects the entire active column.

propertyonSelectRow
onSelectRow?: (): void

Selects the entire active row.

propertyonSoftEnter
onSoftEnter?: (): void

Alt/Option + Enter – insert a line break (soft enter) inside the cell.

propertyonTab
onTab?: (shiftKey: boolean): void

Tab / Shift+Tab - move the active sheet selection horizontally.

propertyonToggleBold
onToggleBold?: (): void

Ctrl/Cmd + B - toggle bold text in the active rich-text editor.

propertyonToggleItalic
onToggleItalic?: (): void

Ctrl/Cmd + I - toggle italic text in the active rich-text editor.

propertyonToggleReference
onToggleReference?: (): void

Cycles the reference at the formula caret through relative and absolute modes.

propertyonToggleStrikethrough
onToggleStrikethrough?: (): void

Ctrl/Cmd + Shift + X - toggle strikethrough text in the active rich-text editor.

propertyonToggleUnderline
onToggleUnderline?: (): void

Ctrl/Cmd + U - toggle underlined text in the active rich-text editor.

propertyonUndo
onUndo?: (): void

Ctrl/Cmd + Z - undo the latest sheet mutation.

propertyonZoomIn
onZoomIn?: (): void
propertyonZoomOut
onZoomOut?: (): void
propertyonZoomReset
onZoomReset?: (): void
interfacePointerCaptureHandlerssource ↗
interface PointerCaptureHandlers

Callbacks active for one host-wide pointer capture session.

propertyonMove
readonly onMove?: (event: PointerCapturePoint): void

Receives pointer movement while capture is active.

propertyonRelease
readonly onRelease: (event: PointerCapturePoint): void

Receives the release that ends the capture session.

interfacePointerCapturePointsource ↗
interface PointerCapturePoint

Pointer position normalized to the editor render root's view coordinates.

propertyview
readonly view: { x: number; y: number }
interfaceTextInputHandlerssource ↗
interface TextInputHandlers

Portable text and selection-deletion subscriptions.

propertyonDelete
onDelete?: (): void

Receives a clipboard cut as deletion of the current selection.

propertyonTextInput
onTextInput?: (event: TextInputEvent): void

Receives committed text and composition updates through one ordered stream.

typeTextInputEventsource ↗
type TextInputEvent = { kind: typeof TextInputKind.Text; text: string } | { caretOffset: number; kind: typeof TextInputKind.CompositionUpdate; text: string }

Committed text or an in-flight composition update, including composition clearing.

variableTextInputKindsource ↗
TextInputKind: { CompositionUpdate: "compositionUpdate"; Text: "text" }

Canonical kinds of portable text-input events.

Package

@searsuite/sear-render-metrics

16 exports

Platform-neutral text shaping and glyph measurement contracts.

classRenderContextTextShapersource ↗
class RenderContextTextShaper extends TextShaper

Portable fallback backed by the host's render-neutral text measurements.

constructorconstructor
RenderContextTextShaper(context: RenderContext): RenderContextTextShaper
context: RenderContext
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving the editor-local text-shaper provider.

methodclearCacheinherited
clearCache(): void

Clears all cached shaping results owned by this adapter.

methodshapeinherited
shape(input: TextShapeInput): TextShapeResult

Shapes one homogeneous text run, reusing an identical cached request.

input: TextShapeInput
classTextMeasurementManagersource ↗
class TextMeasurementManager

Owns reusable semantic text measurements for one editor runtime.

constructorconstructor
TextMeasurementManager(textShaper: TextShaper): TextMeasurementManager
textShaper: TextShaper
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the editor-local text measurement manager.

methodclear
clear(): void

Clears semantic measurements without taking ownership of the text shaper.

methodmeasureSpace
measureSpace(font: string): TextShapeResult

Measures one space for a font and reuses the editor-local result.

font: string
classTextShapersource ↗
class TextShaper

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.

constructorconstructor
TextShaper(): TextShaper
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the editor-local text-shaper provider.

methodclearCache
clearCache(): void

Clears all cached shaping results owned by this adapter.

methodshape
shape(input: TextShapeInput): TextShapeResult

Shapes one homogeneous text run, reusing an identical cached request.

input: TextShapeInput
classWebTextShapersource ↗
class WebTextShaper extends TextShaper

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.

constructorconstructor
WebTextShaper(context: WebTextShaperContext): WebTextShaper

Creates a Web text shaper over a host-owned Canvas2D context.

context: WebTextShaperContext
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving the editor-local text-shaper provider.

methodclearCacheinherited
clearCache(): void

Clears all cached shaping results owned by this adapter.

methodshapeinherited
shape(input: TextShapeInput): TextShapeResult

Shapes one homogeneous text run, reusing an identical cached request.

input: TextShapeInput
classWebTextShaperErrorsource ↗
class WebTextShaperError extends SearError

Error raised when a Web text-shaping request cannot be represented by Canvas2D.

constructorconstructor
WebTextShaperError(message: string, details?: SearErrorDetails): WebTextShaperError

Creates a Web text-shaper error with stable diagnostics.

message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: "WEB_TEXT_SHAPER_ERROR"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
interfaceFontDescriptorInputsource ↗
interface FontDescriptorInput

Structured font values supplied by editor configuration and host contexts.

propertyfontFamily
readonly fontFamily: string
propertyfontSize
readonly fontSize: number
interfaceShapedCaretStopsource ↗
interface ShapedCaretStop

A logical caret boundary produced by the shaping implementation.

propertytextOffset
readonly textOffset: number

UTF-16 source-text offset for this caret boundary.

propertyx
readonly x: number

Advance position in the shaped run's logical direction.

interfaceShapedGlyphsource ↗
interface ShapedGlyph

One positioned glyph returned by a text-shaping implementation.

propertycluster
readonly cluster: number

UTF-16 offset of the source text cluster represented by this glyph.

propertyglyphId
readonly glyphId: number
propertyxAdvance
readonly xAdvance: number
propertyxOffset
readonly xOffset: number
propertyyAdvance
readonly yAdvance: number
propertyyOffset
readonly yOffset: number
interfaceShapedTextClustersource ↗
interface ShapedTextCluster

Mapping between source text and the glyph range generated for it.

propertyglyphEnd
readonly glyphEnd: number
propertyglyphStart
readonly glyphStart: number
propertytextEnd
readonly textEnd: number
propertytextStart
readonly textStart: number
interfaceTextShapeInputsource ↗
interface TextShapeInput

Input passed to a text-shaper implementation. Offsets are UTF-16 offsets.

propertydirection
readonly direction?: TextShapeDirection
propertyfeatures
readonly features?: Readonly<Record<string, TextShapeFeatureValue>>

Explicit OpenType feature settings, for example { liga: true, kern: true }.

propertyfont
readonly font: string

Font descriptor understood by the selected shaping implementation.

propertylanguage
readonly language?: string

ISO/BCP language tag, when known.

propertyscript
readonly script?: string

OpenType script tag, when known.

propertytext
readonly text: string
propertyvariations
readonly variations?: Readonly<Record<string, number>>

Variation-axis values for variable fonts, keyed by four-character axis tag.

interfaceTextShapeResultsource ↗
interface TextShapeResult

Engine-neutral result of shaping one homogeneous text run.

propertycaretStops
readonly caretStops: readonly ShapedCaretStop[]
propertyclusters
readonly clusters: readonly ShapedTextCluster[]
propertyfontAscent
readonly fontAscent?: number
propertyfontDescent
readonly fontDescent?: number
propertyfontLineGap
readonly fontLineGap?: number
propertyglyphs
readonly glyphs: readonly ShapedGlyph[]
propertyheight
readonly height: number

Total vertical advance, normally zero for horizontal text.

propertywidth
readonly width: number

Total horizontal advance of the shaped run.

interfaceWebTextShaperContextsource ↗
interface WebTextShaperContext

Native text settings and operations required by the Web adapter.

propertydirection
direction: CanvasDirection
propertyfont
font: string
propertyfontKerning
fontKerning?: CanvasFontKerning
methodmeasureText
measureText(text: string): TextMetrics
text: string
methodrestore
restore(): void
methodsave
save(): void
typeTextShapeDirectionsource ↗
type TextShapeDirection = "ltr" | "rtl"

Direction of a shaped text run in logical document order.

typeTextShapeFeatureValuesource ↗
type TextShapeFeatureValue = boolean | number

OpenType feature value accepted by a text-shaper adapter.

functioncreateFontDescriptorsource ↗
createFontDescriptor(input: FontDescriptorInput): string

Creates the low-level font descriptor consumed by text shaping and rendering.

input: FontDescriptorInput
functioncreateWebTextShaperContextsource ↗
createWebTextShaperContext(renderContext: RenderContext): WebTextShaperContext

Adapts the shared render context to the Web shaper contract.

renderContext: RenderContext

Package

@searsuite/sear-render-node

59 exports

Retained scene nodes, rich-text render registries, and spatial indexing.

classAffixNodesource ↗
class AffixNode<T> extends FixBoxNode<T>

Sticky box node used for row/column headers and other affixed sheet regions.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertysticky
sticky: boolean

Affix nodes render in the sticky strategy instead of the scrolled content layer.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(context: RenderContext): void

Clears this node's bounds from a raster context using stroke padding.

context: RenderContext
Render context to clear.
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(context: RenderContext): void

Draws the node into the hit-test context unless the node is visual-only.

context: RenderContext
Hit render context.
methoddrawSceneinherited
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the box into the visible render context.

context: RenderContext
Render context receiving draw commands.
clipRegion: ClipRegion
Optional rectangle or polygon clipping region.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): AffixNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classAffixTextNodesource ↗
class AffixTextNode<T> extends TextNode<T>

Sticky text node used inside affixed header cells.

constructorconstructor
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: string | RichDocNode
Text or rich-text value to render.
positionRect: PositionRectProps | undefined
Initial node bounds.
properties: Partial<T>
Render properties inherited from the parent cell.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Text draws above the box background by default.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertysticky
sticky: boolean

Affix text renders in the sticky strategy together with its parent.

propertyvalueinherited
readonly value: string | RichDocNode

Text value rendered by this node.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(context: RenderContext): void

Text nodes are cleared through their parent box dirty region.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(context: RenderContext): void

Text nodes do not draw separate hit regions; the parent box owns hit testing.

context: RenderContext
methoddrawSceneinherited
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws text inside the parent node using the parent's alignment and padding.

context: RenderContext
Render context receiving text commands.
clipRegion: ClipRegion
Optional clipping region inherited from render strategies.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): AffixTextNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classBlockManagersource ↗
class BlockManager extends RichTextBlockLayoutProvider

Measures rich-document blocks and produces wrapped rich-text layout lines.

constructorconstructor
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.

textShaper: TextShaper
inlineStyleRegistry: RichTextInlineStyleRegistry
runRenderRegistry: RichTextRunRenderRegistry
lineBoxRegistry: RichTextLineBoxRegistry
baseFont: string
paragraphLayoutDefaults: RichTextParagraphLayoutDefaults
propertymaxWidth
maxWidth: number

Maximum measured unwrapped block width.

propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the rich-document block manager.

methodadd
add(node: RichDocNode): void

Adds a rich document block and records its measured size.

node: RichDocNode
methodcalculateLayout
calculateLayout(width: number): RichTextLine[]

Calculates a flattened list of wrapped rich-text lines for all blocks.

width: number
methodcalculateLayoutPerParagraph
calculateLayoutPerParagraph(width: number): RichTextLine[][]

Calculates wrapped rich-text lines per paragraph while preserving paragraph mapping.

width: number
methodclear
clear(): void

Clears all measured blocks and cached size information.

methodcreateDetached
createDetached(): BlockManager

Creates an unshared measurement workspace for a read-only layout request.

methodenforceCommandBoundary
enforceCommandBoundary(isCommandExecuting: (): boolean): void

Closes direct block writes after the owning editor has assembled.

isCommandExecuting: (): boolean
methodsetBaseFont
setBaseFont(font: string): void

Selects the transient base font used for the next layout pass.

font: string
classBoxNodesource ↗
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.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

Clears state owned by BoxNode.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
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: RenderContext
The rendering context used to draw the hit area.
methoddrawScene
drawScene(context: RenderContext): void

Draws the scene for this node and all its descendants.
This method recursively calls drawScene on all child nodes.

context: RenderContext
The rendering context used to draw the scene.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): BoxNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classBVHsource ↗
class BVH<T> extends Tree<T>

Simple bounding-volume hierarchy spatial index implementation.

constructorconstructor
BVH<T>(): BVH<T>

Constructs a BVH with a broad default world boundary.

propertycapacityinherited
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertyparentinherited
parent: Tree<T> | null

The parent spatial node, or null at the root.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Removes all indexed items.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

methodinsert
insert(data: T): boolean

Inserts one item into the root child list.

data: T
methodquery
query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

range: PositionRect<templateLiteral>
methodremove
remove(data: T): boolean

Removes one item by object identity.

data: T
methodtoJSON
toJSON(): object

Serializes debug data for this spatial index.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the tree boundary and clears indexed items.

boundary: PositionRect<templateLiteral>
classCellVisualLayerNodesource ↗
class CellVisualLayerNode<T> extends RenderNode<T>

Draws a feature-contributed visual between a cell background and its content.

constructorconstructor
CellVisualLayerNode<T>(rect: PositionRectProps, properties: Partial<T>, layer: CellVisualLayer): CellVisualLayerNode<T>
rect: PositionRectProps
properties: Partial<T>
layer: CellVisualLayer
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

Clears state owned by Node.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(): void

Abstract method to draw the node's hit detection representation.
Must be implemented by subclasses.

methoddrawScene
drawScene(context: RenderContext): void

Abstract method to draw the node's scene representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): CellVisualLayerNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classContainersource ↗
class Container extends EventListener<string>

Scene node that owns, queries, and serializes an ordered child collection.

constructorconstructor
Container(): Container

Creates a Container instance.

propertyrandomColorKey
readonly randomColorKey: templateLiteral | null

Unique random color key for hit detection.

memberchildren
children: unknown
methodadd
add(child: Container): this add(children: Container[]): this

Adds the value.

child: Container
children: Container[]
methoddescendants
descendants(): never[]

Iterates every descendant in scene order.

methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): Container

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodquery
query(): void

Returns descendants whose boundaries intersect the supplied rectangle.

methodremove
remove(): void

Removes the value.

methodtoJSON
toJSON(): { }

Serializes this scene structure into diagnostic JSON.

methodupdateBoundary
updateBoundary(): void

Updates the indexed boundary after geometry changes.

classDashedLineNodesource ↗
class DashedLineNode<T> extends RenderNode<T>

Scene node that renders one dashed line segment.

constructorconstructor
DashedLineNode<T>(positionRect: PositionRectProps, props: Partial<T>, line: { x1: number; x2: number; y1: number; y2: number }): DashedLineNode<T>

Constructs a dashed line node.

positionRect: PositionRectProps
Dirty/hit bounds covering the line.
props: Partial<T>
Render properties including stroke and dash pattern.
line: { x1: number; x2: number; y1: number; y2: number }
Exact line segment coordinates.
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

Clears the line bounds with stroke padding.

context: RenderContext
Render context to clear.
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(): void

Dashed lines are visual-only and do not participate in hit testing.

methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the dashed line into the render context.

context: RenderContext
Render context receiving draw commands.
clipRegion: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): DashedLineNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classDirtyTreesource ↗
class DirtyTree

DI token placeholder for the dirty-region spatial index.

constructorconstructor
DirtyTree(): DirtyTree
propertysymbolstatic
readonly symbol: symbol

DI token used to resolve the dirty tree implementation.

classEventListenersource ↗
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.

constructorconstructor
EventListener<CustomEventTypes>(): EventListener<CustomEventTypes>
methodemit
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: CustomEventTypes
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodoff
off(eventString?: CustomEventTypes, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: CustomEventTypes
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodon
on(eventString: CustomEventTypes, handler: Function): EventListener<CustomEventTypes>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: CustomEventTypes
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
classFixBoxNodesource ↗
class FixBoxNode<T> extends RenderNode<T>

Scene node that renders a rectangular box with optional fill, stroke, and clipping.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

Clears this node's bounds from a raster context using stroke padding.

context: RenderContext
Render context to clear.
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(context: RenderContext): void

Draws the node into the hit-test context unless the node is visual-only.

context: RenderContext
Hit render context.
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the box into the visible render context.

context: RenderContext
Render context receiving draw commands.
clipRegion: ClipRegion
Optional rectangle or polygon clipping region.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): FixBoxNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classGenerationalDirtyTrackersource ↗
class GenerationalDirtyTracker

Frame-scoped dirty-region tracker.

A scene mutation may replace several plugins 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.

The class name is retained for DI/API compatibility; its behaviour is no
longer generation-based.

constructorconstructor
GenerationalDirtyTracker(tree: Tree<PositionRect<templateLiteral>>): GenerationalDirtyTracker

Creates a GenerationalDirtyTracker instance.

tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving GenerationalDirtyTracker.

methodclear
clear(): void

Frame-end full cleanup (called by DirtyRenderStrategy.render()).
All items are removed regardless of generation.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the boundary.

methodmark
mark(rect: PositionRect<templateLiteral>): void

Records a region until the current dirty render pass finishes.

rect: PositionRect<templateLiteral>
methodquery
query(range: PositionRect<templateLiteral>): PositionRect<templateLiteral>[]

Returns dirty nodes for the requested render generation.

range: PositionRect<templateLiteral>
classHilbertRTreesource ↗
class HilbertRTree<T> extends Tree<T>

Hilbert-sorted R-tree style spatial index for rectangular data.

constructorconstructor
HilbertRTree<T>(boundary: PositionRect<templateLiteral>, maxChildren?: number): HilbertRTree<T>

Constructs a Hilbert R-tree.

boundary: PositionRect<templateLiteral>
Root spatial boundary.
maxChildren: number
Maximum children retained by the shared tree contract.
propertycapacityinherited
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertyparentinherited
parent: Tree<T> | null

The parent spatial node, or null at the root.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Removes all indexed items.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

methodinsert
insert(data: T): boolean

Inserts one item and maintains Hilbert ordering.

data: T
methodquery
query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

range: PositionRect<templateLiteral>
methodremove
remove(data: T): boolean

Removes an item by matching rectangle bounds.

data: T
methodtoJSON
toJSON(): object

Serializes debug data for this spatial index.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

boundary: PositionRect<templateLiteral>
classHitColorRegistrysource ↗
class HitColorRegistry

Maps hit-canvas color keys back to render nodes.

constructorconstructor
HitColorRegistry(): HitColorRegistry
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the hit-color registry.

methodclear
clear(): void

Clears all registered hit-color mappings.

methoddelete
delete(key: templateLiteral): void

Removes a hit-canvas color key mapping.

key: templateLiteral
methodget
get<T>(key: templateLiteral): Node<T> | undefined

Resolves the node currently associated with a hit-canvas color key.

key: templateLiteral
methodregister
register<T>(key: templateLiteral, node: Node<T>): void

Registers a node for hit-canvas color lookup.

key: templateLiteral
node: Node<T>
classKDTreesource ↗
class KDTree<T> extends Tree<T>

KD-tree spatial index for rectangular scene data.

constructorconstructor
KDTree<T>(boundary?: PositionRect<templateLiteral>, capacity?: number): KDTree<T>

Constructs a KD-tree.

boundary: PositionRect<templateLiteral>
Root spatial boundary.
capacity: number
Retained for the shared Tree contract.
propertycapacityinherited
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertyparentinherited
parent: Tree<T> | null

The parent spatial node, or null at the root.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Removes all indexed items.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

methodinsert
insert(data: T): boolean

Inserts an item by alternating x/y split axes.

data: T
methodquery
query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

range: PositionRect<templateLiteral>
methodremove
remove(data: T): boolean

Removes one item by object identity and rebuilds the experimental tree.

data: T
methodtoJSON
toJSON(): object

Serializes debug data for this spatial index.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

boundary: PositionRect<templateLiteral>
classLayoutNodesource ↗
class LayoutNode<T> extends Node<T>

Abstract class for layout nodes.
Extend this for nodes that manage layout.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(context: RenderContext): void

Clears state owned by Node.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(context: RenderContext): void

Abstract method to draw the node's hit detection representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
methoddrawSceneinherited
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
clipRegion: ClipRegion
Optional clipping region: a PositionRect for axis-aligned rectangular clip,
or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): LayoutNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classNodesource ↗
class Node<T> extends EventListener<string>

Abstract base class for all nodes in the render tree.
Handles geometry, appearance, event management, and hierarchical relationships.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeys
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepth
depth: number

Render and event ordering depth for Node.

propertyname
name: string

Name of the node, defaults to the class name.

propertynodeKey
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKey
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRect
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertyproperties
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKey
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertysticky
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottom
bottom: unknown
memberconfigEngine
configEngine: unknown
memberfill
fill: unknown
memberheight
height: unknown
memberhorizontalAlign
horizontalAlign: unknown
memberleft
left: unknown
memberlineDash
lineDash: unknown
memberright
right: unknown
memberstroke
stroke: unknown
memberstrokeWidth
strokeWidth: unknown
membertop
top: unknown
memberverticalAlign
verticalAlign: unknown
memberwidth
width: unknown
memberx
x: unknown
membery
y: unknown
methodadd
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListener
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntime
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

Clears state owned by Node.

context: RenderContext
methoddispose
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddraw
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(context: RenderContext): void

Abstract method to draw the node's hit detection representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
clipRegion: ClipRegion
Optional clipping region: a PositionRect for axis-aligned rectangular clip,
or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKey
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKey
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): Node<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodquery
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChild
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListener
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTree
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSON
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classOctreesource ↗
class Octree<T> extends Tree<T>

Simple Octree-shaped spatial index for rectangular scene data.

constructorconstructor
Octree<T>(): Octree<T>

Constructs an Octree with a broad default world boundary.

propertycapacityinherited
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertyparentinherited
parent: Tree<T> | null

The parent spatial node, or null at the root.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Removes all indexed items.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

methodinsert
insert(data: T): boolean

Inserts one item into the root child list.

data: T
methodquery
query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

range: PositionRect<templateLiteral>
methodremove
remove(data: T): boolean

Removes one item by object identity.

data: T
methodtoJSON
toJSON(): object

Serializes debug data for this spatial index.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

boundary: PositionRect<templateLiteral>
classQuadTreesource ↗
class QuadTree extends Tree<PositionRect<HexColor>>

QuadTree spatial index used by scene and dirty-region lookups.

constructorconstructor
QuadTree(boundary: PositionRect<templateLiteral>, capacity: number): QuadTree

Constructs a QuadTree node.

boundary: PositionRect<templateLiteral>
Node boundary.
capacity: number
Maximum items before subdivision.
propertybottomleft
bottomleft: QuadTree | null

Bottom-left child node.

propertybottomright
bottomright: QuadTree | null

Bottom-right child node.

propertycapacityinherited
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertydivided
divided: boolean

Whether this node has been subdivided into children.

propertyparentinherited
parent: Tree<PositionRect<templateLiteral>> | null

The parent spatial node, or null at the root.

propertyrects
rects: PositionRect<templateLiteral>[]

Rectangles stored directly in this node.

propertytopleft
topleft: QuadTree | null

Top-left child node.

propertytopright
topright: QuadTree | null

Top-right child node.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Clears all indexed rectangles and child quadrants.

methodcontains
contains(boundary: PositionRect<templateLiteral>, rect: PositionRect<templateLiteral>): boolean

Returns whether boundary fully contains rect.

boundary: PositionRect<templateLiteral>
rect: PositionRect<templateLiteral>
methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the root boundary for this tree node.

methodinsert
insert(data: PositionRect<templateLiteral>): boolean

Inserts a rectangle into the tree.

ReturnsTrue when data intersects this tree boundary.

data: PositionRect<templateLiteral>
Rectangle to index.
methodintersects
intersects(a: PositionRect<templateLiteral>, b: PositionRect<templateLiteral>): boolean

Returns whether two rectangles overlap.

a: PositionRect<templateLiteral>
b: PositionRect<templateLiteral>
methodquery
query(range: PositionRect<templateLiteral>, found?: PositionRect<templateLiteral>[]): PositionRect<templateLiteral>[]

Queries rectangles intersecting a range.

ReturnsMatching rectangles.

range: PositionRect<templateLiteral>
Search rectangle.
found: PositionRect<templateLiteral>[]
Accumulator used during recursion.
methodremove
remove(data: PositionRect<templateLiteral>, predicate?: (rect: PositionRect<templateLiteral>): boolean): boolean

Removes matching rectangle entries.

ReturnsTrue when an entry was removed.

data: PositionRect<templateLiteral>
Rectangle coordinates to remove.
predicate: (rect: PositionRect<templateLiteral>): boolean
Optional predicate for entries with matching bounds.
methodsubdivide
subdivide(): void

Splits this node into four child quadrants and redistributes contained items.

methodtoJSON
toJSON(): object

Serializes debug data for this tree.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and reinserts existing rectangles.

boundary: PositionRect<templateLiteral>
New root boundary.
classQuadTreeFactorysource ↗
class QuadTreeFactory<T> extends TreeFactory<PositionRect<HexColor>>

Factory that creates QuadTree spatial indexes for rectangular scene data.

constructorconstructor
QuadTreeFactory<T>(): QuadTreeFactory<T>
methodcreate
create(boundary: PositionRect<templateLiteral>, capacity: number): QuadTree

Creates a QuadTree.

boundary: PositionRect<templateLiteral>
Root spatial boundary.
capacity: number
Maximum items in a leaf before subdivision.
classRenderNodesource ↗
class RenderNode<T> extends Node<T>

Abstract class for render nodes.
Extend this for nodes that manage rendering.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(context: RenderContext): void

Clears state owned by Node.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(context: RenderContext): void

Abstract method to draw the node's hit detection representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
methoddrawSceneinherited
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
clipRegion: ClipRegion
Optional clipping region: a PositionRect for axis-aligned rectangular clip,
or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RenderNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classRichTextCaretNodesource ↗
class RichTextCaretNode extends RichTextVisualNode

Scene node that draws a rich-text caret.

constructorconstructor
RichTextCaretNode(input: { caret: { height: number; pixelOffset?: number; visible: boolean; x: number; y: number }; depth?: number; nodeKey: string; rect: PositionRectProps; scroll?: { x: number; y: number }; viewportOverlay?: boolean }): RichTextCaretNode

Creates a caret overlay node.

input: { caret: { height: number; pixelOffset?: number; visible: boolean; x: number; y: number }; depth?: number; nodeKey: string; rect: PositionRectProps; scroll?: { x: number; y: number }; viewportOverlay?: boolean }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext): void

Draws the caret when the blink state says it is visible.

context: RenderContext
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextCaretNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classRichTextCompositionNodesource ↗
class RichTextCompositionNode extends RichTextVisualNode

Scene node that draws active IME composing text and underline.

constructorconstructor
RichTextCompositionNode(input: { anchor: { height: number; x: number; y: number }; depth?: number; nodeKey: string; rect: PositionRectProps; scroll?: { x: number; y: number }; text: string; viewportOverlay?: boolean }): RichTextCompositionNode

Creates an IME composition overlay node.

input: { anchor: { height: number; x: number; y: number }; depth?: number; nodeKey: string; rect: PositionRectProps; scroll?: { x: number; y: number }; text: string; viewportOverlay?: boolean }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext): void

Draws composing text in world or viewport coordinates.

context: RenderContext
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextCompositionNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classRichTextContentNodesource ↗
class RichTextContentNode extends RichTextVisualNode

Scene node that draws laid-out rich-text lines in world coordinates.

constructorconstructor
RichTextContentNode(input: { blockIndexes?: readonly number[]; depth?: number; font?: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; nodeKey: string; origin: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }): RichTextContentNode

Creates a rich-text content node from pre-computed layout lines.

input: { blockIndexes?: readonly number[]; depth?: number; font?: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; nodeKey: string; origin: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws every included layout line inside this node's clip.

context: RenderContext
clipRegion: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextContentNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classRichTextLineRenderersource ↗
class RichTextLineRenderer

Paints laid-out rich-text lines by grouping adjacent characters into runs.

constructorconstructor
RichTextLineRenderer(inlineStyles: RichTextInlineStyleRegistry, runRenderer: RichTextRunRenderer): RichTextLineRenderer

Creates a line renderer with domain style comparison and run rendering.

inlineStyles: RichTextInlineStyleRegistry
runRenderer: RichTextRunRenderer
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the line renderer.

methodpaint
paint(context: RenderContext, input: { font?: string; line: RichTextRenderLine; origin: Pick<PositionRectProps, "x" | "y"> }): void

Paints one laid-out line at the supplied world-space origin.

context: RenderContext
input: { font?: string; line: RichTextRenderLine; origin: Pick<PositionRectProps, "x" | "y"> }
classRichTextRunRenderersource ↗
class RichTextRunRenderer

Paints one contiguous rich-text run using the registered render contributions.

constructorconstructor
RichTextRunRenderer(registry: RichTextRunRenderRegistry): RichTextRunRenderer

Creates a run renderer backed by the render contribution registry.

registry: RichTextRunRenderRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the run renderer.

methodpaint
paint(context: RenderContext, input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; height: number; style: Readonly<Record<string, unknown>> | undefined; text: string; width: number; … }): void

Paints one run and restores all renderer state changed by its style plugins.

context: RenderContext
input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; height: number; style: Readonly<Record<string, unknown>> | undefined; text: string; width: number; … }
classRichTextRunRenderRegistrysource ↗
class RichTextRunRenderRegistry

Render-layer registry for plugin-owned rich-text run behavior.

constructorconstructor
RichTextRunRenderRegistry(): RichTextRunRenderRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the rich-text run render registry.

methodapplyRenderState
applyRenderState(context: RenderContext, style: Readonly<Record<string, unknown>> | undefined): void

Applies all registered render-state contributions before text painting.

context: RenderContext
style: Readonly<Record<string, unknown>> | undefined
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void
assertWrite: (): void
methodpaintRun
paintRun(input: RichTextRunPaintInput): void

Paints all registered plugin-owned run details.

input: RichTextRunPaintInput
methodregister
register(contribution: RichTextRunRenderContribution): (): void

Registers one render contribution.

contribution: RichTextRunRenderContribution
methodresolveFont
resolveFont(font: string, style: Readonly<Record<string, unknown>> | undefined): string

Resolves the final font descriptor after all registered contributions run.

font: string
style: Readonly<Record<string, unknown>> | undefined
classRichTextSelectionNodesource ↗
class RichTextSelectionNode extends RichTextVisualNode

Scene node that draws rich-text selection rectangles.

constructorconstructor
RichTextSelectionNode(input: { depth?: number; nodeKey: string; offset?: { x: number; y: number }; rect: PositionRectProps; rects: readonly RichTextSelectionRect[]; viewportOverlay?: boolean }): RichTextSelectionNode

Creates a selection overlay node.

input: { depth?: number; nodeKey: string; offset?: { x: number; y: number }; rect: PositionRectProps; rects: readonly RichTextSelectionRect[]; viewportOverlay?: boolean }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws selection rectangles in world or viewport coordinates.

context: RenderContext
clipRegion: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodgetSelectionRects
getSelectionRects(): readonly RichTextSelectionRect[]

World-space regions where text should be painted above the highlight.

methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextSelectionNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classRichTextVisualNodesource ↗
class RichTextVisualNode extends Node<RichTextRenderNodeProperties>

Base class for rich-text nodes that only draw pixels and do not own hit state.

propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawSceneinherited
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
clipRegion: ClipRegion
Optional clipping region: a PositionRect for axis-aligned rectangular clip,
or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextVisualNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classRTreesource ↗
class RTree<T> extends Tree<T>

Simple R-tree spatial index for rectangular scene data.

constructorconstructor
RTree<T>(): RTree<T>

Constructs an R-tree with a broad default world boundary.

propertycapacityinherited
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertyparentinherited
parent: Tree<T> | null

The parent spatial node, or null at the root.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Removes all indexed items.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

methodinsert
insert(data: T): boolean

Inserts one item into the root child list.

data: T
methodquery
query(range: PositionRect<templateLiteral>): T[]

Returns items whose rectangles intersect the query range.

range: PositionRect<templateLiteral>
methodremove
remove(data: T): boolean

Removes one item by object identity.

data: T
methodtoJSON
toJSON(): object

Serializes debug data for this spatial index.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

boundary: PositionRect<templateLiteral>
classSceneGraphsource ↗
class SceneGraph<T> extends Node<T>

Root scene tree that owns top-level render nodes for each plugin.

constructorconstructor
SceneGraph<T>(container: Container): SceneGraph<T>

Creates a scene graph bound to one editor-local DI runtime.

container: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the scene graph.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodaddPluginNode
addPluginNode(pluginKeyString: string, node: Node<T> | Node<T>[], options?: { markDirty?: boolean }): void

Replaces all scene nodes owned by one plugin.

pluginKeyString: string
Stable plugin key.
node: Node<T> | Node<T>[]
Node or nodes produced by the plugin render method.
options: { markDirty?: boolean }
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

SceneGraph is cleared through strategy-owned dirty regions.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(context: RenderContext): void

SceneGraph is a root container and is not drawn into the hit layer directly.

context: RenderContext
methoddrawScene
drawScene(context: RenderContext): void

SceneGraph is a root container and is not drawn directly.

context: RenderContext
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodmarkRemovePluginNode
markRemovePluginNode(pluginKeyString: string, options?: { markDirty?: boolean }): void

Marks and removes all existing top-level nodes owned by one plugin.

pluginKeyString: string
Stable plugin key.
options: { markDirty?: boolean }
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): SceneGraph<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodreconcilePluginNodes
reconcilePluginNodes(pluginKeyString: string, node: Node<T> | Node<T>[], options?: { markDirty?: boolean; replaceRetainedGeometryChanged?: boolean; replaceRetainedKeys?: ReadonlySet<string>; retainExisting?: boolean; 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.

pluginKeyString: string
node: Node<T> | Node<T>[]
options: { markDirty?: boolean; replaceRetainedGeometryChanged?: boolean; replaceRetainedKeys?: ReadonlySet<string>; retainExisting?: boolean; updateRetainedGeometry?: boolean }
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classSpatialHashsource ↗
class SpatialHash<T> extends Tree<T>

Spatial hash index that buckets rectangular items by their top-left cell.

constructorconstructor
SpatialHash<T>(cellSize?: number, boundary?: PositionRect<templateLiteral>, capacity?: number): SpatialHash<T>

Constructs a spatial hash index.

cellSize: number
Logical size of one hash bucket.
boundary: PositionRect<templateLiteral>
Root spatial boundary.
capacity: number
Retained for the shared Tree contract.
propertycapacityinherited
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertyparentinherited
parent: Tree<T> | null

The parent spatial node, or null at the root.

propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Removes all indexed items.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the current tree boundary.

methodinsert
insert(data: T): boolean

Inserts an item into the bucket containing its top-left corner.

data: T
methodquery
query(range: PositionRect<templateLiteral>): T[]

Returns items in intersecting buckets whose rectangles overlap the query range.

range: PositionRect<templateLiteral>
methodremove
remove(data: T): boolean

Removes one item from its hashed bucket.

data: T
methodtoJSON
toJSON(): object

Serializes debug data for this spatial index.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Replaces the boundary and clears indexed items.

boundary: PositionRect<templateLiteral>
classStickyNodesource ↗
class StickyNode<T> extends BoxNode<T>

Box node specialization reserved for sticky-layer rendering.

constructorconstructor
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.

positionRect: PositionRectProps
props: Partial<T>
Partial properties and position for initialization.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(context: RenderContext): void

Clears state owned by BoxNode.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
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: RenderContext
The rendering context used to draw the hit area.
methoddrawSceneinherited
drawScene(context: RenderContext): void

Draws the scene for this node and all its descendants.
This method recursively calls drawScene on all child nodes.

context: RenderContext
The rendering context used to draw the scene.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): StickyNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classTextNodesource ↗
class TextNode<T> extends RenderNode<T>

Scene node that renders plain text derived from string or rich-text content.

constructorconstructor
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: string | RichDocNode
Text or rich-text value to render.
positionRect: PositionRectProps | undefined
Initial node bounds.
properties: Partial<T>
Render properties inherited from the parent cell.
runtime: Container
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepth
depth: number

Text draws above the box background by default.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

propertyvalue
readonly value: string | RichDocNode

Text value rendered by this node.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidth
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

Text nodes are cleared through their parent box dirty region.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(context: RenderContext): void

Text nodes do not draw separate hit regions; the parent box owns hit testing.

context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws text inside the parent node using the parent's alignment and padding.

context: RenderContext
Render context receiving text commands.
clipRegion: ClipRegion
Optional clipping region inherited from render strategies.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): TextNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classTreesource ↗
class Tree<T>

Shared spatial-index contract. The item shape is owned by each index.

constructorconstructor
Tree<T>(boundary: PositionRect<templateLiteral>, capacity: number): Tree<T>

Creates a Tree instance.

boundary: PositionRect<templateLiteral>
capacity: number
propertycapacity
readonly capacity: number

The maximum number of entries retained by this spatial node.

propertyparent
parent: Tree<T> | null

The parent spatial node, or null at the root.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving Tree.

methodclear
clear(): void

Clears state owned by Tree.

methodgetBoundary
getBoundary(): PositionRect<templateLiteral>

Returns the boundary.

methodinsert
insert(item: T): boolean

Inserts a bounded entry into the spatial index.

item: T
methodquery
query(range: PositionRect<templateLiteral>): T[]

Returns indexed entries whose boundaries intersect the supplied rectangle.

range: PositionRect<templateLiteral>
methodremove
remove(item: T, predicate?: (rect: PositionRect<templateLiteral>): boolean): boolean

Removes the value.

item: T
predicate: (rect: PositionRect<templateLiteral>): boolean
methodtoJSON
toJSON(): object

Serializes this scene structure into diagnostic JSON.

methodupdateBoundary
updateBoundary(boundary: PositionRect<templateLiteral>): void

Updates the indexed boundary after geometry changes.

boundary: PositionRect<templateLiteral>
interfaceCellVisualLabelsource ↗
interface CellVisualLabel

One text label drawn within a feature-contributed visual layer.

propertycolor
readonly color?: string
propertyfill
readonly fill: string
propertytext
readonly text: string
interfaceCellVisualLayersource ↗
interface CellVisualLayer

A visual rectangle, icon or sequence of labels within its cell bounds.

propertyfill
readonly fill?: string | { end: string; start: string }
propertyheight
readonly height: number
propertyicon
readonly icon?: { color: string; level?: number; shape: CellVisualIconShape; totalLevels?: number }
propertylabels
readonly labels?: readonly CellVisualLabel[]

Ordered labels, clipped to the layer bounds without changing the cell value.

propertyshape
readonly shape?: CellVisualLayerShape
propertyslot
readonly slot: string
propertywidth
readonly width: number
propertyx
readonly x: number
propertyy
readonly y: number
interfaceRichTextRenderCharsource ↗
interface RichTextRenderChar

Minimal rich-text character shape consumed by render nodes.

propertychar
readonly char: string
propertystyle
readonly style?: Readonly<Record<string, unknown>>
propertywidth
readonly width: number
interfaceRichTextRunPaintInputsource ↗
interface RichTextRunPaintInput

Geometry and render state for one contiguous rich-text run.

propertybaselineY
readonly baselineY: number
propertycontext
readonly context: RenderContext
propertyfontAscent
readonly fontAscent: number
propertyfontDescent
readonly fontDescent: number
propertyheight
readonly height: number
propertystyle
readonly style: Readonly<Record<string, unknown>> | undefined
propertytext
readonly text: string
propertywidth
readonly width: number
propertyx
readonly x: number
interfaceRichTextRunRenderContributionsource ↗
interface RichTextRunRenderContribution

Plugin-owned render behavior for one inline text-style concern.

propertykey
readonly key: string

Stable contribution key used for duplicate detection and unregister.

methodapplyRenderState
applyRenderState(input: { context: RenderContext; style: Readonly<Record<string, unknown>> | undefined }): void

Applies renderer state before the text run is painted.

input: { context: RenderContext; style: Readonly<Record<string, unknown>> | undefined }
methodpaintRun
paintRun(input: RichTextRunPaintInput): void

Paints plugin-owned details for an already painted text run.

input: RichTextRunPaintInput
methodresolveFont
resolveFont(input: { font: string; style: Readonly<Record<string, unknown>> | undefined }): string

Resolves the font used by shaping and painting for a styled run.

input: { font: string; style: Readonly<Record<string, unknown>> | undefined }
interfaceRichTextSelectionRectsource ↗
interface RichTextSelectionRect

Rectangle highlighted as part of a rich-text selection.

propertyheight
readonly height: number
propertywidth
readonly width: number
propertyx
readonly x: number
propertyy
readonly y: number
interfaceRichTextVisualNodeInputsource ↗
interface RichTextVisualNodeInput

Shared construction options for visual-only rich-text render nodes.

propertyblockId
readonly blockId?: string
propertyblockIndex
readonly blockIndex?: number
propertydepth
readonly depth: number
propertyisEdit
readonly isEdit?: boolean
propertynodeKey
readonly nodeKey: string
propertyrect
readonly rect: PositionRectProps
propertyrenderRole
readonly renderRole: NonNullable<"block" | "line" | "page" | "text-run" | "selection" | "caret" | "composition" | undefined>
propertysemanticRole
readonly semanticRole: string
typeCellVisualIconShapesource ↗
type CellVisualIconShape = typeof CellVisualIconShape[keyof typeof CellVisualIconShape]
typeCellVisualLayerShapesource ↗
type CellVisualLayerShape = typeof CellVisualLayerShape[keyof typeof CellVisualLayerShape]

Primitive shapes available to feature-contributed cell layers.

typeClipRegionsource ↗
type ClipRegion = PositionRect<HexColor> | Point[]

Clip region passed to drawScene.
- PositionRect<HexColor> — axis-aligned rectangle clip (common case).
- Point[] — arbitrary polygon clip; each element is an [x, y] vertex.

typeHitColorKeysource ↗
type HitColorKey = HexColor

Color key used only by hit-canvas rendering and pixel-to-node lookup.

typeNodePropertiessource ↗
type NodeProperties = unknown

Type contract for NodeProperties.

propertybottom
bottom?: number
propertycontentInsetStart
contentInsetStart?: number

Space reserved before projected text for a cell visual.

propertycornerRadius
cornerRadius?: [number, number, number, number]
propertydepth
depth?: number
propertyfill
fill?: string
propertyfitNumberValue
fitNumberValue?: number

Raw General-format number fitted against the actual render width.

propertyhideText
hideText?: boolean

Suppresses projected text while preserving its underlying value.

propertyhorizontalAlign
horizontalAlign?: SheetHorizontalAlignment
propertyisEdit
isEdit?: boolean
propertyleft
left?: number
propertylineDash
lineDash?: number[]
propertynodeKey
nodeKey?: RenderNodeKey

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.

propertyoverlayClipRect
overlayClipRect?: PositionRectProps

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).

propertyright
right?: number
propertysemanticOwner
semanticOwner?: string

Stable semantic ownership exposed by retained render targets.

propertysemanticRole
semanticRole?: string

Stable semantic role exposed by retained render targets.

propertyshouldBeClipInDirtyRender
shouldBeClipInDirtyRender?: boolean

Business marker: true when selection represents a whole row or whole column range.
Dirty render may use this to choose a different redraw shape.

propertyskipHit
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.

propertystroke
stroke?: string
propertystrokeWidth
strokeWidth?: number
propertytextColor
textColor?: string

Foreground color used by text-rendering nodes.

propertytextFillCharacter
textFillCharacter?: string

Character repeated to fill the remaining inline width of formatted text.

propertytop
top?: number
propertyverticalAlign
verticalAlign?: SheetVerticalAlignment
typeRenderNodeKeysource ↗
type RenderNodeKey = string

Stable key used by SceneGraph, Tree and DataStorage to identify render nodes.

typeRichTextBlockIdsource ↗
type RichTextBlockId = string

Stable rich-text block identifier.

variableCellVisualIconShapesource ↗
CellVisualIconShape: { Bar: "bar"; Check: "check"; Circle: "circle"; Cross: "cross"; Diamond: "diamond"; Down: "down"; Flag: "flag"; Right: "right"; … }
variableCellVisualLayerShapesource ↗
CellVisualLayerShape: { Rectangle: "rectangle"; TopLeftTriangle: "topLeftTriangle" }

Primitive shapes available to feature-contributed cell layers.

functioncreateDragGuideNodesource ↗
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.

line: { x1: number; x2: number; y1: number; y2: number }
properties: Partial<T>
functioncreateRichTextRunRectsource ↗
createRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>

Creates a world-space rectangle for one rich-text line/run.

x: number
baselineY: number
width: number
height: number
fontAscent: number
classRichTextBlockNodesource ↗
class RichTextBlockNode extends RichTextVisualNode

Scene node that indexes and draws one top-level rich-text block.

constructorconstructor
RichTextBlockNode(input: { block: { id: string; index: number }; font: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; origin?: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }): RichTextBlockNode

Creates a block-level rich-text scene node.

input: { block: { id: string; index: number }; font: string; lineRenderer: RichTextLineRenderer; lines: readonly RichTextRenderLine[]; origin?: Pick<PositionRectProps, "x" | "y">; rect: PositionRectProps }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws all visible text runs inside this block.

context: RenderContext
clipRegion: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextBlockNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

typeRichTextInlineStylesource ↗
type RichTextInlineStyle = Readonly<Record<string, unknown>>

Domain-neutral inline style bag carried by measured rich-text chars.

interfaceRichTextRenderLinesource ↗
interface RichTextRenderLine

Minimal layout-line shape consumed by rich-text render nodes.

propertychars
readonly chars: readonly RichTextRenderChar[]
propertycharStartOffset
readonly charStartOffset: number
propertycursorXOffsets
readonly cursorXOffsets?: readonly number[]
propertyfontAscent
readonly fontAscent: number
propertyheight
readonly height: number
propertytextNodePath
readonly textNodePath: readonly number[]
propertyx
readonly x: number
propertyy
readonly y: number
interfaceRichTextRenderNodePropertiessource ↗
interface RichTextRenderNodeProperties extends NodeProperties

Render-node properties used by rich-text scene graphs.

propertyblockId
readonly blockId?: string

Stable top-level rich-text block id.

propertyblockIndex
readonly blockIndex?: number

Top-level rich-text block index.

propertybottominherited
bottom?: number
propertycontentInsetStartinherited
contentInsetStart?: number

Space reserved before projected text for a cell visual.

propertycornerRadiusinherited
cornerRadius?: [number, number, number, number]
propertydepthinherited
depth?: number
propertyfillinherited
fill?: string
propertyfitNumberValueinherited
fitNumberValue?: number

Raw General-format number fitted against the actual render width.

propertyhideTextinherited
hideText?: boolean

Suppresses projected text while preserving its underlying value.

propertyhorizontalAligninherited
horizontalAlign?: SheetHorizontalAlignment
propertyisEditinherited
isEdit?: boolean
propertyleftinherited
left?: number
propertylineDashinherited
lineDash?: number[]
propertylineIndex
readonly lineIndex?: number

Layout line index inside the full rich-text snapshot.

propertynodeKeyinherited
nodeKey?: string

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.

propertyoverlayClipRectinherited
overlayClipRect?: PositionRectProps

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).

propertyrenderRole
readonly renderRole?: "block" | "line" | "page" | "text-run" | "selection" | "caret" | "composition"

Semantic role for rich-text render nodes.

propertyrightinherited
right?: number
propertysemanticOwnerinherited
semanticOwner?: string

Stable semantic ownership exposed by retained render targets.

propertysemanticRoleinherited
semanticRole?: string

Stable semantic role exposed by retained render targets.

propertyshouldBeClipInDirtyRenderinherited
shouldBeClipInDirtyRender?: boolean

Business marker: true when selection represents a whole row or whole column range.
Dirty render may use this to choose a different redraw shape.

propertyskipHitinherited
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.

propertystrokeinherited
stroke?: string
propertystrokeWidthinherited
strokeWidth?: number
propertytextColorinherited
textColor?: string

Foreground color used by text-rendering nodes.

propertytextFillCharacterinherited
textFillCharacter?: string

Character repeated to fill the remaining inline width of formatted text.

propertytopinherited
top?: number
propertyverticalAligninherited
verticalAlign?: SheetVerticalAlignment
classRichTextRunNodesource ↗
class RichTextRunNode extends RichTextVisualNode

Scene node that draws one contiguous styled rich-text run in world coordinates.

constructorconstructor
RichTextRunNode(input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; properties: Partial<RichTextRenderNodeProperties>; rect: PositionRectProps; runRenderer: RichTextRunRenderer; style?: Readonly<Record<string, unknown>>; … }): RichTextRunNode

Creates a text-run scene node.

input: { baselineY: number; font: string; fontAscent: number; fontDescent: number; properties: Partial<RichTextRenderNodeProperties>; rect: PositionRectProps; runRenderer: RichTextRunRenderer; style?: Readonly<Record<string, unknown>>; … }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Draws the text run into the active world-space transform.

context: RenderContext
clipRegion: ClipRegion
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): RichTextRunNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classViewportOverlayNodesource ↗
class ViewportOverlayNode extends RichTextVisualNode

Viewport overlay node that draws transient UI under an identity transform.

constructorconstructor
ViewportOverlayNode(input: { depth?: number; drawOverlay: (context: RenderContext): void; nodeKey: string; rect: PositionRectProps; role?: "selection" | "caret" }): ViewportOverlayNode

Creates a viewport overlay render node.

input: { depth?: number; drawOverlay: (context: RenderContext): void; nodeKey: string; rect: PositionRectProps; role?: "selection" | "caret" }
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
add(child: Node<RichTextRenderNodeProperties>): Node<RichTextRenderNodeProperties> add(children: Node<RichTextRenderNodeProperties>[]): Node<RichTextRenderNodeProperties>

Implements the single-node and multiple-node add overloads.

ReturnsThe current node (for chaining).

child: Node<RichTextRenderNodeProperties>
The child node to add.
children: Node<RichTextRenderNodeProperties>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclearinherited
clear(_context: RenderContext): void

Rich-text visual node pixels are cleared by strategy-owned dirty rectangles.

_context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHitinherited
drawHit(_context: RenderContext): void

Rich-text visual nodes are ignored by hit testing unless a subclass opts in.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext): void

Draws overlay content; the node owns transform isolation for viewport-space plugins.

context: RenderContext
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<RichTextRenderNodeProperties> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): ViewportOverlayNode

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<RichTextRenderNodeProperties>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<RichTextRenderNodeProperties>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

Package

@searsuite/sear-render-registry

36 exports

Editor-local registries that connect cell types and Sheet state to renderers.

classAffixCellsource ↗
class AffixCell extends Cell<CellProperties<string | number | null | SheetDocumentNode>>

Rendering-only cell used for fixed row/column header affixes.

constructorconstructor
AffixCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): AffixCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: symbol

Built-in affix cell type symbol.

methodgetDisplayText
getDisplayText(): string

Returns plain display text for numeric/string labels and rich header content.

methodrender
render(): Node<CellProperties<string | number | Schema | null>> | Node<CellProperties<string | number | Schema | null>>[]

Renders the affix background and optional text content.

classBooleanCellsource ↗
class BooleanCell extends Cell<CellProperties<boolean>>

Draws a persisted logical cell using spreadsheet TRUE/FALSE labels.

constructorconstructor
BooleanCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): BooleanCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: typeof symbol
methodgetDisplayText
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.

methodrender
render(): Node<CellProperties<boolean>> | Node<CellProperties<boolean>>[]

Renders Cell scene output.

classCellsource ↗
class Cell<T>

Base render node for a projected Sheet cell.

constructorconstructor
Cell<T>(data: T, positionRect: PositionRectProps, properties: T, context?: CellContext): Cell<T>

Creates a Cell instance.

data: T
positionRect: PositionRectProps
properties: T
context: CellContext
propertycontext
readonly context: CellContext
propertydata
readonly data: T
propertypositionRect
readonly positionRect: PositionRectProps
propertyproperties
readonly properties: T
methodgetDisplayText
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.

methodrender
render(): Node<T> | Node<T>[]

Renders Cell scene output.

classEditorCellsource ↗
class EditorCell extends Cell<CellProperties<SheetDocumentNode[]>>

Rendering-only cell used by the inline rich-text editor overlay.

constructorconstructor
EditorCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EditorCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: symbol

Built-in editor cell type symbol.

methodgetDisplayText
getDisplayText(): string

Extracts plain text from the editor document.

methodrender
render(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]

Renders editor content, marking edit-mode nodes as overlay content when needed.

classEmbeddedEditorRenderNodesource ↗
class EmbeddedEditorRenderNode<T> extends RenderNode<T>

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.

constructorconstructor
EmbeddedEditorRenderNode<T>(document: readonly Schema[], positionRect: { height: number; width: number; x: number; y: number }, properties: T, editSession?: SheetEditSession, editRenderOptions?: SheetEditRenderOptions): EmbeddedEditorRenderNode<T>
document: readonly Schema[]
positionRect: { height: number; width: number; x: number; y: number }
properties: T
editSession: SheetEditSession
editRenderOptions: SheetEditRenderOptions
propertychildKeysinherited
readonly childKeys: string[]

Keys of direct child nodes registered via add(), used for recursive cleanup.

propertydepthinherited
depth: number

Render and event ordering depth for Node.

propertynameinherited
name: string

Name of the node, defaults to the class name.

propertynodeKeyinherited
readonly nodeKey: string

Stable key used by SceneGraph, DataStorage and spatial indexes.

propertyparentKeyinherited
parentKey: string | null

Parent node's stable render key, used for tree relationships.

propertypositionRectinherited
readonly positionRect: PositionRect<string>

Rectangle representing the node's position and size.

propertypropertiesinherited
properties: Partial<T>

Visual and geometric properties of the node.

propertyrandomColorKeyinherited
readonly randomColorKey: templateLiteral | null

Unique random color key used for hit detection.

propertystickyinherited
sticky: boolean

Whether this node remains fixed while its scroll container moves.

memberbottominherited
bottom: unknown
memberconfigEngineinherited
configEngine: unknown
memberfillinherited
fill: unknown
memberheightinherited
height: unknown
memberhorizontalAligninherited
horizontalAlign: unknown
memberleftinherited
left: unknown
memberlineDashinherited
lineDash: unknown
memberrightinherited
right: unknown
memberstrokeinherited
stroke: unknown
memberstrokeWidthinherited
strokeWidth: unknown
membertopinherited
top: unknown
memberverticalAligninherited
verticalAlign: unknown
memberwidthinherited
width: unknown
memberxinherited
x: unknown
memberyinherited
y: unknown
methodaddinherited
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: Node<T>
The child node to add.
children: Node<T>[]
methodaddEventListenerinherited
addEventListener(type: string, handler: Function): void

Adds an event listener for the specified event type.

type: string
The event type to listen for.
handler: Function
The function to handle the event.
methodbindRuntimeinherited
bindRuntime(container: Container): void

Binds this node tree to the editor-local services owned by one SceneGraph.

container: Container
methodclear
clear(context: RenderContext): void

Clears state owned by Node.

context: RenderContext
methoddisposeinherited
dispose(): void

Disposes this node and all of its descendants recursively.
Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.

methoddrawinherited
draw(sceneContext: RenderContext, hitContext: RenderContext): void

Draws the node in both the scene and hit detection contexts.

sceneContext: RenderContext
The context for scene rendering.
hitContext: RenderContext
The context for hit detection rendering.
methoddrawHit
drawHit(_context: RenderContext): void

Rich-text content is visual-only; the cell box owns hit detection.

_context: RenderContext
methoddrawScene
drawScene(context: RenderContext, clipRegion?: ClipRegion): void

Abstract method to draw the node's scene representation.
Must be implemented by subclasses.

context: RenderContext
The rendering context.
clipRegion: ClipRegion
Optional clipping region: a PositionRect for axis-aligned rectangular clip,
or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.
methodemitinherited
emit(eventString: string, ...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: string
The name of the event to trigger.
args: unknown[]
Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): void

Closes registration changes after an owning runtime has assembled.

assertWrite: (): void
teardownToken: object
methodgetNodeByNodeKeyinherited
getNodeByNodeKey(key: string): Node<T> | null

Finds a node by its stable render-node key.

ReturnsThe node if found, otherwise null.

key: string
The stable render node key.
methodgetNodeByRandomColorKeyinherited
getNodeByRandomColorKey(key: templateLiteral): Node<T> | null

Finds a node by its random color key.

ReturnsThe node if found, otherwise null.

key: templateLiteral
The random color key to search for.
methodoffinherited
off(eventString?: string, handler?: Function): void

Removes event handlers for a specific event or all events.

eventString: string
The name of the event to remove handlers for. If not provided, all event handlers are removed.
handler: Function
methodoninherited
on(eventString: string, handler: Function): EmbeddedEditorRenderNode<T>

Registers an event handler for a specific event.

ReturnsThe current instance to allow method chaining.

eventString: string
The name of the event to listen for.
handler: Function
The function to be called when the event is triggered.
methodqueryinherited
query(range: PositionRect<templateLiteral>): Node<T>[]

Queries all nodes within a given rectangular range.

ReturnsAn array of nodes found within the range.

range: PositionRect<templateLiteral>
The rectangle to query.
methodremoveChildinherited
removeChild(child: Node<T>): void

Removes a child node from this node and disposes its entire subtree.

child: Node<T>
methodremoveEventListenerinherited
removeEventListener(type: string): void

Removes an event listener for the specified event type.

type: string
The event type to remove.
methodsetStickyTreeinherited
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): this

Marks this node tree as sticky and applies the supplied affix axes to every descendant.

sticky: boolean
affix: Pick<NodeProperties, "top" | "left">
methodtoJSONinherited
toJSON(): { }

Converts the node and its properties to a JSON object.
Can be extended to recursively serialize children.

classEmptyCellsource ↗
class EmptyCell extends Cell<CellProperties<null>>

Renderer for empty persisted cells and active empty editor cells.

constructorconstructor
EmptyCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EmptyCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: symbol

Built-in empty cell type symbol.

methodgetDisplayText
getDisplayText(): string

Empty cells have no display text.

methodrender
render(): Node<CellProperties<null>> | Node<CellProperties<null>>[]

Renders an empty box or editable rich-text placeholder.

classFormulaCellsource ↗
class FormulaCell extends Cell<CellProperties<string>>

Renders the calculated projection of a formula cell.

constructorconstructor
FormulaCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): FormulaCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: symbol

DI token for resolving FormulaCell.

methodgetDisplayText
getDisplayText(): string

Returns the display text.

methodrender
render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]

Renders FormulaCell scene output.

classNodeFactorysource ↗
class NodeFactory<NodeType>

Factory contract for creating renderable cell/node instances by data type.

constructorconstructor
NodeFactory<NodeType>(): NodeFactory<NodeType>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the active node factory.

methodcreate
create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeType

Creates a node instance for typed data.

ReturnsCreated node instance.

data: DataType
Persisted or rendering-only cell data.
positionRect: PositionRectProps
Node bounds.
properties: Properties
Render properties passed to the node.
context: CellContext
Optional cell rendering context.
methodregister
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: string | symbol
Type identifier used by incoming data.
ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeType
Constructor used to create the node.
classNumberCellsource ↗
class NumberCell extends Cell<CellProperties<number>>

Renders a persisted numeric value without converting its storage type to text.

constructorconstructor
NumberCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): NumberCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: symbol

DI token for resolving NumberCell.

methodgetDisplayText
getDisplayText(): string

Returns the display text.

methodrender
render(): Node<CellProperties<number>> | Node<CellProperties<number>>[]

Renders NumberCell scene output.

classRenderCoordinatorManagersource ↗
class RenderCoordinatorManager

Coordinates cell creation and rendering for a concrete renderer registry.

constructorconstructor
RenderCoordinatorManager(): RenderCoordinatorManager
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the active render coordinator manager.

methodcreate
create<T>(): T

Creates a cell instance from registered type metadata.

methodregisterRenderer
registerRenderer(): void

Registers renderer functions supported by the coordinator.

methodregisterType
registerType(): void

Registers cell/node types supported by the coordinator.

methodrender
render<T>(): Node<T> | Node<T>[]

Renders an already-created cell or node.

methodrenderCell
renderCell<T>(): Node<T> | Node<T>[]

Creates and renders a cell from type and render properties.

classRendererRegistrysource ↗
class RendererRegistry<RegistryProperties>

Registry contract for mapping typed render inputs to scene nodes.

constructorconstructor
RendererRegistry<RegistryProperties>(): RendererRegistry<RegistryProperties>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the active renderer registry.

methodregisterRenderer
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: unknown
Type identifier owned by the cell or feature domain.
rendererFn: (input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]
Function that converts input into scene nodes.
methodrender
render(input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]

Renders a registered input.

ReturnsScene node or nodes produced by the registered renderer.

input: unknown
Input accepted by the concrete registry implementation.
classRichTextCellsource ↗
class RichTextCell extends Cell<CellProperties<SheetDocumentNode[]>>

Renderer for persisted rich-text cell values.

constructorconstructor
RichTextCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): RichTextCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: symbol

Built-in rich-text cell type symbol.

methodgetDisplayText
getDisplayText(): string

Extracts plain text from the rich-text document.

methodrender
render(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]

Renders a rich-text document inside the cell bounds.

classSheetCellVisualReaderErrorsource ↗
class SheetCellVisualReaderError extends SearError

Public error raised for invalid Sheet cell visual-reader contributions.

constructorconstructor
SheetCellVisualReaderError(code: SheetCellVisualReaderErrorCode, message: string, details?: SearErrorDetails): SheetCellVisualReaderError
code: SheetCellVisualReaderErrorCode
message: string
details: SearErrorDetails
propertycauseinherited
cause?: unknown
propertycode
readonly code: SheetCellVisualReaderErrorCode

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classSheetCellVisualReaderRegistrysource ↗
class SheetCellVisualReaderRegistry

Composes editor-local, plugin-owned visual properties for Sheet cells.

constructorconstructor
SheetCellVisualReaderRegistry(): SheetCellVisualReaderRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for the editor-local registry.

methoddestroy
destroy(): void

Removes all editor-local reader registrations.

methodnextConditionalPriority
nextConditionalPriority(): number

Allocates an order after every registered conditional rule owner.

methodread
read(position: SheetCellVisualReadPosition): Partial<CellProperties>

Reads and combines every registered visual contribution for one cell.

position: SheetCellVisualReadPosition
methodreadVisual
readVisual(position: SheetCellVisualReadPosition): { layers: readonly CellVisualLayer[]; properties: Partial<CellProperties> }

Composes base properties, matched rules and visual layers in one pass.

position: SheetCellVisualReadPosition
methodregister
register(reader: SheetCellVisualReader): (): void

Registers one reader and rejects duplicate ids or property ownership.

reader: SheetCellVisualReader
methodregisterConditional
registerConditional(reader: SheetCellConditionalVisualReader): (): void

Registers a rule source whose matches are composed across feature plugins.

reader: SheetCellConditionalVisualReader
methodregisterOverride
registerOverride(reader: SheetCellVisualOverride): (): void

Registers explicit-priority overrides without acquiring base property ownership.

reader: SheetCellVisualOverride
classSheetNodeFactorysource ↗
class SheetNodeFactory extends NodeFactory<Cell<CellProperties<unknown>>>

Default NodeFactory implementation for sheet cells.

constructorconstructor
SheetNodeFactory(): SheetNodeFactory
methodcreate
create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>

Creates a registered sheet cell instance.

ReturnsCreated Cell instance.

data: DataType
Cell data carrying a type identifier.
positionRect: PositionRectProps
Cell bounds.
properties: Properties
Render properties.
context: CellContext
Optional cell rendering context.
methodregister
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: string | symbol
Cell type identifier.
ctor: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>
Cell constructor used to create render cells.
classSheetRenderCoordinatorManagersource ↗
class SheetRenderCoordinatorManager

Coordinates cell projection and rendering for a Sheet frame.

constructorconstructor
SheetRenderCoordinatorManager(nodeFactory: SheetNodeFactory, rendererRegistry: SheetRendererRegistry<CellProperties>, formulaResultProvider: IFormulaResultProvider, platform?: Platform | undefined, cellFormatLocaleProvider?: ICellFormatLocaleProvider): SheetRenderCoordinatorManager

Creates a SheetRenderCoordinatorManager instance.

nodeFactory: SheetNodeFactory
rendererRegistry: SheetRendererRegistry<CellProperties>
formulaResultProvider: IFormulaResultProvider
platform: Platform | undefined
cellFormatLocaleProvider: ICellFormatLocaleProvider
propertynodeFactory
readonly nodeFactory: SheetNodeFactory
propertyrendererRegistry
readonly rendererRegistry: SheetRendererRegistry<CellProperties>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving SheetRenderCoordinatorManager.

methodcreate
create<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Cell<T> | undefined

Creates the value.

data: T
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
methodcreateCellContext
createCellContext(row?: number, col?: number): CellContext

Builds the explicit, read-only context shared by render and measurement paths.

row: number
col: number
methodregisterCell
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.

type: string | symbol
ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>
methodregisterRenderer
registerRenderer<T>(type: T["type"], renderer: <U>(cell: Cell<U>): Node<CellProperties> | Node<CellProperties>[]): (): void

Registers the renderer.

type: T["type"]
renderer: <U>(cell: Cell<U>): Node<CellProperties> | Node<CellProperties>[]
methodregisterStoredValueValidator
registerStoredValueValidator(type: string | symbol, validator: (cell: CellProperties): boolean): (): void

Registers the stored value validator.

type: string | symbol
validator: (cell: CellProperties): boolean
methodregisterType
registerType<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): void

Registers the type.

type: string | symbol
ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>
methodrender
render<T>(cell: Cell<T>): Node<CellProperties> | Node<CellProperties>[]

Renders SheetRenderCoordinatorManager scene output.

cell: Cell<T>
methodrenderCell
renderCell<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Node<CellProperties> | Node<CellProperties>[]

Projects and renders one visible Sheet cell.

data: T
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
classSheetRendererRegistrysource ↗
class SheetRendererRegistry<RegistryProperties> extends RendererRegistry<RegistryProperties>

Renderer registry for sheet cell instances.

constructorconstructor
SheetRendererRegistry<RegistryProperties>(): SheetRendererRegistry<RegistryProperties>
propertysymbolstaticinherited
readonly symbol: symbol

DI token for resolving the active renderer registry.

methodregisterRenderer
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: string | symbol
Cell type identifier.
rendererFn: <T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]
Function that renders matching cell instances.
methodrender
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<T>
Cell instance to render.
classStringCellsource ↗
class StringCell extends Cell<CellProperties<string>>

Renderer for persisted plain-string cell values.

constructorconstructor
StringCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): StringCell

Creates a Cell instance.

data: CellProperties
positionRect: PositionRectProps
properties: CellProperties
context: CellContext
propertycontextinherited
readonly context: CellContext
propertydatainherited
readonly data: CellProperties
propertypositionRectinherited
readonly positionRect: PositionRectProps
propertypropertiesinherited
readonly properties: CellProperties
propertysymbolstatic
readonly symbol: symbol

Built-in string cell type symbol.

methodgetDisplayText
getDisplayText(): string

Returns the stored string value for measurement and formula display.

methodrender
render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]

Renders text content inside a standard cell box.

interfaceCellContextsource ↗
interface CellContext

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.

propertycellFormatLocale
cellFormatLocale?: CellFormatLocale

Sheet-local defaults for formatting numbers and date/time serials.

propertycol
col?: number

Current cell column index (0-based); optional for non-grid cells.

propertyformulaResultProvider
formulaResultProvider?: IFormulaResultProvider

Read-only access to derived formula results; optional when formulas are disabled.

propertyrow
row?: number

Current cell row index (0-based); optional for non-grid cells.

interfaceSheetCellConditionalVisualsource ↗
interface SheetCellConditionalVisual

One matched conditional rule; higher priority wins for overlapping properties and layer slots.

propertyid
readonly id: string
propertylayers
readonly layers?: readonly CellVisualLayer[]
propertypriority
readonly priority: number
propertyproperties
readonly properties?: Readonly<Partial<CellProperties>>
interfaceSheetCellConditionalVisualReadersource ↗
interface SheetCellConditionalVisualReader
propertyid
readonly id: string
propertyproperties
readonly properties: readonly "value" | "type" | unknown | "region" | "format" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]
methodread
read(position: SheetCellVisualReadPosition): readonly SheetCellConditionalVisual[]
position: SheetCellVisualReadPosition
methodreadHighestPriority
readHighestPriority(): number

Reads the owner's current rule order after staged transactions commit.

interfaceSheetCellVisualOverridesource ↗
interface SheetCellVisualOverride extends SheetCellVisualReader

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.

propertyidinherited
readonly id: string
propertypriority
readonly priority: number
propertypropertiesinherited
readonly properties: readonly "value" | "type" | unknown | "region" | "format" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]
methodreadinherited
read(position: SheetCellVisualReadPosition): Readonly<Partial<CellProperties>>
position: SheetCellVisualReadPosition
interfaceSheetCellVisualReadersource ↗
interface SheetCellVisualReader

Plugin-owned reader declaring exclusive ownership of base visual properties.

propertyid
readonly id: string
propertyproperties
readonly properties: readonly "value" | "type" | unknown | "region" | "format" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]
methodread
read(position: SheetCellVisualReadPosition): Readonly<Partial<CellProperties>>
position: SheetCellVisualReadPosition
interfaceSheetCellVisualReaderRegistrationContextsource ↗
interface SheetCellVisualReaderRegistrationContext

Minimal configuration access available while plugins register visual readers.

methodreadDefaultConfig
readDefaultConfig(): Readonly<Record<string, unknown>>
interfaceSheetCellVisualReadPositionsource ↗
interface SheetCellVisualReadPosition

Coordinates supplied to one visual reader for a rendered Sheet cell.

propertycolumnIndex
readonly columnIndex: number
propertyrowIndex
readonly rowIndex: number
typeCellPropertiessource ↗
type CellProperties = NodeProperties & { endColIndex?: number; endRowIndex?: number; format?: unknown; isEdit?: boolean; region?: CellRegion; startColIndex?: number; startRowIndex?: number; type: string | symbol; … }

Type contract for CellProperties.

typeCellRegionsource ↗
type CellRegion = typeof CellRegion[keyof typeof CellRegion]

Type contract for CellRegion.

typeCellRenderTypesource ↗
type CellRenderType = typeof CellRenderType[keyof typeof CellRenderType]

Type contract for CellRenderType.

typeSheetCellVisualLayersource ↗
type SheetCellVisualLayer = CellVisualLayer

A rectangle positioned within a cell using fractions of its width and height.

typeSheetCellVisualReaderErrorCodesource ↗
type SheetCellVisualReaderErrorCode = typeof SheetCellVisualReaderErrorCode[keyof typeof SheetCellVisualReaderErrorCode]

Stable failure codes exposed by SheetCellVisualReaderRegistry.

variableCellRegionsource ↗
CellRegion: { ColumnHeader: "column-header"; Corner: "corner"; Grid: "grid"; RowHeader: "row-header" }

Well-known regions used by sheet cells and their interaction handlers.

Keep this as a runtime value as well as a type so producers and consumers
share the same identifiers instead of duplicating string literals.

variableCellRenderTypesource ↗
CellRenderType: { Affix: "affix"; Editor: "rich_text" }

Built-in rendering-only cell roles that are not persisted sheet values.

variableSheetCellVisualReaderErrorCodesource ↗
SheetCellVisualReaderErrorCode: { DuplicateReader: "SHEET_CELL_VISUAL_READER_DUPLICATE_READER"; InvalidPriority: "SHEET_CELL_VISUAL_READER_INVALID_PRIORITY"; OverrideConflict: "SHEET_CELL_VISUAL_READER_OVERRIDE_CONFLICT"; PropertyConflict: "SHEET_CELL_VISUAL_READER_PROPERTY_CONFLICT"; UndeclaredProperty: "SHEET_CELL_VISUAL_READER_UNDECLARED_PROPERTY" }

Stable failure codes exposed by SheetCellVisualReaderRegistry.

functionextractRichTextsource ↗
extractRichText(value: unknown): string

Extracts plain text from persisted rich-text content.

value: unknown
functionformatFormulaValuesource ↗
formatFormulaValue(value: unknown): string

Formats formula results consistently for rendering and measurement.

value: unknown
interfaceIFormulaResultProvidersource ↗
interface IFormulaResultProvider

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.

methodforEachFormulaResultInRange
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.

startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (row: number, column: number): void
methodgetFormulaResult
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: number
Row index (0-based).
col: number
Column index (0-based).

Package

@searsuite/sear-render-scroll

18 exports

Logical scrolling, axis locking, boundary feedback, and host scroller adapters.

classHeadlessScrollersource ↗
class HeadlessScroller extends Scroller

Scroller adapter for hosts that have no native scroll surface.

constructorconstructor
HeadlessScroller(): HeadlessScroller

Constructs a scroller adapter.

propertyconfigEngineinherited
readonly configEngine: ConfigEngine

Configuration engine available to concrete scroller adapters.

propertyContainerSymbolstaticinherited
readonly ContainerSymbol: symbol

DI token used by hosts that provide a scroller container.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessScroller.

methodgetPublisher
getPublisher(): ScrollPublisher

Returns the publisher.

classRubberBandConfigErrorsource ↗
class RubberBandConfigError extends SearError

Stable public error raised for invalid rubber-band physics configuration.

constructorconstructor
RubberBandConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): RubberBandConfigError

Creates a SearError instance.

message: string
details: SearErrorDetails
options: ErrorOptions
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_SCROLL_INVALID_RUBBER_BAND_CONFIG"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classRubberBandControllersource ↗
class RubberBandController

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 once boundary input settles.

constructorconstructor
RubberBandController(platform: Platform, publishOffset: (offset: RubberBandOffset): void): RubberBandController

Creates one controller and publishes every visual displacement change.

platform: Platform
publishOffset: (offset: RubberBandOffset): void
methodconfigure
configure(config: Partial<RubberBandConfig>): void

Applies validated host overrides and resets immediately when disabled.

config: Partial<RubberBandConfig>
methodconsume
consume(input: RubberBandInput): RubberBandOffset

Consumes one wheel or touch sample and returns a clamped logical position.
Reversing direction first consumes existing excess before logical scrolling resumes.

input: RubberBandInput
methodgetOffset
getOffset(): RubberBandOffset

Returns a copy of the current transient visual displacement.

methodrelease
release(delay?: number, preserveVelocity?: boolean): void

Starts the boundary return after the configured input-settle delay.

delay: number
preserveVelocity: boolean
methodreset
reset(): void

Cancels pending work and restores the exact zero-displacement state.

classScrollAxisLocksource ↗
class ScrollAxisLock

Locks a continuous input gesture to its first dominant axis.

constructorconstructor
ScrollAxisLock(): ScrollAxisLock
methodconfigure
configure(config: Partial<ScrollAxisLockConfig>): void

Applies validated host overrides and resets an in-progress gesture.

config: Partial<ScrollAxisLockConfig>
methodconsume
consume(x: number, y: number): { x: number; y: number }

Filters one two-dimensional input sample through the active direction lock.

x: number
y: number
methodgetAxis
getAxis(): ScrollAxis | null

Returns the currently selected axis, or null before activation.

methodgetWheelEndDelay
getWheelEndDelay(): number

Returns the configured wheel gesture-end delay.

methodreset
reset(): void

Ends the current gesture and clears uncommitted sub-threshold input.

classScrollAxisLockConfigErrorsource ↗
class ScrollAxisLockConfigError extends SearError

Stable public error raised for invalid scroll-axis lock configuration.

constructorconstructor
ScrollAxisLockConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): ScrollAxisLockConfigError

Creates a SearError instance.

message: string
details: SearErrorDetails
options: ErrorOptions
propertycauseinherited
cause?: unknown
propertycode
readonly code: "SEAR_SCROLL_INVALID_AXIS_LOCK_CONFIG"

Stable machine-readable identifier for this error category.

propertydetailsinherited
readonly details: SearErrorDetails
propertymessageinherited
message: string
propertynameinherited
name: string
propertystackinherited
stack?: string
propertystackTraceLimitstaticinherited
stackTraceLimit: number

The Error.stackTraceLimit property specifies the number of stack frames
collected by a stack trace (whether generated by new Error().stack or
Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

methodreportinherited
report(): this

Reports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.

methodcaptureStackTracestaticinherited
captureStackTrace(targetObject: object, constructorOpt?: Function): void captureStackTrace(targetObject: object, constructorOpt?: Function): void

Creates a .stack property on targetObject, which when accessed returns
a string representing the location in the code at which
Error.captureStackTrace() was called.

``js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to
new Error().stack
`

The first line of the trace will be prefixed with
${myObject.name}: ${myObject.message}.

The optional
constructorOpt argument accepts a function. If given, all frames
above
constructorOpt, including constructorOpt, will be omitted from the
generated stack trace.

The
constructorOpt argument is useful for hiding implementation
details of error generation from the user. For instance:

`js
function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();
``

targetObject: object
constructorOpt: Function
methodprepareStackTracestaticinherited
prepareStackTrace(err: Error, stackTraces: CallSite[]): any prepareStackTrace(err: Error, stackTraces: CallSite[]): any
err: Error
stackTraces: CallSite[]
classScrollersource ↗
class Scroller

Base class for host scroll adapters.

Concrete scrollers own platform scroll surfaces while ScrollManager owns the
platform-neutral viewport state.

constructorconstructor
Scroller(): Scroller

Constructs a scroller adapter.

propertyconfigEngine
readonly configEngine: ConfigEngine

Configuration engine available to concrete scroller adapters.

propertyContainerSymbolstatic
readonly ContainerSymbol: symbol

DI token used by hosts that provide a scroller container.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the active scroller adapter.

classScrollerFactorysource ↗
class ScrollerFactory

Factory registry for host scroller adapters.

constructorconstructor
ScrollerFactory(): ScrollerFactory
methodcreateScrollerstatic
createScroller(type: string | symbol, args: unknown): Scroller

Creates a scroller for a registered type.

ReturnsNew scroller adapter.

type: string | symbol
Scroller type key.
args: unknown
Adapter-specific construction input.
methodregisterScrollerstatic
registerScroller(type: string | symbol, scrollerCreator: (args: unknown): Scroller): void

Registers a scroller creator.

type: string | symbol
Scroller type key.
scrollerCreator: (args: unknown): Scroller
Factory invoked by createScroller().
classScrollManagersource ↗
class ScrollManager

Owns viewport scroll state and fans updates out to render subscribers.

constructorconstructor
ScrollManager(width: number, height: number): ScrollManager

Creates a scroll manager for a viewport of the given dimensions.

width: number
height: number
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the scroll manager.

methodaddPublisher
addPublisher(publisher: ScrollPublisher): (): void

Connects a scroll-event source and returns an idempotent disposer.

publisher: ScrollPublisher
methodapplyInputScroll
applyInputScroll(state: ScrollManagerState): void

Applies platform scroll data within the owning editor's command.

state: ScrollManagerState
methoddestroy
destroy(ownerToken?: object): void

Disconnects publishers and subscribers owned by this manager.

ownerToken: object
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean): void

Closes direct viewport writes after the owning editor finishes restoration.

isExecuting: (): boolean
methodenforceTeardownBoundary
enforceTeardownBoundary(ownerToken: object): void

Reserves publisher cleanup for the owning editor.

ownerToken: object
methodgetContentBoundary
getContentBoundary(): [number, number]

Returns the maximum logical scroll positions for platform adapters.

methodgetPositionRect
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.

methodgetPreviousState
getPreviousState(): ScrollManagerState | null

Returns the previous committed scroll state.

methodgetRenderScrollState
getRenderScrollState(): ScrollManagerState

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.

methodgetShape
getShape(): [number, number]

Returns the viewport dimensions as [width, height].

methodgetState
getState(): ScrollManagerState

Returns the current committed scroll state.

methodhasUnrenderedScroll
hasUnrenderedScroll(): boolean

Returns whether the current scroll position has not yet been rendered.

methodmarkScrollStateRendered
markScrollStateRendered(): void

Marks the current committed scroll position as consumed by a render frame.

methodrequestScrollTo
requestScrollTo(x: number, y: number): void

Requests an absolute scroll position through the owning editor.

x: number
y: number
methodresize
resize(width: number, height: number): void

Updates viewport dimensions and clamps the current position without emitting a scroll render.

width: number
height: number
methodscrollTo
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.

x: number
y: number
methodsetContentBoundary
setContentBoundary(maxWidth: number, maxHeight: number): void

Set the content boundary for scroll clamping.

maxWidth: number
Maximum scrollable x position (contentWidth - viewportWidth)
maxHeight: number
Maximum scrollable y position (contentHeight - viewportHeight)

This should be called after initialization once the total sheet dimensions
are known (e.g. by expandTreeBoundaryToSheetSize).
methodsetInputUpdateExecutor
setInputUpdateExecutor(executor: (state: ScrollManagerState): void): void

Routes platform-originated viewport input through the host's action boundary.

executor: (state: ScrollManagerState): void
methodsetPosition
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.

x: number
y: number
methodsetScrollToExecutor
setScrollToExecutor(executor: (x: number, y: number): void): void

Binds programmatic scroll requests to the owning editor's command bus.

executor: (x: number, y: number): void
methodsubscribeScroll
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.

callback: ScrollSubscriber
prepend: boolean
classWebScrollersource ↗
class WebScroller extends Scroller

Adapts a Web scroll surface to logical editor viewport coordinates.

constructorconstructor
WebScroller(target: unknown, platform: Platform): WebScroller

Creates a WebScroller instance.

target: unknown
platform: Platform
propertyconfigEngineinherited
readonly configEngine: ConfigEngine

Configuration engine available to concrete scroller adapters.

propertyContainerSymbolstaticinherited
readonly ContainerSymbol: symbol

DI token used by hosts that provide a scroller container.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving WebScroller.

memberroot
root: unknown
methodconfigureAxisLock
configureAxisLock(config: Partial<ScrollAxisLockConfig>): void

Enables or tunes Safari-style dominant-axis locking for wheel and touch gestures.

config: Partial<ScrollAxisLockConfig>
methodconfigureRubberBand
configureRubberBand(config: Partial<RubberBandConfig>): void

Enables or tunes the Safari-style overscroll effect.
Logical editor coordinates remain clamped; only the visible surface moves.

config: Partial<RubberBandConfig>
methodgetPublisher
getPublisher(): (scrollStateInstance: ScrollManager, updateState: (newState: ScrollManagerState): void): (): void

Returns the publisher.

interfaceRubberBandConfigsource ↗
interface RubberBandConfig

Host-tunable parameters for Safari-style boundary resistance and return motion.

propertyenabled
enabled: boolean
propertymaxOffset
maxOffset: number

Smooth asymptotic maximum visual displacement in viewport pixels.

propertyresistance
resistance: number

Initial slope of the rubber-band curve. Lower values reduce sensitivity.

propertyreturnDelay
returnDelay: number

Default delay used when release is called without an explicit delay.

propertyspringDamping
springDamping: number

Viscous damping used by the damped harmonic return motion.

propertyspringMass
springMass: number

Spring mass used by the damped harmonic return motion.

propertyspringStiffness
springStiffness: number

Spring stiffness used by the damped harmonic return motion.

interfaceRubberBandInputsource ↗
interface RubberBandInput

One logical input sample consumed by RubberBandController.

propertyboundary
readonly boundary: RubberBandOffset
propertycontinueReturnOnOutwardInput
readonly continueReturnOnOutwardInput?: boolean

Keeps an already scheduled return alive for same-direction wheel inertia.

propertydisplacement
readonly displacement: RubberBandOffset

Content displacement: positive values move the visible surface right/down.

propertyposition
readonly position: RubberBandOffset
propertyviewport
readonly viewport: RubberBandOffset
interfaceRubberBandOffsetsource ↗
interface RubberBandOffset

Transient visual displacement in viewport pixels.

propertyx
readonly x: number
propertyy
readonly y: number
interfaceScrollAxisLockConfigsource ↗
interface ScrollAxisLockConfig

Host-tunable direction-lock parameters for DOM scrolling gestures.

propertyactivationThreshold
activationThreshold: number

Accumulated pixels required before selecting the dominant axis.

propertyenabled
enabled: boolean
propertywheelEndDelay
wheelEndDelay: number

Wheel silence in milliseconds that separates two gestures.

interfaceScrollManagerStatesource ↗
interface ScrollManagerState

Scroll offset snapshot published to render and coordinate subscribers.

propertydeltaX
deltaX: number

Horizontal input delta that produced the update.

propertydeltaY
deltaY: number

Vertical input delta that produced the update.

propertyx
x: number

Current horizontal scroll offset in world coordinates.

propertyy
y: number

Current vertical scroll offset in world coordinates.

typeScrollAxissource ↗
type ScrollAxis = "x" | "y"

Axis selected for one continuous wheel or touch gesture.

typeScrollPublishersource ↗
type ScrollPublisher = (manager: ScrollManager, updateState: (newState: ScrollManagerState): void): (): void

Platform adapter that connects a scroll event source to ScrollManager.

functioncreateDefaultScrollManagerStatesource ↗
createDefaultScrollManagerState(): ScrollManagerState

Creates the default zero-offset scroll state.

functionrubberBandDistancesource ↗
rubberBandDistance(excess: number, viewport: number, resistance?: number, maxOffset?: number): number

Safari-like rubber-band mapping with a smooth maximum visual displacement.

excess: number
viewport: number
resistance: number
maxOffset: number

Package

@searsuite/sear-render-strategy

36 exports

Full, dirty-region, retained, and incremental rendering policies.

classBlockRasterCopyPlansource ↗
class BlockRasterCopyPlan

Raster-copy plan for layout shifts where unchanged blocks move within the viewport.

constructorconstructor
BlockRasterCopyPlan(viewport: PositionRectProps, clearViewportRects: readonly PositionRect<templateLiteral>[], cacheToViewportCopies: readonly RasterCopyRect[], invalidWorldRects: readonly PositionRect<templateLiteral>[]): BlockRasterCopyPlan
viewport: PositionRectProps
clearViewportRects: readonly PositionRect<templateLiteral>[]
cacheToViewportCopies: readonly RasterCopyRect[]
invalidWorldRects: readonly PositionRect<templateLiteral>[]
propertycacheToViewportCopies
readonly cacheToViewportCopies: readonly RasterCopyRect[]
propertyclearViewportRects
readonly clearViewportRects: readonly PositionRect<templateLiteral>[]
propertyinvalidWorldRects
readonly invalidWorldRects: readonly PositionRect<templateLiteral>[]
propertyviewport
readonly viewport: PositionRectProps
methodfromLayoutShiftstatic
fromLayoutShift(input: BlockRasterCopyPlanInput): BlockRasterCopyPlan | null
input: BlockRasterCopyPlanInput
classDirtyRegionCollectorsource ↗
class DirtyRegionCollector<T>

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.

constructorconstructor
DirtyRegionCollector<T>(source: DirtyRegionSource<T>): DirtyRegionCollector<T>

Creates a collector around a frame-scoped dirty source.

source: DirtyRegionSource<T>
Dirty source owned by the host renderer.
methodclear
clear(): void

Clears all dirty rectangles from the underlying source.

methodcollect
collect(): PositionRect<T>[]

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.

methodcreateClipRegionstatic
createClipRegion<T>(dirtyRect: PositionRect<T>, nodeRect: PositionRect<T>, strokeWidth: number, useUnionClip: boolean): PositionRect<templateLiteral> | [number, number][]

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: PositionRect<T>
Dirty rectangle in world coordinates.
nodeRect: PositionRect<T>
Node bounds in world coordinates.
strokeWidth: number
Stroke width used to expand both dirty and node bounds.
useUnionClip: boolean
Whether to compute the concave union boundary.
methoddedupePointsstatic
dedupePoints(points: [number, number][]): [number, number][]

Removes duplicated points while preserving first occurrence order.

ReturnsDeduplicated polygon points.

points: [number, number][]
Polygon points.
methodexpandstatic
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: PositionRect<T>
Dirty rectangle in world coordinates.
padding: number
Pixels added to every edge.
methodremoveCollinearstatic
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: [number, number][]
Polygon points in boundary order.
methodtraceUnionBoundarystatic
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: DirtyRegionBounds
First rectangle bounds.
rectB: DirtyRegionBounds
Second rectangle bounds.
classDirtyRenderStrategysource ↗
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.

constructorconstructor
DirtyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): DirtyRenderStrategy<NodeTypeProperties>

Creates a RenderStrategy instance.

renderContext: RenderContext
offScreenRenderContext: RenderContext
hitRenderContext: RenderContext
scrollManager: ScrollManager
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeTypeProperties>
tree: Tree<PositionRect<templateLiteral>>
dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited
readonly dirtyTree: GenerationalDirtyTracker
propertyhitRenderContextinherited
readonly hitRenderContext: RenderContext
propertyoffScreenRenderContextinherited
readonly offScreenRenderContext: RenderContext
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertystageinherited
readonly stage: SceneGraph<NodeTypeProperties>
propertytreeinherited
readonly tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving DirtyRenderStrategy.

methodgetContext
getContext(): RenderContext

Returns the screen render context used by this strategy.

methodgetNodeByCoordinates
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.

node: Node<NodeTypeProperties>
x: number
y: number
methodgetViewScaleContextsinherited
getViewScaleContexts(): readonly RenderContext[]

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.

methodrender
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.

node: Node<NodeTypeProperties>
classEventRenderStrategysource ↗
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.

constructorconstructor
EventRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): EventRenderStrategy<NodeTypeProperties>

Creates a RenderStrategy instance.

renderContext: RenderContext
offScreenRenderContext: RenderContext
hitRenderContext: RenderContext
scrollManager: ScrollManager
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeTypeProperties>
tree: Tree<PositionRect<templateLiteral>>
dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited
readonly dirtyTree: GenerationalDirtyTracker
propertyhitRenderContextinherited
readonly hitRenderContext: RenderContext
propertyoffScreenRenderContextinherited
readonly offScreenRenderContext: RenderContext
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertystageinherited
readonly stage: SceneGraph<NodeTypeProperties>
propertytreeinherited
readonly tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving EventRenderStrategy.

methodgetContext
getContext(): RenderContext

Returns the context used by this strategy.

methodgetNodeByCoordinates
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.

node: Node<NodeTypeProperties>
x: number
y: number
methodgetViewScaleContextsinherited
getViewScaleContexts(): readonly RenderContext[]

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.

methodrender
render(node: Node<NodeTypeProperties>): void

Executes event-layer rendering.

Current implementation is intentionally a no-op.

node: Node<NodeTypeProperties>
classHitRenderStrategysource ↗
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.

constructorconstructor
HitRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker, platform: Platform): HitRenderStrategy<NodeTypeProperties>

Creates a HitRenderStrategy instance.

renderContext: RenderContext
offScreenRenderContext: RenderContext
hitRenderContext: RenderContext
scrollManager: ScrollManager
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeTypeProperties>
tree: Tree<PositionRect<templateLiteral>>
dirtyTree: GenerationalDirtyTracker
platform: Platform
propertydirtyTreeinherited
readonly dirtyTree: GenerationalDirtyTracker
propertyhitRenderContextinherited
readonly hitRenderContext: RenderContext
propertyoffScreenRenderContextinherited
readonly offScreenRenderContext: RenderContext
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertystageinherited
readonly stage: SceneGraph<NodeTypeProperties>
propertytreeinherited
readonly tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving HitRenderStrategy.

methoddebouncedRender
debouncedRender(node: Node<NodeTypeProperties>): void

Actually performs the hit-canvas rendering after debounce.

node: Node<NodeTypeProperties>
Node to render
methoddestroy
destroy(): void

Cancels deferred hit-layer work when the owning editor is destroyed.

methodflushPendingScrollRender
flushPendingScrollRender(): void

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.

methodgetContext
getContext(): RenderContext

Get the current rendering context.

ReturnsRenderContext

methodgetNodeByCoordinates
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: Node<NodeTypeProperties>
Root node to search from
x: number
X coordinate
y: number
Y coordinate
methodgetViewScaleContextsinherited
getViewScaleContexts(): readonly RenderContext[]

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.

methodrender
render(node: Node<NodeTypeProperties>, delay?: number): void

Debounced render entry. Only the last call within the delay will trigger rendering.

node: Node<NodeTypeProperties>
Node to render
delay: number
Debounce delay in ms
methodrenderImmediate
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.

node: Node<NodeTypeProperties>
methodrenderOnNextFrame
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.

node: Node<NodeTypeProperties>
classIncrementalRenderPolicysource ↗
class IncrementalRenderPolicy

Decides whether an incremental render candidate is worth using for the next frame.

constructorconstructor
IncrementalRenderPolicy(): IncrementalRenderPolicy
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving IncrementalRenderPolicy.

methodevaluate
evaluate(candidate: IncrementalRenderCandidate, limits?: IncrementalRenderPolicyLimits): IncrementalRenderDecision
candidate: IncrementalRenderCandidate
limits: IncrementalRenderPolicyLimits
classOverlayRenderStrategysource ↗
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.

constructorconstructor
OverlayRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): OverlayRenderStrategy<NodeTypeProperties>

Creates a RenderStrategy instance.

renderContext: RenderContext
offScreenRenderContext: RenderContext
hitRenderContext: RenderContext
scrollManager: ScrollManager
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeTypeProperties>
tree: Tree<PositionRect<templateLiteral>>
dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited
readonly dirtyTree: GenerationalDirtyTracker
propertyhitRenderContextinherited
readonly hitRenderContext: RenderContext
propertyoffScreenRenderContextinherited
readonly offScreenRenderContext: RenderContext
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertystageinherited
readonly stage: SceneGraph<NodeTypeProperties>
propertytreeinherited
readonly tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving OverlayRenderStrategy.

methodgetContext
getContext(): RenderContext

Returns the context.

methodgetNodeByCoordinates
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Returns the node by coordinates.

node: Node<NodeTypeProperties>
x: number
y: number
methodgetViewScaleContextsinherited
getViewScaleContexts(): readonly RenderContext[]

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.

methodrender
render(node: Node<NodeTypeProperties>): void

Renders OverlayRenderStrategy scene output.

node: Node<NodeTypeProperties>
classRasterCopyExecutorsource ↗
class RasterCopyExecutor

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.

constructorconstructor
RasterCopyExecutor(): RasterCopyExecutor
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving RasterCopyExecutor.

methodcopy
copy(source: RenderContext, destination: RenderContext, copy: RasterCopyRect): void

Copies a rectangular pixel region from one render target into another.

source: RenderContext
Source render context.
destination: RenderContext
Destination render context.
copy: RasterCopyRect
Source and destination rectangles in viewport coordinates.
methodcopyNatural
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: RenderContext
Source render context.
destination: RenderContext
Destination render context.
x: number
Destination x-coordinate.
y: number
Destination y-coordinate.
classRasterCopyPlansource ↗
class RasterCopyPlan

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.

constructorconstructor
RasterCopyPlan(viewport: PositionRect<templateLiteral>, cacheToViewportCopy: RasterCopyRect, blankViewportRect: PositionRect<templateLiteral>, blankWorldRect: PositionRect<templateLiteral>, viewportToCacheCopy: RasterCopyRect): RasterCopyPlan

Creates a raster copy plan.

viewport: PositionRect<templateLiteral>
Viewport rectangle in viewport coordinates.
cacheToViewportCopy: RasterCopyRect
Copy from the cached frame into the visible target.
blankViewportRect: PositionRect<templateLiteral>
Newly exposed viewport-space area to redraw.
blankWorldRect: PositionRect<templateLiteral>
Newly exposed world-space area to query from the scene.
viewportToCacheCopy: RasterCopyRect
Copy from the visible target back into the cache.
propertyblankViewportRect
readonly blankViewportRect: PositionRect<templateLiteral>

Newly exposed viewport-space area to redraw.

propertyblankWorldRect
readonly blankWorldRect: PositionRect<templateLiteral>

Newly exposed world-space area to query from the scene.

propertycacheToViewportCopy
readonly cacheToViewportCopy: RasterCopyRect

Copy from the cached frame into the visible target.

propertyviewport
readonly viewport: PositionRect<templateLiteral>

Viewport rectangle in viewport coordinates.

propertyviewportToCacheCopy
readonly viewportToCacheCopy: RasterCopyRect

Copy from the visible target back into the cache.

methodcreateViewportToCacheCopystatic
createViewportToCacheCopy(viewport: PositionRectProps): RasterCopyRect

Creates a full-viewport copy from the visible target into the frame cache.

ReturnsCopy rectangle with identical source and destination bounds.

viewport: PositionRectProps
Viewport-space bounds to copy.
methodfromScrollstatic
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: PositionRect<templateLiteral>
Visible viewport rectangle in viewport coordinates.
scrollState: ScrollManagerState
Current scroll snapshot.
classRenderStrategysource ↗
class RenderStrategy<T>

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.

constructorconstructor
RenderStrategy<T>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<T>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): RenderStrategy<T>

Creates a RenderStrategy instance.

renderContext: RenderContext
offScreenRenderContext: RenderContext
hitRenderContext: RenderContext
scrollManager: ScrollManager
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<T>
tree: Tree<PositionRect<templateLiteral>>
dirtyTree: GenerationalDirtyTracker
propertydirtyTree
readonly dirtyTree: GenerationalDirtyTracker
propertyhitRenderContext
readonly hitRenderContext: RenderContext
propertyoffScreenRenderContext
readonly offScreenRenderContext: RenderContext
propertyrenderContext
readonly renderContext: RenderContext
propertyrenderCoordinatorManager
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyscrollManager
readonly scrollManager: ScrollManager
propertystage
readonly stage: SceneGraph<T>
propertytree
readonly tree: Tree<PositionRect<templateLiteral>>
methodgetContext
getContext(): RenderContext

Returns the render context owned by this strategy.

methodgetNodeByCoordinates
getNodeByCoordinates(node: Node<T>, x: number, y: number): Node<T>[]

Resolves nodes around the provided coordinates for this strategy layer.

node: Node<T>
x: number
y: number
methodgetViewScaleContexts
getViewScaleContexts(): readonly RenderContext[]

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.

methodrender
render(node: Node<T>): void

Renders the target node tree according to the strategy semantics.

node: Node<T>
classRenderStrategyManagersource ↗
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.

constructorconstructor
RenderStrategyManager<NodeTypeProperties>(): RenderStrategyManager<NodeTypeProperties>
propertysymbolstatic
readonly symbol: symbol

DI token for resolving RenderStrategyManager.

methodaddStrategy
addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Registers or replaces a strategy under the provided key.

name: string | Symbol
strategy: RenderStrategy<NodeTypeProperties>
methodaddStrategyAfter
addStrategyAfter(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Inserts a strategy immediately after an existing strategy.

reference: string | Symbol
name: string | Symbol
strategy: RenderStrategy<NodeTypeProperties>
methodaddStrategyBefore
addStrategyBefore(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): void

Inserts a strategy immediately before an existing strategy.

reference: string | Symbol
name: string | Symbol
strategy: RenderStrategy<NodeTypeProperties>
methodenforceCommandBoundary
enforceCommandBoundary(isExecuting: (): boolean): void

Closes direct strategy and view-scale changes after Sheet startup.

isExecuting: (): boolean
methodgetAllStrategy
getAllStrategy(): RenderStrategy<NodeTypeProperties>[]

Returns all currently registered strategies in insertion order.

methodgetStrategy
getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefined

Retrieves a strategy by key.

name: string | Symbol
methodsetViewScale
setViewScale(scale: number): void

Propagates view scale to every context contributed by registered
strategies. Shared base/off-screen/hit contexts are updated once.

scale: number
classScreenRenderStrategysource ↗
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.

constructorconstructor
ScreenRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker, rasterCopyExecutor: RasterCopyExecutor): ScreenRenderStrategy<NodeTypeProperties>

Creates a screen render strategy with injected render targets and copy executor.

renderContext: RenderContext
offScreenRenderContext: RenderContext
hitRenderContext: RenderContext
scrollManager: ScrollManager
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeTypeProperties>
tree: Tree<PositionRect<templateLiteral>>
dirtyTree: GenerationalDirtyTracker
rasterCopyExecutor: RasterCopyExecutor
propertydirtyTreeinherited
readonly dirtyTree: GenerationalDirtyTracker
propertyhitRenderContextinherited
readonly hitRenderContext: RenderContext
propertyoffScreenRenderContextinherited
readonly offScreenRenderContext: RenderContext
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertystageinherited
readonly stage: SceneGraph<NodeTypeProperties>
propertytreeinherited
readonly tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving ScreenRenderStrategy.

methodconfigureRuntime
configureRuntime(runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>): void

Configures host-specific viewport, query, and drawing semantics.

runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>
methodgetContext
getContext(): RenderContext

Returns the current render context.

The returned context targets the on-screen canvas.

methodgetNodeByCoordinates
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Not implemented: Finds nodes at the given coordinates.

ThrowsError

node: Node<NodeTypeProperties>
x: number
y: number
methodgetViewScaleContextsinherited
getViewScaleContexts(): readonly RenderContext[]

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.

methodrender
render(node: Node<NodeTypeProperties>): void

Renders the scene graph node using an off-screen buffer for efficient scrolling.

node: Node<NodeTypeProperties>
The root node to render.
classStickyRenderStrategysource ↗
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.

constructorconstructor
StickyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: GenerationalDirtyTracker): StickyRenderStrategy<NodeTypeProperties>

Creates a RenderStrategy instance.

renderContext: RenderContext
offScreenRenderContext: RenderContext
hitRenderContext: RenderContext
scrollManager: ScrollManager
configEngine: ConfigEngine
renderCoordinatorManager: RenderCoordinatorManager
stage: SceneGraph<NodeTypeProperties>
tree: Tree<PositionRect<templateLiteral>>
dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited
readonly dirtyTree: GenerationalDirtyTracker
propertyhitRenderContextinherited
readonly hitRenderContext: RenderContext
propertyoffScreenRenderContextinherited
readonly offScreenRenderContext: RenderContext
propertyrenderContextinherited
readonly renderContext: RenderContext
propertyrenderCoordinatorManagerinherited
readonly renderCoordinatorManager: RenderCoordinatorManager
propertyscrollManagerinherited
readonly scrollManager: ScrollManager
propertystageinherited
readonly stage: SceneGraph<NodeTypeProperties>
propertytreeinherited
readonly tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving StickyRenderStrategy.

methodgetContext
getContext(): RenderContext

Returns the current render context.

methodgetNodeByCoordinates
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]

Not implemented: Finds nodes at the given coordinates.

ThrowsError

node: Node<NodeTypeProperties>
x: number
y: number
methodgetViewScaleContextsinherited
getViewScaleContexts(): readonly RenderContext[]

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.

methodrender
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: Node<NodeTypeProperties>
The root node to search for StickyNode descendants.
classViewportFrameCachesource ↗
class ViewportFrameCache

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.

constructorconstructor
ViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCache

Creates a viewport frame cache facade.

cacheContext: RenderContext
Off-screen render target that stores the last complete base frame.
copyExecutor: RasterCopyExecutor
Raster copy executor used for cache synchronization.
methodclear
clear(viewport: PositionRectProps): void

Clears the cached viewport with an identity transform.

viewport: PositionRectProps
Viewport-space rectangle to erase from the cache.
methodinvalidate
invalidate(): void

Marks the cached frame invalid so the next render performs a full prime.

methodisReady
isReady(): boolean

Returns whether the cache already contains a complete base frame.

methodmarkReady
markReady(): void

Marks the cached frame ready after a complete frame has been copied in.

methodprimeFromVisibleFrame
primeFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): void

Primes the cache from the visible frame after a first full paint.

visibleContext: RenderContext
Visible render target containing a complete base frame.
viewport: PositionRectProps
Viewport-space rectangle to clear before copying.
methodrefreshFromVisibleFrame
refreshFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): void

Refreshes the cache from the visible target after incremental redraw.

visibleContext: RenderContext
Visible render target containing the latest base frame.
viewport: PositionRectProps
Viewport-space rectangle to copy into the cache.
interfaceBlockRasterCopyCandidatesource ↗
interface BlockRasterCopyCandidate
propertydestination
readonly destination: PositionRectProps
propertysource
readonly source: PositionRectProps
interfaceBlockRasterCopyPlanInputsource ↗
interface BlockRasterCopyPlanInput
propertyclearWorldRects
readonly clearWorldRects: readonly PositionRectProps[]
propertycopies
readonly copies: readonly BlockRasterCopyCandidate[]
propertyinvalidWorldRects
readonly invalidWorldRects: readonly PositionRectProps[]
propertyscrollState
readonly scrollState: Pick<ScrollManagerState, "x" | "y">
propertyviewport
readonly viewport: PositionRectProps
interfaceDirtyRegionBoundssource ↗
interface DirtyRegionBounds

Boundary represented by four world-space edges.

propertyx1
readonly x1: number

Left edge in world coordinates.

propertyx2
readonly x2: number

Right edge in world coordinates.

propertyy1
readonly y1: number

Top edge in world coordinates.

propertyy2
readonly y2: number

Bottom edge in world coordinates.

interfaceDirtyRegionSourcesource ↗
interface DirtyRegionSource<T>

Minimal dirty-region storage contract consumed by DirtyRegionCollector.

Sheet uses GenerationalDirtyTracker; 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.

methodclear
clear(): void

Clears dirty state after the owning frame has consumed it.

methodgetBoundary
getBoundary(): PositionRect<T>

Returns the total query boundary that contains all possible dirty entries.

methodquery
query(range: PositionRect<T>): PositionRect<T>[]

Returns dirty rectangles intersecting the provided query range.

range: PositionRect<T>
interfaceIncrementalRenderCandidatesource ↗
interface IncrementalRenderCandidate

Measured cost shape for one proposed incremental render frame.

propertycopiedArea
readonly copiedArea: number

Total destination pixel area copied from the retained/off-screen frame cache.

propertycopyCount
readonly copyCount: number

Number of raster copy rectangles in the candidate plan.

propertyinvalidArea
readonly invalidArea: number

Total world pixel area that still needs redraw after raster reuse.

propertyinvalidRectCount
readonly invalidRectCount: number

Number of invalid redraw rectangles in the candidate plan.

propertyviewport
readonly viewport: Pick<PositionRectProps, "width" | "height">

Viewport dimensions used as the baseline for area ratios.

interfaceIncrementalRenderDecisionsource ↗
interface IncrementalRenderDecision
propertyaccepted
readonly accepted: boolean
propertyreason
readonly reason: IncrementalRenderDecisionReason
interfaceIncrementalRenderPolicyLimitssource ↗
interface IncrementalRenderPolicyLimits

Guardrails used to decide whether an incremental render plan is cheaper and safe enough to use.

propertymaxCopiedAreaRatio
readonly maxCopiedAreaRatio: number

Maximum total copied pixel area divided by viewport area. Values above 1 allow overlapping or repeated copies.

propertymaxCopyCount
readonly maxCopyCount: number

Maximum number of raster copy rectangles allowed in one frame.

propertymaxInvalidAreaRatio
readonly maxInvalidAreaRatio: number

Maximum invalid redraw area divided by viewport area after raster copies have been applied.

propertymaxInvalidRectCount
readonly maxInvalidRectCount: number

Maximum number of invalid redraw rectangles allowed in one frame.

interfaceRasterCopyRectsource ↗
interface RasterCopyRect

Source and destination rectangles for one raster copy.

propertydestination
readonly destination: PositionRectProps

Destination pixels inside the destination render target, expressed in viewport coordinates.

propertysource
readonly source: PositionRectProps

Source pixels inside the source render target, expressed in viewport coordinates.

interfaceRenderContextCapabilitiessource ↗
interface RenderContextCapabilities

Capability snapshot used by viewport render coordinators before choosing a raster strategy.

propertyrequiresExplicitNodeClear
readonly requiresExplicitNodeClear: boolean
propertyrequiresFrameRebuild
readonly requiresFrameRebuild: boolean
propertysupportsDirtyRedraw
readonly supportsDirtyRedraw: boolean
interfaceScreenRenderStrategyRuntimesource ↗
interface ScreenRenderStrategyRuntime<NodeTypeProperties>
propertyconsumeBlockRasterCopyPlan
readonly consumeBlockRasterCopyPlan?: (): BlockRasterCopyPlan | null

Consumes a pending block-copy plan for layout-shift frames, if the host has one.

propertydrawNodes
readonly drawNodes?: (input: { context: RenderContext; nodes: readonly Node<NodeTypeProperties>[]; scrollState: ScrollManagerState; worldRect: PositionRect<templateLiteral> }): void

Draws already queried nodes into the visible render context.

propertyforceFullRepaint
readonly forceFullRepaint?: (): boolean

Forces a full visible body repaint even when the off-screen cache is ready.

propertygetScrollState
readonly getScrollState?: (): ScrollManagerState

Returns the scroll state used for world queries and raster copy deltas.

propertygetViewport
readonly getViewport?: (): PositionRect<templateLiteral>

Returns the viewport-space rectangle covered by this screen layer.

propertyisScrollStateChanged
readonly isScrollStateChanged?: (scrollState: ScrollManagerState): boolean

Returns whether the current scroll state requires a scroll-copy frame.

propertyonFrameRendered
readonly onFrameRendered?: (mode: ScreenRenderFrameMode): void

Called after a full, scroll, or rebuilt frame is rendered.

propertyqueryNodes
readonly queryNodes?: (root: Node<NodeTypeProperties>, worldRect: PositionRect<templateLiteral>): readonly Node<NodeTypeProperties>[]

Returns screen-body nodes to draw for the supplied world-space rectangle.

propertyrequiresFrameRebuild
readonly requiresFrameRebuild?: (): boolean

Returns whether this frame should rebuild a retained render target.

propertytoWorldRect
readonly toWorldRect?: (viewportRect: PositionRect<templateLiteral>, scrollState: ScrollManagerState): PositionRect<templateLiteral>

Maps a viewport-space repaint rectangle to a world-space query rectangle.

typeIncrementalRenderDecisionReasonsource ↗
type IncrementalRenderDecisionReason = typeof IncrementalRenderDecisionReason[keyof typeof IncrementalRenderDecisionReason]
typeScreenRenderFrameModesource ↗
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.
- Scroll frame: blit preserved region from off-screen, redraw only newly exposed strip,
then sync back to off-screen.

variableDEFAULT_INCREMENTAL_RENDER_POLICY_LIMITSsource ↗
DEFAULT_INCREMENTAL_RENDER_POLICY_LIMITS: IncrementalRenderPolicyLimits
variableIncrementalRenderDecisionReasonsource ↗
IncrementalRenderDecisionReason: { Accepted: "accepted"; EmptyViewport: "empty-viewport"; ExcessiveCopiedArea: "excessive-copied-area"; ExcessiveCopyCount: "excessive-copy-count"; ExcessiveInvalidArea: "excessive-invalid-area"; ExcessiveInvalidRectCount: "excessive-invalid-rect-count"; NotCandidate: "not-candidate" }
functionclearViewportsource ↗
clearViewport(context: RenderContext, viewport: PositionRectProps): void
context: RenderContext
viewport: PositionRectProps
functionclearViewportRectsource ↗
clearViewportRect(context: RenderContext, rect: PositionRectProps): void
context: RenderContext
rect: PositionRectProps
functioncreateViewportFrameCachesource ↗
createViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCache
cacheContext: RenderContext
copyExecutor: RasterCopyExecutor
functionreadRenderContextCapabilitiessource ↗
readRenderContextCapabilities(context: RenderContext): RenderContextCapabilities
context: RenderContext
functionrequiresViewportExplicitNodeClearsource ↗
requiresViewportExplicitNodeClear(context: RenderContext): boolean
context: RenderContext
functionrequiresViewportFrameRebuildsource ↗
requiresViewportFrameRebuild(context: RenderContext): boolean
context: RenderContext
functionsupportsViewportDirtyRedrawsource ↗
supportsViewportDirtyRedraw(context: RenderContext): boolean
context: RenderContext
functionworldRectToViewportClearRectsource ↗
worldRectToViewportClearRect<T>(rect: PositionRect<T>, scrollX: number, scrollY: number, padding: number): PositionRect<templateLiteral>
rect: PositionRect<T>
scrollX: number
scrollY: number
padding: number

Package

@searsuite/sear-render

11 exports

Public rendering facade that composes contexts, nodes, strategies, and registries.

classSheetCellMergeRendersource ↗
class SheetCellMergeRender extends Plugin<SearCoreSheet, CellProperties, Record<string, never>>

Renders merged ranges owned by SheetCellMergePlugin.

constructorconstructor
SheetCellMergeRender(cellVisualReaders: SheetCellVisualReaderRegistry): SheetCellMergeRender
cellVisualReaders: SheetCellVisualReaderRegistry
propertydepth
readonly depth: 1

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<Record<string, never>, object> | readonly PluginDocumentStateContribution<Record<string, never>, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
readonly interestedIn: MatrixOTActionName[]

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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
memberkeyinherited
key: unknown
methodapply
apply(): Record<string, never>

Applies a transaction to plugin-owned state and returns the next state.

methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): { defaultBorderColor: string }

Returns this plugin's runtime configuration view for the current core.

searCore: SearCoreSheet
methodgetStateinherited
getState(): Record<string, never>

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDown
onMouseDown(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): void

Handles the start of a pointer press sequence.

_searCore: SearCoreSheet
_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove
onMouseMove(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): void

Handles pointer movement over the host surface.

_searCore: SearCoreSheet
_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp
onMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): void

Handles the end of a pointer press sequence.

_searCore: SearCoreSheet
_event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
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.

state: PluginStateType
transaction: Transaction
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ defaultBorderColor: string }>; key: PluginKey }[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): { key: PluginKey; state: Record<string, never> }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

searCore: SearCoreSheet
offset: { x: number; y: number }
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
classSheetColumnLabelPluginsource ↗
class SheetColumnLabelPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetColumnLabel>

Renders sticky column header cells for the visible viewport range.

constructorconstructor
SheetColumnLabelPlugin(): SheetColumnLabelPlugin

Constructs the column header plugin.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<ISheetColumnLabel, object> | readonly PluginDocumentStateContribution<ISheetColumnLabel, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydefaultConfigstatic
readonly defaultConfig: { defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number }

Default visual configuration for column headers.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the column header plugin.

memberkeyinherited
key: unknown
methodapply
apply(operations: Operation[]): ISheetColumnLabel

Returns unchanged plugin state for every transaction.

operations: Operation[]
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): { defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number }

Reads the column header render configuration from ConfigEngine.

searCore: SearCoreSheet
methodgetStateinherited
getState(): ISheetColumnLabel

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(): void

Initializes column header runtime state.

methodlockCommittedStateinherited
lockCommittedState(state: ISheetColumnLabel): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: ISheetColumnLabel
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResize
onResize(): void

Column header dimensions are recomputed during render after resize.

methodonScroll
onScroll(_scrollManagerState: ScrollManagerState): void

Column header positions are recomputed during render from scroll state.

_scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: ISheetColumnLabel, 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.

state: ISheetColumnLabel
transaction: Transaction
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; defaultHeight: number }>; key: PluginKey }[]

Registers default column header configuration.

methodregisterState
registerState(): { key: PluginKey; state: ISheetColumnLabel }

Registers the stateless column header plugin with PluginManager.

methodrender
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders visible column header cells.

ReturnsRender nodes for visible column headers.

searCore: SearCoreSheet
Sheet core containing data and render services.
offset: { x: number; y: number }
World offset applied by sticky rendering.
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: ISheetColumnLabel, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: ISheetColumnLabel
commitToken: object
classSheetCornerPluginsource ↗
class SheetCornerPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetCorner>

Renders the sticky sheet corner cell where row and column headers meet.

constructorconstructor
SheetCornerPlugin(): SheetCornerPlugin

Constructs the sheet corner plugin.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<ISheetCorner, object> | readonly PluginDocumentStateContribution<ISheetCorner, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the sheet corner plugin.

memberkeyinherited
key: unknown
methodapply
apply(operations: Operation[]): ISheetCorner

Returns unchanged plugin state for every transaction.

operations: Operation[]
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): { backgroundColor: string; borderColor: string; height: number; width: number }

Reads the sheet corner render configuration from ConfigEngine.

searCore: SearCoreSheet
methodgetStateinherited
getState(): ISheetCorner

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(): void

Initializes sheet corner runtime state.

methodlockCommittedStateinherited
lockCommittedState(state: ISheetCorner): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: ISheetCorner
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResize
onResize(): void

Sheet corner dimensions are recomputed during render after resize.

methodonScroll
onScroll(_scrollManagerState: ScrollManagerState): void

Sheet corner position is recomputed during render from scroll state.

_scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: ISheetCorner, 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.

state: ISheetCorner
transaction: Transaction
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ backgroundColor: string; borderColor: string; height: number; width: number }>; key: PluginKey }[]

Registers default sheet corner configuration.

methodregisterState
registerState(): { key: PluginKey; state: ISheetCorner }

Registers the stateless sheet corner plugin with PluginManager.

methodrender
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders the sheet corner cell.

ReturnsRender nodes for the sheet corner.

searCore: SearCoreSheet
Sheet core containing render services.
offset: { x: number; y: number }
World offset applied by sticky rendering.
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: ISheetCorner, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: ISheetCorner
commitToken: object
classSheetGridPluginsource ↗
class SheetGridPlugin extends Plugin<SearCoreSheet, CellProperties, SheetGridState>

Composite plugin that assembles sheet chrome, body grid, and merged-cell nodes.

constructorconstructor
SheetGridPlugin(sheetCornerPlugin: SheetCornerPlugin, sheetColumnLabelPlugin: SheetColumnLabelPlugin, sheetRowNumberPlugin: SheetRowNumberPlugin, sheetGridRender: SheetGridRender): SheetGridPlugin

Constructs the grid plugin from its child sheet render plugins.

sheetCornerPlugin: SheetCornerPlugin
sheetColumnLabelPlugin: SheetColumnLabelPlugin
sheetRowNumberPlugin: SheetRowNumberPlugin
sheetGridRender: SheetGridRender
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<SheetGridState, object> | readonly PluginDocumentStateContribution<SheetGridState, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: string[]

Rebuilds grid geometry when sheet data or dimensions change.

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the composite sheet grid plugin.

memberkeyinherited
key: unknown
methodapply
apply(pluginState: SheetGridState, transaction: Transaction): SheetGridState | null

Keeps composite state unchanged when data transactions cause a re-render.

pluginState: SheetGridState
transaction: Transaction
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): null

Composite grid configuration is delegated to child render plugins.

searCore: SearCoreSheet
methodgetStateinherited
getState(): SheetGridState

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClick
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

Forwards double-click handling to the body grid renderer.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
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.

state: PluginStateType
transaction: Transaction
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ backgroundColor: string; borderColor: string; height: number; width: number }>; key: PluginKey }[]

Registers configuration contributed by every child sheet render plugin.

methodregisterState
registerState(): { key: PluginKey; state: SheetGridState }

Registers only the composite grid state; merged ranges have their own plugin owner.

methodrender
render(searCore: SearCoreSheet): Node<CellProperties>[]

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: SearCoreSheet
Sheet core containing data and render services.
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
classSheetGridRendersource ↗
class SheetGridRender extends Plugin<SearCoreSheet, CellProperties, ISheetGridRender>

Renders visible sheet body cells.

constructorconstructor
SheetGridRender(cellVisualReaders: SheetCellVisualReaderRegistry): SheetGridRender

Constructs the body grid renderer.

cellVisualReaders: SheetCellVisualReaderRegistry
propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<ISheetGridRender, object> | readonly PluginDocumentStateContribution<ISheetGridRender, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the body grid renderer.

memberkeyinherited
key: unknown
methodapply
apply(operations: Operation[]): ISheetGridRender

Returns unchanged renderer state for every operation list.

operations: Operation[]
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): { defaultBorderColor: string }

Reads the body grid render configuration from ConfigEngine.

searCore: SearCoreSheet
methodgetStateinherited
getState(): ISheetGridRender

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedStateinherited
lockCommittedState(state: ISheetGridRender): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: ISheetGridRender
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClick
onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): void

Handles double-click interactions on grid cells.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScrollinherited
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: ISheetGridRender, 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.

state: ISheetGridRender
transaction: Transaction
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ defaultBorderColor: string }>; key: PluginKey }[]

Registers default body grid configuration.

methodregisterState
registerState(): { key: PluginKey; state: ISheetGridRender }

Registers the stateless body grid renderer with PluginManager.

methodrender
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders visible grid cells, skipping cells covered by merged ranges.

ReturnsRender nodes for visible body cells.

searCore: SearCoreSheet
Sheet core containing data and render services.
offset: { x: number; y: number }
Offset after accounting for row/column headers.
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: ISheetGridRender, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: ISheetGridRender
commitToken: object
classSheetRowNumberPluginsource ↗
class SheetRowNumberPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetRowNumber>

Renders sticky row header cells for the visible viewport range.

constructorconstructor
SheetRowNumberPlugin(): SheetRowNumberPlugin

Constructs the row header plugin.

propertydepthinherited
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentStateinherited
readonly documentState?: PluginDocumentStateContribution<ISheetRowNumber, object> | readonly PluginDocumentStateContribution<ISheetRowNumber, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIninherited
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.

- ['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol
- ['*'] — called for any transaction (wildcard)
- [] — only called for this plugin's own transactions

propertypluginKeyinherited
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistoryinherited
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOTinherited
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepthinherited
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydefaultConfigstatic
readonly defaultConfig: { defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number }

Default visual configuration for row headers.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the row header plugin.

memberkeyinherited
key: unknown
methodapply
apply(operations: Operation[]): ISheetRowNumber

Returns unchanged plugin state for every transaction.

operations: Operation[]
methoddirtyRectinherited
dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or when null/undefined is returned), dispatch falls
back to a full render pass.

searCore: SearCoreSheet
transaction: Transaction
methodenforceRuntimeWriteBoundaryinherited
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundaryinherited
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreSheet): { defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number }

Reads the row header render configuration from ConfigEngine.

searCore: SearCoreSheet
methodgetStateinherited
getState(): ISheetRowNumber

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundaryinherited
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodinitialize
initialize(): void

Initializes row header runtime state.

methodlockCommittedStateinherited
lockCommittedState(state: ISheetRowNumber): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: ISheetRowNumber
methodonClickinherited
onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:
- Return false to stop subsequent plugins from handling the same event.
- Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers
after it has consumed an event, replacing the old coupled approach where
one plugin directly modified another plugin's state.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited
onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan.
The scan runs once after every plugin state has been registered, so
plugins can build derived indexes without independently traversing the
whole sheet.

searCore: SearCoreSheet
cell: unknown
row: number
col: number
methodonInitialDataCompleteinherited
onInitialDataComplete(searCore: SearCoreSheet): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreSheet
methodonMouseDowninherited
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited
onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreSheet
event: EventWithOffsetAndTarget<CellProperties>
methodonResize
onResize(): void

Row header dimensions are recomputed during render after resize.

methodonScroll
onScroll(_scrollManagerState: ScrollManagerState): void

Row header positions are recomputed during render from scroll state.

_scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited
onTransactionCommitted(transaction: Transaction): 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: Transaction
A committed transaction from the completed pipeline.
methodprojectTransactioninherited
projectTransaction(state: ISheetRowNumber, 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.

state: ISheetRowNumber
transaction: Transaction
methodregisterConfig
registerConfig(): { config: ConfigUnit<{ defaultBackgroundColor: string; defaultBorderColor: string; defaultWidth: number }>; key: PluginKey }[]

Registers default row header configuration.

methodregisterState
registerState(): { key: PluginKey; state: ISheetRowNumber }

Registers the stateless row header plugin with PluginManager.

methodrender
render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties>[]

Renders visible row header cells.

ReturnsRender nodes for visible row headers.

searCore: SearCoreSheet
Sheet core containing data and render services.
offset: { x: number; y: number }
World offset applied by sticky rendering.
methodsealRuntimeMetadatainherited
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethodsinherited
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWritesinherited
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetStateinherited
setState(state: ISheetRowNumber, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: ISheetRowNumber
commitToken: object
interfaceSheetRangePositionContextsource ↗
interface SheetRangePositionContext

Explicit layout inputs required to convert a sheet range to canvas coordinates.

propertycolumnSizes
columnSizes: DimensionsCSRMatrix
propertyoffsetX
offsetX: number
propertyoffsetY
offsetY: number
propertyrowSizes
rowSizes: DimensionsCSRMatrix
interfaceViewportRangesource ↗
interface ViewportRange

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).

propertyendCol
endCol: number
propertyendRow
endRow: number
propertystartCol
startCol: number
propertystartRow
startRow: number
functionactiveFixedRowOffsetssource ↗
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.

fixedRows: FixedRowMatrix | null
rowSizes: DimensionsCSRMatrix
scrollY: number
frozenRows: number
offsetY: number
functioncomputeViewportRangesource ↗
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: ScrollManager
The scroll manager that holds viewport + scroll position
rowSizes: DimensionsCSRMatrix
Row dimension matrix (heights with cumulative boundary lookups)
columnSizes: DimensionsCSRMatrix
Column dimension matrix (widths with cumulative boundary lookups)
offset: { x: number; y: number }
Render offset (e.g. frozen header offsets), added to viewport origin
functiongetSheetRangePositionRectsource ↗
getSheetRangePositionRect(start: Point, end: Point, context: SheetRangePositionContext): PositionRect<undefined> | null

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.

start: Point
end: Point
context: SheetRangePositionContext

Package

@searsuite/sear-sheet-editor-contract

31 exports

Sheet-facing embedded rich-text editor contracts and test fakes without Doc-runtime dependencies.

namespaceSheetEmbeddedEditorsource ↗
SheetEmbeddedEditor: unknown

Static DI token for the Sheet-facing editor abstraction.

variablesymbol
symbol: symbol
classFakeSheetEmbeddedEditorsource ↗
class FakeSheetEmbeddedEditor extends SheetEmbeddedEditor

Small deterministic editor used by Sheet tests. It intentionally models only
the contract boundary, making no assumptions about a concrete Doc runtime.

constructorconstructor
FakeSheetEmbeddedEditor(): FakeSheetEmbeddedEditor
propertycancelCount
cancelCount: number
propertycommittedDocuments
readonly committedDocuments: Schema[][]
propertydisposeCount
disposeCount: number
propertyeditContexts
readonly editContexts: SheetEmbeddedEditorContext[]
propertyinitializeCount
initializeCount: number
propertyinputs
readonly inputs: SheetEditInput[]
propertyobservations
readonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

propertyrenderContexts
readonly renderContexts: SheetEmbeddedEditorContext[]
propertyrenderSessions
readonly renderSessions: FakeRenderSession[]
methodbindTeardownToken
bindTeardownToken(token: object): void

Restricts runtime teardown to the owning Sheet editor when supported.

token: object
methodcreateEditSession
createEditSession(context: SheetEmbeddedEditorContext): SheetEditSession
context: SheetEmbeddedEditorContext
methodcreateRenderSession
createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSession
context: SheetEmbeddedEditorContext
methoddispose
dispose(ownerToken?: object): void
ownerToken: object
methodinitialize
initialize(context: SheetEmbeddedEditorContext): void
context: SheetEmbeddedEditorContext
interfaceSheetCompositionInputsource ↗
interface SheetCompositionInput

IME composition lifecycle input delivered by the Sheet input adapter.

propertytext
readonly text?: string
propertytype
readonly type: "compositionStart" | "compositionUpdate" | "compositionEnd"
interfaceSheetCompositionStatesource ↗
interface SheetCompositionState

Current IME composition state in editor-local coordinates.

propertyactive
readonly active: boolean
propertyrect
readonly rect?: SheetEditorRect
propertytext
readonly text: string
interfaceSheetCursorStatesource ↗
interface SheetCursorState

A cursor rectangle in editor-local coordinates.

propertyrect
readonly rect: SheetEditorRect
propertyvisible
readonly visible?: boolean
interfaceSheetDeleteInputsource ↗
interface SheetDeleteInput

Text deletion delivered by the Sheet input adapter.

propertycount
readonly count?: number
propertydirection
readonly direction: "backward" | "forward"
propertytype
readonly type: "deleteContent"
interfaceSheetDocumentAccessorsource ↗
interface SheetDocumentAccessor

Reads a cell document and commits a new document through the Sheet boundary.

methodcommit
commit(document: SheetDocument): void
document: SheetDocument
methodread
read(): SheetDocument
interfaceSheetEditorGeometrysource ↗
interface SheetEditorGeometry

Cell geometry supplied by Sheet. The editor uses these functions for hit
testing and drawing without knowing how the Sheet viewport is implemented.

propertycellRect
readonly cellRect: SheetEditorRect
propertyclipRect
readonly clipRect?: SheetEditorRect
propertycontainsPoint
readonly containsPoint?: (point: SheetEditorPoint): boolean
propertytoLocalPoint
readonly toLocalPoint: (point: SheetEditorPoint): SheetEditorPoint
propertytoSheetPoint
readonly toSheetPoint: (point: SheetEditorPoint): SheetEditorPoint
interfaceSheetEditorInvalidationsource ↗
interface SheetEditorInvalidation

A rectangle or semantic reason that should be redrawn by Sheet.

propertykind
readonly kind: "selection" | "composition" | "content" | "cursor" | "geometry" | "all"
propertyreason
readonly reason?: string
propertyrects
readonly rects?: readonly SheetEditorRect[]
interfaceSheetEditorPointsource ↗
interface SheetEditorPoint

A point in Sheet or editor-local coordinates.

propertyx
readonly x: number
propertyy
readonly y: number
interfaceSheetEditorRectsource ↗
interface SheetEditorRect

A rectangle in Sheet or editor-local coordinates.

propertyheight
readonly height: number
propertywidth
readonly width: number
propertyx
readonly x: number
propertyy
readonly y: number
interfaceSheetEditRenderOptionssource ↗
interface SheetEditRenderOptions

Per-frame options for painting an active Sheet edit session.

propertycursorVisible
readonly cursorVisible?: boolean

Whether the caret should be painted during this frame.

interfaceSheetEditSessionsource ↗
interface SheetEditSession

An active editing session for one Sheet cell document.

methodcancel
cancel(): void
methodcommit
commit(): readonly Schema[]
methoddispose
dispose(): void
methodgetComposition
getComposition(): SheetCompositionState | null
methodgetCursor
getCursor(): SheetCursorState | null
methodgetDocument
getDocument(): readonly Schema[]
methodgetSelection
getSelection(): SheetTextSelection | null
methodhandleInput
handleInput(input: SheetEditInput): SheetRenderUpdate
input: SheetEditInput
methodhandlePointer
handlePointer(input: SheetPointerInput): SheetRenderUpdate
input: SheetPointerInput
methodrender
render(renderContext?: RenderContext, options?: SheetEditRenderOptions): SheetRenderUpdate

Paints the current edited document, selection, cursor and composition.

renderContext: RenderContext
options: SheetEditRenderOptions
methodsetInlineStyle
setInlineStyle(update: SheetInlineStyleUpdate): SheetRenderUpdate
update: SheetInlineStyleUpdate
methodsetSelection
setSelection(selection: SheetTextSelection): SheetRenderUpdate
selection: SheetTextSelection
interfaceSheetEmbeddedEditorsource ↗
interface SheetEmbeddedEditor

Stable Sheet-facing embedded editor contract. Implementations own rich-text
layout, painting, selection, cursor and IME behavior behind this boundary.

propertyformatting
readonly formatting?: { apply: unknown; capture: unknown }

Pure formatting projection; applying it returns a new snapshot without changing editor state.

propertyobservations
readonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

methodbindTeardownToken
bindTeardownToken(token: object): void

Restricts runtime teardown to the owning Sheet editor when supported.

token: object
methodcreateEditSession
createEditSession(context: SheetEmbeddedEditorContext): SheetEditSession
context: SheetEmbeddedEditorContext
methodcreateRenderSession
createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSession
context: SheetEmbeddedEditorContext
methoddispose
dispose(ownerToken?: object): void
ownerToken: object
methodinitialize
initialize(context: SheetEmbeddedEditorContext): void
context: SheetEmbeddedEditorContext
interfaceSheetEmbeddedEditorContextsource ↗
interface SheetEmbeddedEditorContext

Context in which a Sheet cell editor renders and edits one cell document.

propertydefaultFontFamily
readonly defaultFontFamily?: string

Host-selected default font family for read-only Sheet cell rendering.

propertydefaultFontSize
readonly defaultFontSize?: number

Host-selected default font size for read-only Sheet cell rendering.

propertydocumentAccessor
readonly documentAccessor: SheetDocumentAccessor
propertygeometry
readonly geometry: SheetEditorGeometry
propertyinvalidate
readonly invalidate?: (invalidation: SheetEditorInvalidation): void
propertyisCommandExecuting
readonly isCommandExecuting?: (): boolean

Present in assembled Sheets to require command dispatch for edit-session mutations.

propertyrenderContext
readonly renderContext: RenderContext
interfaceSheetEmbeddedInlineStyleStatussource ↗
interface SheetEmbeddedInlineStyleStatus

Whether one inline style can be applied, is active, and has a common value.

propertyactive
readonly active: boolean
propertyenabled
readonly enabled: boolean
propertyvalue
readonly value: unknown

The common selected value, or null when unset or mixed.

interfaceSheetInlineStyleUpdatesource ↗
interface SheetInlineStyleUpdate

An inline style patch applied to the active text selection.

propertyattrs
readonly attrs: Readonly<Record<string, unknown>>
interfaceSheetInputModifierssource ↗
interface SheetInputModifiers

Modifier keys normalized by the Sheet host.

propertyaltKey
readonly altKey?: boolean
propertyctrlKey
readonly ctrlKey?: boolean
propertymetaKey
readonly metaKey?: boolean
propertyshiftKey
readonly shiftKey?: boolean
interfaceSheetKeyInputsource ↗
interface SheetKeyInput extends SheetInputModifiers

Keyboard input that the embedded editor may consume for navigation or editing.

propertyaltKeyinherited
readonly altKey?: boolean
propertycode
readonly code?: string
propertyctrlKeyinherited
readonly ctrlKey?: boolean
propertykey
readonly key: string
propertymetaKeyinherited
readonly metaKey?: boolean
propertyshiftKeyinherited
readonly shiftKey?: boolean
propertytype
readonly type: "keyDown"
interfaceSheetPointerHitsource ↗
interface SheetPointerHit

Result of pointer hit testing against the embedded document.

propertyposition
readonly position?: SheetTextPosition
propertyselection
readonly selection?: SheetTextSelection
propertytarget
readonly target: "text" | "empty" | "outside"
interfaceSheetPointerInputsource ↗
interface SheetPointerInput extends SheetInputModifiers

Pointer input normalized by the Sheet host.

propertyaltKeyinherited
readonly altKey?: boolean
propertybuttons
readonly buttons?: number
propertyclickCount
readonly clickCount?: number
propertyctrlKeyinherited
readonly ctrlKey?: boolean
propertymetaKeyinherited
readonly metaKey?: boolean
propertypoint
readonly point: SheetEditorPoint
propertyshiftKeyinherited
readonly shiftKey?: boolean
propertytype
readonly type: "pointerDown" | "pointerMove" | "pointerUp"
interfaceSheetRenderSessionsource ↗
interface SheetRenderSession

A retained render session for one Sheet cell document.

methoddispose
dispose(): void
methodhitTest
hitTest(input: SheetPointerInput): SheetPointerHit | null
input: SheetPointerInput
methodrender
render(renderContext?: RenderContext): SheetRenderUpdate

Paints the current document into the supplied render target.

renderContext: RenderContext
interfaceSheetRenderUpdatesource ↗
interface SheetRenderUpdate

State returned after a render or edit operation.

propertycomposition
readonly composition?: SheetCompositionState
propertycontentSize
readonly contentSize?: { height: number; width: number }
propertycursor
readonly cursor?: SheetCursorState
propertyinvalidation
readonly invalidation?: SheetEditorInvalidation
propertyneedsRedraw
readonly needsRedraw: boolean
propertyselection
readonly selection?: SheetTextSelection
interfaceSheetTextInputsource ↗
interface SheetTextInput

Text insertion delivered by the Sheet input adapter.

propertytext
readonly text: string
propertytype
readonly type: "insertText"
interfaceSheetTextPositionsource ↗
interface SheetTextPosition

A position in the rich document represented by a node path and text offset.

propertyoffset
readonly offset: number
propertypath
readonly path: readonly string | number[]
interfaceSheetTextSelectionsource ↗
interface SheetTextSelection

A text selection represented by anchor and head positions.

propertyanchor
readonly anchor: SheetTextPosition
propertyhead
readonly head: SheetTextPosition
typeSheetDocumentsource ↗
type SheetDocument = readonly SheetDocumentNode[]

A rich-document snapshot owned by the Sheet cell boundary.

typeSheetDocumentNodesource ↗
type SheetDocumentNode = Schema

A document node exchanged between a Sheet cell and an embedded editor.

typeSheetEditInputsource ↗
type SheetEditInput = SheetTextInput | SheetDeleteInput | SheetCompositionInput | SheetKeyInput

Input accepted by an active Sheet edit session.

typeSheetEmbeddedInlineStyleStatesource ↗
type SheetEmbeddedInlineStyleState = Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>

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.

variableSheetEmbeddedInlineStyleObservationsource ↗
SheetEmbeddedInlineStyleObservation: StateObservationDefinition<Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>>

Current inline-style availability and activation for the embedded selection.