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
Typed command definitions and transaction factories shared by editor composition roots.
- classDocCommandBussource ↗
-
class DocCommandBusThe supported execution entry point for document user and program actions.
constructorconstructor DocCommandBus(platform?: Platform): DocCommandBusCreates a command bus that reports boundary diagnostics through the host platform.
platform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the command bus bound to one document editor instance.
methodbind bind(context: DocCommandContext): voidBinds the command bus to the runtime services for one editor instance.
context: DocCommandContext
methoddestroy destroy(): voidClears editor binding, listeners, and command registrations during teardown.
methodenforceRegistrationBoundary enforceRegistrationBoundary(assertWrite: (): void): voidCloses 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>): booleanReturns whether this editor instance currently exposes a document command id.
definition: string | DocCommandDefinition<unknown, DocCommandResult>
methodisExecuting isExecuting(): booleanWhether this editor's command bus is currently dispatching a command.
methodregister register<Definition>(definition: Definition, factory: DocCommandFactory<Definition>): (): voidRegisters one feature-owned command factory. The returned function must be
called by lifecycle cleanup when a feature registers dynamically.definition: Definitionfactory: DocCommandFactory<Definition>
methodrun run<Definition>(definition: Definition, input: DocCommandInput<Definition>): DocCommandDefinitionResult<Definition>Executes a registered command through its feature-owned typed definition.
definition: Definitioninput: DocCommandInput<Definition>
methodrunWithoutMutationAuthority runWithoutMutationAuthority<Value>(callback: (): Value): ValueInvokes external observers without inheriting this editor's command write authority.
callback: (): Value
methodsubscribe subscribe(listener: DocCommandListener): (): voidSubscribes to document command lifecycle events and returns an unsubscribe function.
listener: DocCommandListener
- classDocCommandDispatchersource ↗
-
class DocCommandDispatcherExecutes document command objects against one command context.
constructorconstructor DocCommandDispatcher(): DocCommandDispatchermethodexecute execute<Result>(context: DocCommandContext, command: DocEditorCommand<Result>): ResultRuns a command, validates its result and applies its operation/effects.
context: DocCommandContextcommand: DocEditorCommand<Result>
- classEffectCommandsource ↗
-
class EffectCommand extends SheetCommand<SheetCommandResult>Command that emits local effects without mutating OT state.
constructorconstructor EffectCommand(effects: readonly SheetCommandEffect[]): EffectCommandCreates an effect-only command.
effects: readonly SheetCommandEffect[]
propertyid readonly id: "effect.apply"Stable id for effect-only command execution.
methodexecute execute(_context: SheetCommandContext): SheetCommandResultReturns 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): LocalActionCommandCreates a command that schedules one local action in a pipeline.
id: stringrun: (): void
propertyid readonly id: stringStable, domain-owned command identifier for observability and automation.
methodexecute execute(_context: SheetCommandContext): SheetCommandResultReturns 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): PipelineExecutionCommandCreates a command around an existing named pipeline.
id: stringpipeline: Pipeline
propertyid readonly id: stringStable, domain-owned command identifier for observability and automation.
methodexecute execute(_context: SheetCommandContext): SheetCommandResultReturns the provided pipeline unchanged.
_context: SheetCommandContext
- classSheetAxisMoveBoundsErrorsource ↗
-
class SheetAxisMoveBoundsError extends SearErrorA requested block or insertion boundary falls outside its axis.
constructorconstructor SheetAxisMoveBoundsError(input: SheetMoveAxisInput, size: number): SheetAxisMoveBoundsErrorinput: SheetMoveAxisInputsize: number
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_AXIS_MOVE_BOUNDS"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSheetCommandBussource ↗
-
class SheetCommandBusThe 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): SheetCommandBusCreates a command bus that reports boundary diagnostics through the host platform.
platform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the command bus bound to one editor instance.
methodbind bind(context: SheetCommandContext): voidBinds the command bus to the runtime services for one editor instance.
context: SheetCommandContext
methoddestroy destroy(): voidClears editor binding, listeners and command registrations during teardown.
methodenforceRegistrationBoundary enforceRegistrationBoundary(assertWrite: (): void): voidCloses 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>): booleanReturns whether this editor instance currently exposes a command id.
definition: string | SheetCommandDefinition<unknown, SheetCommandResult>
methodisExecuting isExecuting(): booleanWhether this editor's command bus is currently dispatching a command.
methodregister register<Definition>(definition: Definition, factory: SheetCommandFactory<Definition>): (): voidRegisters one feature-owned command factory. The returned function must be
called by the feature's lifecycle cleanup when it registers dynamically.definition: Definitionfactory: SheetCommandFactory<Definition>
methodrun run<Definition>(definition: Definition, input: SheetCommandInput<Definition>): SheetCommandDefinitionResult<Definition>Executes a registered command through its feature-owned typed definition.
definition: Definitioninput: SheetCommandInput<Definition>
methodrunWithoutMutationAuthority runWithoutMutationAuthority<Value>(callback: (): Value): ValueInvokes external observers without inheriting this editor's command write authority.
callback: (): Value
methodsubscribe subscribe(listener: SheetCommandListener): (): voidSubscribes to command lifecycle events and returns an unsubscribe function.
listener: SheetCommandListener
- classSheetCommandDispatchersource ↗
-
class SheetCommandDispatcherExecutes command objects against one command context.
constructorconstructor SheetCommandDispatcher(): SheetCommandDispatchermethodexecute execute<Result>(context: SheetCommandContext, command: SheetCommand<Result>): ResultRuns a command, validates its result and applies its pipeline/effects.
context: SheetCommandContextcommand: SheetCommand<Result>
- classSheetQueryRegistrysource ↗
-
class SheetQueryRegistryEditor-local registry for typed, side-effect-free sheet queries.
constructorconstructor SheetQueryRegistry(): SheetQueryRegistrypropertysymbolstatic readonly symbol: typeof symbolmethoddestroy destroy(): voidmethodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for registration changes after assembly.
assertWrite: (): void
methodgetRegisteredQueryIds getRegisteredQueryIds(): readonly string[]methodhas has(definition: string | SheetQueryDefinition<unknown, unknown>): booleandefinition: string | SheetQueryDefinition<unknown, unknown>
methodregister register<Definition>(definition: Definition, handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>): (): voiddefinition: Definitionhandler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>
methodrun run<Definition>(definition: Definition, input: SheetQueryInput<Definition>): SheetQueryResult<Definition>definition: Definitioninput: SheetQueryInput<Definition>
- classTransactionPipelineCommandsource ↗
-
class TransactionPipelineCommand extends SheetCommand<SheetCommandResult>Executes an already-created transaction through the pipeline command boundary.
constructorconstructor TransactionPipelineCommand(id: string, transaction: Transaction): TransactionPipelineCommandCreates a command around an existing transaction.
id: stringtransaction: Transaction
propertyid readonly id: stringStable, domain-owned command identifier for observability and automation.
methodexecute execute(_context: SheetCommandContext): SheetCommandResultConverts the provided transaction into a pipeline result.
_context: SheetCommandContext
- interfaceDocCommandContextsource ↗
-
interface DocCommandContextRuntime services exposed to document commands while they execute.
methodapplyEffect applyEffect(effect: DocCommandEffect): voidApplies a local UI/runtime effect after the operation has been committed.
effect: DocCommandEffect
methodexecutePipeline executePipeline(pipeline: Pipeline): voidExecutes 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]: InputPhantom field that preserves the command input type for callers.
property[docCommandResultType] readonly [docCommandResultType]: ResultPhantom field that preserves the command result type for callers.
propertyid readonly id: stringGlobally stable command id owned by the document feature package that defines it.
- interfaceDocCommandEventsource ↗
-
interface DocCommandEventLifecycle event emitted by the document command bus for diagnostics and host UI.
propertyerror readonly error?: unknownOriginal thrown value when the command failed.
propertyid readonly id: stringStable command id being executed.
propertyphase readonly phase: CommandExecutionPhaseExecution phase represented by this event.
propertyresult readonly result?: DocCommandResultResult returned by a completed command.
- interfaceDocCommandResultsource ↗
-
interface DocCommandResultStandard command result that document Core can execute and observe.
- interfaceDocEditorCommandsource ↗
-
interface DocEditorCommand<Result>Executable unit behind a typed document command definition.
- interfaceExtendSelectionCommandInputsource ↗
-
interface ExtendSelectionCommandInputInput required to extend a sheet selection by keyboard navigation.
propertycursor readonly cursor: SelectionPointCurrent moving edge before this navigation step.
propertydirection readonly direction: SelectionMoveDirectionDirection requested by the user.
propertyfindMerge readonly findMerge: (point: SelectionPoint): { end: SelectionPoint; start: SelectionPoint } | undefinedLookup for merged ranges that should be selected as a whole.
propertyjumpToEdge readonly jumpToEdge?: booleanWhether navigation should jump to the sheet edge.
propertylastCol readonly lastCol: numberLast valid column index.
propertylastRow readonly lastRow: numberLast valid row index.
propertyorigin readonly origin: SelectionPointFixed selection anchor where extension began.
- interfaceMoveSelectionCommandInputsource ↗
-
interface MoveSelectionCommandInputPublic contract for MoveSelectionCommandInput.
propertydirection readonly direction: SelectionMoveDirectionpropertyfindMerge readonly findMerge: (point: SheetPoint): SheetMergedCellRange | undefinedpropertyfocus readonly focus: SheetPointpropertyjumpToEdge readonly jumpToEdge?: booleanpropertylastCol readonly lastCol: numberpropertylastRow readonly lastRow: number - interfaceMoveSelectionCommandResultsource ↗
-
interface MoveSelectionCommandResultPublic contract for MoveSelectionCommandResult.
- interfaceSelectRangeCommandInputsource ↗
-
interface SelectRangeCommandInputPublic contract for SelectRangeCommandInput.
- interfaceSelectRangeCommandResultsource ↗
-
interface SelectRangeCommandResultPublic contract for SelectRangeCommandResult.
- interfaceSheetClearRangeContentsCommandDataSourcesource ↗
-
interface SheetClearRangeContentsCommandDataSource<Cell>Sheet cell data required to create clear-contents operations.
propertytarget readonly target: PluginKeyPlugin key that owns the persisted sheet data matrix.
methodgetColumnCount getColumnCount(): numberCurrent column count.
methodgetRowCount getRowCount(): numberCurrent row count.
methodreadCell readCell(row: number, column: number): Cell | nullReads the current cell value at
row,column.row: numbercolumn: number
- interfaceSheetClearRangeContentsInputsource ↗
-
interface SheetClearRangeContentsInput extends SheetRangeInputPublic input for clearing persisted contents in a range.
- interfaceSheetCommandsource ↗
-
interface SheetCommand<Result>Executable unit behind a typed command definition.
- interfaceSheetCommandContextsource ↗
-
interface SheetCommandContextRuntime services exposed to commands while they execute.
methodapplyEffect applyEffect(effect: SheetCommandEffect): voidApplies a local UI/runtime effect after pipeline execution.
effect: SheetCommandEffect
methodexecutePipeline executePipeline(pipeline: Pipeline): voidApplies 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]: InputPhantom field that preserves the command input type for callers.
property[sheetCommandResultType] readonly [sheetCommandResultType]: ResultPhantom field that preserves the command result type for callers.
propertyid readonly id: stringGlobally stable command id owned by the feature package that defines it.
- interfaceSheetCommandEventsource ↗
-
interface SheetCommandEventLifecycle event emitted by the command bus for diagnostics and host UI.
propertyerror readonly error?: unknownOriginal thrown value when the command failed.
propertyid readonly id: stringStable command id being executed.
propertyphase readonly phase: CommandExecutionPhaseExecution phase represented by this event.
propertyresult readonly result?: SheetCommandResultSuccessfully executed command result, present only for the completed phase.
- interfaceSheetCommandResultsource ↗
-
interface SheetCommandResultStandard 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: PipelinePipeline containing transaction, render, interaction and local-action steps.
- interfaceSheetDeleteColumnsInputsource ↗
-
interface SheetDeleteColumnsInputPublic input for deleting columns starting at
index. - interfaceSheetDeleteRowsInputsource ↗
-
interface SheetDeleteRowsInputPublic input for deleting rows starting at
index. - interfaceSheetInsertColumnsInputsource ↗
-
interface SheetInsertColumnsInputPublic input for inserting columns before
index. - interfaceSheetInsertRowsInputsource ↗
-
interface SheetInsertRowsInputPublic input for inserting rows before
index. - interfaceSheetMoveAxisInputsource ↗
-
interface SheetMoveAxisInputMoves a contiguous block before a boundary in the original axis (0 through size).
- interfaceSheetQueryDefinitionsource ↗
-
interface SheetQueryDefinition<Input, Result>A stable query identifier carrying its input and result contract.
property__input readonly __input?: Inputproperty__result readonly __result?: Resultpropertyid readonly id: stringpropertyresultMode readonly resultMode?: "reader"Reader queries return a live, read-only projection instead of a data snapshot.
- interfaceSheetRangeBoundssource ↗
-
interface SheetRangeBoundsNormalized rectangular sheet range bounds expressed as inclusive cell coordinates.
- interfaceSheetRangeInputsource ↗
-
interface SheetRangeInputCommon range input accepted by explicit range commands.
- interfaceSheetStructureCommandDataSourcesource ↗
-
interface SheetStructureCommandDataSource<Cell>Sheet matrix access used by structure commands without depending on a concrete data package.
propertytarget readonly target: PluginKeyPlugin key that owns the persisted sheet data matrix.
methodgetColumnCount getColumnCount(): numberCurrent column count.
methodgetRowCount getRowCount(): numberCurrent 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 = conditionalExtracts 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 = conditionalExtracts the input contract from a typed document command definition.
- typeDocCommandListenersource ↗
-
type DocCommandListener = (event: DocCommandEvent): voidObserver 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 = conditionalExtracts 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 = conditionalExtracts the input contract from a typed command definition.
- typeSheetCommandListenersource ↗
-
type SheetCommandListener = (event: SheetCommandEvent): voidObserver 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: SheetClearRangeContentsInputdataSource: 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: SheetDeleteColumnsInputdataSource: 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: SheetDeleteRowsInputdataSource: Pick<SheetStructureCommandDataSource, "getRowCount" | "readRow">
- functioncreateInsertColumnOperationssource ↗
-
createInsertColumnOperations(input: SheetInsertColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount">): InsertColOTOperation<unknown>[]Creates ColInsert operations from public command input.
input: SheetInsertColumnsInputdataSource: Pick<SheetStructureCommandDataSource, "getRowCount">
- functioncreateInsertRowOperationssource ↗
-
createInsertRowOperations(input: SheetInsertRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount">): InsertRowOTOperation<unknown>[]Creates RowInsert operations from public command input.
input: SheetInsertRowsInputdataSource: Pick<SheetStructureCommandDataSource, "getColumnCount">
- functioncreateMoveColumnsOperationssource ↗
-
createMoveColumnsOperations(input: SheetMoveAxisInput, size: number): MoveColOTOperation<unknown>[]Creates column swaps implementing insertion at an original column boundary.
input: SheetMoveAxisInputsize: number
- functioncreateMoveRowsOperationssource ↗
-
createMoveRowsOperations(input: SheetMoveAxisInput, size: number): MoveRowOTOperation<unknown>[]Creates row swaps implementing insertion at an original row boundary.
input: SheetMoveAxisInputsize: number
- functioncreateSheetTransactionsource ↗
-
createSheetTransaction<OperationType>(target: PluginKey, operations: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): TransactionCreates a transaction for command factories that need to produce pipeline transactions internally.
target: PluginKeyoperations: 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): MoveSelectionCommandResultResolves navigation as a sheet interaction, including merged-range boundaries.
input: MoveSelectionCommandInput
- functionregisterSheetRangeCommandssource ↗
-
registerSheetRangeCommands(commands: SheetCommandBus, dataSource: SheetRangeCommandDataSource): voidRegisters the built-in range commands on one sheet command bus.
commands: SheetCommandBusdataSource: SheetRangeCommandDataSource
- functionregisterSheetStructureCommandssource ↗
-
registerSheetStructureCommands(commands: SheetCommandBus, dataSource: SheetStructureCommandDataSource, moves?: SheetStructureMoveRegistry): voidRegisters the default sheet row/column structure commands.
commands: SheetCommandBusdataSource: SheetStructureCommandDataSourcemoves: SheetStructureMoveRegistry
- functionselectRangesource ↗
-
selectRange(input: SelectRangeCommandInput): SelectRangeCommandResultNormalizes pointer or test-provided ranges so intersected merged cells are selected whole.
input: SelectRangeCommandInput
- classSheetQueryBussource ↗
-
class SheetQueryBusEditor-local registry for typed, side-effect-free sheet queries.
constructorconstructor SheetQueryRegistry(): SheetQueryRegistrypropertysymbolstatic readonly symbol: typeof symbolmethoddestroy destroy(): voidmethodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for registration changes after assembly.
assertWrite: (): void
methodgetRegisteredQueryIds getRegisteredQueryIds(): readonly string[]methodhas has(definition: string | SheetQueryDefinition<unknown, unknown>): booleandefinition: string | SheetQueryDefinition<unknown, unknown>
methodregister register<Definition>(definition: Definition, handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>): (): voiddefinition: Definitionhandler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>
methodrun run<Definition>(definition: Definition, input: SheetQueryInput<Definition>): SheetQueryResult<Definition>definition: Definitioninput: SheetQueryInput<Definition>
Package
@searsuite/sear-assembly-config
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: TConfiginitialConfig: EditorDefaultConfigOverrides<TConfig>
propertysymbolstatic readonly symbol: symbolDI token for resolving the shared configuration engine.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidSeals retained configuration handles after editor initialization.
isCommandExecuting: (): boolean
methodgetCombinedConfig getCombinedConfig<T>(): ConfigUnit<T> & TGet merged config of all plugins
ReturnsMerged config
methodgetDefaultConfig getDefaultConfig(): TConfigReturns this editor's defaults merged with its host/runtime overrides.
methodgetPluginConfig getPluginConfig<T>(pluginKey: ConfigKey): ConfigUnit<T> & T | undefinedGet config of specified plugin
ReturnsPlugin configuration
pluginKey: ConfigKey- Stable key whose configuration should be returned.
methodregisterPluginConfig registerPluginConfig<T>(pluginKey: ConfigKey, pluginConfig: T): voidRegister plugin config
pluginKey: ConfigKey- Stable key that owns the configuration.
pluginConfig: T- Plugin config
methodupdateDefaultConfigOverrides updateDefaultConfigOverrides(overrides: EditorDefaultConfigOverrides<TConfig>): voidMerges 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 DocConfigConfiguration owned by a standalone Doc editor.
propertydevicePixelRatio readonly devicePixelRatio: numberpropertydocFontFamily readonly docFontFamily: stringpropertydocFontSize readonly docFontSize: numberpropertydocLineHeightMultiplier readonly docLineHeightMultiplier: numberDefault paragraph line-height multiplier used by standalone Doc.
propertydocParagraphSpacingAfter readonly docParagraphSpacingAfter: numberDefault paragraph spacing after each non-final block.
propertydocVerticalAlign readonly docVerticalAlign: "center" | "top"propertyincrementalRenderPolicyLimits readonly incrementalRenderPolicyLimits: IncrementalRenderPolicyLimitsConfig - interfaceIncrementalRenderPolicyLimitsConfigsource ↗
-
interface IncrementalRenderPolicyLimitsConfigGuardrails for accepting an incremental document render plan.
propertymaxCopiedAreaRatio readonly maxCopiedAreaRatio: numberpropertymaxCopyCount readonly maxCopyCount: numberpropertymaxInvalidAreaRatio readonly maxInvalidAreaRatio: numberpropertymaxInvalidRectCount readonly maxInvalidRectCount: number - interfaceSheetConfigsource ↗
-
interface SheetConfigConfiguration owned by a standalone Sheet editor.
propertycellPadding readonly cellPadding: numberpropertydefaultCellAlign readonly defaultCellAlign: SheetHorizontalAlignmentpropertydefaultCellVerticalAlign readonly defaultCellVerticalAlign: SheetVerticalAlignmentpropertydefaultColumnSize readonly defaultColumnSize: numberpropertydefaultRowSize readonly defaultRowSize: numberpropertydevicePixelRatio readonly devicePixelRatio: numberpropertysheetCellFontFamily readonly sheetCellFontFamily: stringpropertysheetCellFontSize readonly sheetCellFontSize: numberpropertysheetOffsetX readonly sheetOffsetX: numberpropertysheetOffsetY readonly sheetOffsetY: number - typeEditorDefaultConfigOverridessource ↗
-
type EditorDefaultConfigOverrides = Partial<TConfig> & Record<string, unknown>Host-provided overrides for one editor-owned configuration object.
- variabledefaultDocConfigsource ↗
-
defaultDocConfig: DocConfigBuilt-in defaults for standalone Doc editors.
- variabledefaultSheetConfigsource ↗
-
defaultSheetConfig: SheetConfigBuilt-in defaults for ordinary Sheet cells and Sheet viewport services.
Package
@searsuite/sear-assembly-core
The staged Sheet and Doc runtimes that execute pipelines and commit transactions.
- enumPipelineStepKindsource ↗
-
enum PipelineStepKindBuilt-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 PipelineLifecycleConsole 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(): ConsolePipelineLoggermethodonComplete onComplete(_pipeline: Pipeline, rendered: boolean): voidHandles the complete lifecycle event.
_pipeline: Pipelinerendered: boolean
methodonStart onStart(pipeline: Pipeline): voidHandles the start lifecycle event.
pipeline: Pipeline
methodonStepComplete onStepComplete(step: PipelineStep, _pipeline: Pipeline): voidHandles the step complete lifecycle event.
step: PipelineStep_pipeline: Pipeline
methodonStepStart onStepStart(step: PipelineStep, _pipeline: Pipeline, detail: string): voidHandles the step start lifecycle event.
step: PipelineStep_pipeline: Pipelinedetail: string
- classDocCompositionManagersource ↗
-
class DocCompositionManager extends DocCompositionProviderOwns optional IME composition state independently from cursor and selection state.
constructorconstructor DocCompositionManager(textShaper: TextShaper): DocCompositionManagertextShaper: TextShaper
propertysymbolstatic readonly symbol: symbolDI token for resolving DocCompositionManager.
methodclear clear(teardownToken?: object): voidClears all composing state.
teardownToken: object
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken?: object): voidCloses direct composition writes after editor assembly.
isCommandExecuting: (): booleanteardownToken: object
methodgetCaretOffset getCaretOffset(): numberReturns the logical caret offset inside the composing text.
methodgetCaretPixelOffset getCaretPixelOffset(): numberReturns the latest measured caret pixel offset.
methodgetText getText(): stringReturns the current composing text.
methodmeasure measure(font?: string): DocCompositionLayoutMeasures current composing text and records the caret pixel offset for rendering.
font: string
methodsetText setText(text: string, caretOffset?: number): voidUpdates the active composing text and logical caret offset.
text: stringcaretOffset: number
- classDocCursorManagersource ↗
-
class DocCursorManagerInjectable singleton that bridges document input state and render-node drawing.
- The plugin computes pixel cursor coordinates (via DocLayoutEngine) and
callssetCursor()before triggering a rerender.
- Document overlay render nodes readgetCursor()and draw the cursor bar if set.
- clearCursor() is called on edit-session end so stale state is never drawn.constructorconstructor DocCursorManager(): DocCursorManagerpropertysymbolstatic readonly symbol: symbolDI token for resolving DocCursorManager.
methodclearCursor clearCursor(teardownToken?: object): voidClear cursor and selection state (call on edit-session end).
teardownToken: object
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken: object): voidSeals assembled cursor writes while preserving command-owned rendering.
isCommandExecuting: (): booleanteardownToken: object
methodgetCursor getCursor(): CursorRenderInfo | nullRead the cursor render info. Returns null when no edit session is active.
methodgetSelectionRects getSelectionRects(): SelectionRect[]Read the selection highlight rectangles.
methodsetCursor setCursor(info: CursorRenderInfo): voidSet (or update) the cursor render info for the upcoming draw call.
info: CursorRenderInfo
methodsetSelectionRects setSelectionRects(rects: SelectionRect[]): voidSet selection highlight rectangles for the upcoming draw call.
rects: SelectionRect[]
- classDocImmediateRenderPaintersource ↗
-
class DocImmediateRenderPainterShared painter for embedded rich-document content and transient viewport output.
constructorconstructor DocImmediateRenderPainter(cursorManager: DocCursorManager, scrollManager: ScrollManager, lineRenderer: RichTextLineRenderer, compositionManager?: DocCompositionManager | null): DocImmediateRenderPainterCreates a painter over the document cursor and scroll services.
cursorManager: DocCursorManagerscrollManager: ScrollManagerlineRenderer: RichTextLineRenderercompositionManager: DocCompositionManager | null
methoddrawContent drawContent(context: RenderContext, input: DocImmediateRenderPainterContentInput): voidDraws text lines from a layout snapshot in the caller's current transform.
context: RenderContextinput: DocImmediateRenderPainterContentInput
methoddrawSelectionRectsInViewport drawSelectionRectsInViewport(context: RenderContext): voidDraws selection rectangles in viewport coordinates under an identity transform.
context: RenderContext
methoddrawSelectionRectsInWorld drawSelectionRectsInWorld(context: RenderContext): voidDraws selection rectangles using the caller's current world transform.
context: RenderContext
methoddrawTextCursorOverlayInViewport drawTextCursorOverlayInViewport(context: RenderContext): voidDraws 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): DocInputPluginConstructs the document input plugin with editor-session state only.
docLayoutEngine: DocLayoutEngineplatform: Platform
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for document input state.
propertysymbolstatic readonly symbol: symbolDI token for resolving the document input plugin.
memberkeyinherited key: unknownmembersession session: unknownmethodapply apply(state: DocInputState, transaction: Transaction): DocInputState | nullApplies rich-document OT transactions owned by the document input plugin.
state: DocInputStatetransaction: Transaction
methodclearSession clearSession(): voidClears the current edit session state.
methodcreateArrowTransaction createArrowTransaction(direction: DocCursorDirection, shiftKey: boolean): TransactionBuilds a transaction for arrow-key cursor navigation.
direction: DocCursorDirectionshiftKey: boolean
methodcreateDeleteTransaction createDeleteTransaction(): TransactionBuilds a transaction for Backspace deletion.
methodcreateInputTransaction createInputTransaction(text: string): TransactionBuilds a transaction for committed text input.
text: string
methodcreateReplaceDocumentTransaction createReplaceDocumentTransaction(document: RichDocNode[], selection?: DocSelection): TransactionBuilds a RichDoc OT transaction that replaces the active document session.
document: RichDocNode[]selection: DocSelection
methodcreateSelectAllTransaction createSelectAllTransaction(): TransactionBuilds a transaction that selects all content in the current document session.
methodcreateSoftEnterTransaction createSoftEnterTransaction(): TransactionBuilds a transaction for soft-enter paragraph splitting.
methodcreateTransaction createTransaction(command: DocCommand, docTransaction?: DocTransaction): TransactionBuilds a workspace transaction from a rich-document domain command.
command: DocCommanddocTransaction: DocTransaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceSessionWriteBoundary enforceSessionWriteBoundary(isCommandExecuting: (): boolean, commitToken: object, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidBinds the owning editor's command and commit boundary after initial state registration.
isCommandExecuting: (): booleancommitToken: objectrunWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetLastSnapshot getLastSnapshot(): LayoutSnapshot | nullReturns the derived layout snapshot used for vertical cursor movement.
methodgetPluginConfig getPluginConfig(_searCore: SearCoreDoc): nullDocument input has no plugin configuration.
_searCore: SearCoreDoc
methodgetStateinherited getState(): DocInputStateReturns the plugin-owned state currently registered with the manager.
methodhandleArrow handleArrow(direction: DocCursorDirection, shiftKey: boolean): DocInputDispatchResultHandles arrow-key cursor navigation.
direction: DocCursorDirectionshiftKey: boolean
methodhandleDelete handleDelete(): DocInputDispatchResultHandles Backspace deletion.
methodhandleInput handleInput(text: string): DocInputDispatchResultHandles committed text input.
text: string
methodhandleSelectAll handleSelectAll(): DocInputDispatchResultSelects all content in the current document session.
methodhandleSoftEnter handleSoftEnter(): DocInputDispatchResultHandles soft-enter paragraph splitting.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: DocInputState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: DocInputState
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidPublishes 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: DocInputStatetransaction: 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>[] | nullDocument input does not render scene nodes directly.
_searCore: SearCoreDoc
methodresetSession resetSession(doc: RichDocNode[], selection?: DocSelection): voidReplaces the current edit session document and selection.
doc: RichDocNode[]selection: DocSelection
methodrestoreSelection restoreSelection(selection: DocSelection): voidReplaces local selection during session restoration without changing document content.
selection: DocSelection
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsealSessionRestoration sealSessionRestoration(): voidCloses the document initialization and session restoration phase.
methodsetLastSnapshot setLastSnapshot(snapshot: LayoutSnapshot | null): voidStores the last layout snapshot for cursor navigation.
snapshot: LayoutSnapshot | null
methodsetStateinherited setState(state: DocInputState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: DocInputStatecommitToken: object
methodsubscribeDocument subscribeDocument(listener: (): void): (): voidSubscribes to committed document projection changes.
listener: (): void
methodsubscribeSelection subscribeSelection(listener: (): void): (): voidSubscribes 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>): DocRenderEngineCreates a render engine for one document editor instance.
scrollManager: ScrollManagerrenderContext: RenderContextconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeProperties>renderStrategyManager: RenderStrategyManager<NodeProperties>screenRenderStrategy: ScreenRenderStrategy<NodeProperties>dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>stickyRenderStrategy: StickyRenderStrategy<NodeProperties>overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>
propertyconfigEngineinherited readonly configEngine: ConfigEnginepropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyrenderStrategyManagerinherited readonly renderStrategyManager: RenderStrategyManager<NodeProperties>propertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertysymbolstatic readonly symbol: symbolDI token for resolving DocRenderEngine.
methodgetLastScreenRenderMode getLastScreenRenderMode(): ScreenRenderFrameMode | nullReturns the screen strategy mode used by the last render pass, if it painted.
methodinitialize initialize(): voidInitializes DocRenderEngine.
methodinvalidateScreenCache invalidateScreenCache(): voidInvalidates the off-screen body cache used by the screen strategy.
methodmarkDirty markDirty(rect: PositionRect<templateLiteral>): voidMarks one document-world rectangle dirty for the next dirty pass.
rect: PositionRect<templateLiteral>
methodrender render(node: Node<NodeProperties>): voidRuns the configured document render strategies over the current scene graph.
node: Node<NodeProperties>
methodresize resize(width: number, height: number, scale: number): voidResizes all Doc render layers and invalidates screen-cache reuse.
width: numberheight: numberscale: number
methodsetBlockRasterCopyPlan setBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): voidSupplies one layout-shift raster-copy plan for the next screen render pass.
plan: BlockRasterCopyPlan | null
methodsetViewport setViewport(viewport: DocRenderViewport): voidUpdates the viewport model used by subsequent render frames.
viewport: DocRenderViewport
methodsetViewScale setViewScale(scale: number): voidUpdates the view scale on every render strategy context.
scale: number
- classNoopDocCompositionProvidersource ↗
-
class NoopDocCompositionProvider extends DocCompositionProviderNull provider used when no composition plugin is installed.
constructorconstructor NoopDocCompositionProvider(): NoopDocCompositionProvidermethodmeasure measure(_font: string): DocCompositionLayoutMeasures no composing text.
_font: string
- classPipelinesource ↗
-
class PipelineAn 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 viause().
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): PipelineCreates 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: stringpropertysteps readonly steps: PipelineStep[]Ordered steps that will be executed by the pipeline executor.
methodadd add(stepName: string, transaction: Transaction): thisAppend a transaction step (shorthand).
stepName: stringtransaction: Transaction
methodaddCustom addCustom(stepName: string, kind: string, data?: unknown): thisAdd a step handled by an executor registered by the host or an extension.
stepName: stringkind: stringdata: unknown
methodaddInteraction addInteraction(stepName: string, interaction: SheetInteractionSignal): thisAppend a local interaction-state transition.
stepName: stringinteraction: SheetInteractionSignal
methodaddLocalAction addLocalAction(stepName: string, localAction: (): void): thisAppend a command-owned local action step.
stepName: stringlocalAction: (): void
methodaddPostCommit addPostCommit(stepName: string, postCommit: (): void): thisAppend a local state publication deferred until all steps have staged successfully.
stepName: stringpostCommit: (): void
methodaddPostRender addPostRender(stepName: string, pluginKey: PluginKey): thisSchedule 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: stringpluginKey: PluginKey
methodaddPreparedAction addPreparedAction(stepName: string, prepare: (): (): void): thisPrepare an editor-local resource that is released if later staging fails.
stepName: stringprepare: (): (): void
methodaddRender addRender(stepName: string, pluginKey: PluginKey): thisAppend a render-only step for the given plugin.
stepName: stringpluginKey: PluginKey
methodaddTransaction addTransaction(stepName: string, transaction: Transaction): thisAppend a transaction step.
stepName: stringtransaction: Transaction
methodemitComplete emitComplete(rendered: boolean): voidNotify all hooks that the pipeline has completed.
rendered: boolean
methodemitStart emitStart(): voidNotify all hooks that the pipeline is starting.
methodemitStepComplete emitStepComplete(step: PipelineStep): voidNotify all hooks that a step has completed.
step: PipelineStep
methodemitStepStart emitStepStart(step: PipelineStep): voidNotify all hooks that a step is starting. Provides auto-derived detail.
step: PipelineStep
methodmarkDirty markDirty(rect: PositionRect<templateLiteral>): thisDefers a dirty rectangle until the pipeline executor reaches render.
rect: PositionRect<templateLiteral>
methoduse use(hook: PipelineLifecycle): thisRegister a lifecycle hook (middleware). Hooks fire in registration order.
hook: PipelineLifecycle
methodfromRenderstatic fromRender(name: string, pluginKey: PluginKey): PipelineCreates a pipeline containing one render step for a plugin key.
name: stringpluginKey: PluginKey
methodfromTransactionstatic fromTransaction(name: string, transaction: Transaction): PipelineCreates a pipeline containing one transaction step.
name: stringtransaction: Transaction
- classPipelineStepExecutorRegistrysource ↗
-
class PipelineStepExecutorRegistryPer-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(): PipelineStepExecutorRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving PipelineStepExecutorRegistry.
methodget get(kind: string): PipelineStepExecutor | undefinedReturns the value.
kind: string
methodregister register(executor: PipelineStepExecutor): (): voidRegisters the value.
executor: PipelineStepExecutor
- classSearContractViolationErrorsource ↗
-
class SearContractViolationError extends SearErrorError thrown when an internal assembly contract is violated.
constructorconstructor SearContractViolationError(message: string, details?: SearErrorDetails): SearContractViolationErrorCreates a SearContractViolationError instance.
message: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_CONTRACT_VIOLATION"Stable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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: symbolDI token for resolving the active core implementation.
methodgetPlugin getPlugin(pluginKey: PluginKey): unknownRetrieves a plugin instance by plugin key.
pluginKey: PluginKey
methodregisterPlugin registerPlugin<T>(plugin: Plugin<SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>, NodeTypeProperties, T>): voidRegisters 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): SearCoreDocCreates a SearCoreDoc instance.
blockManager: BlockManagerdocCursorManager: DocCursorManagerdocCompositionManager: DocCompositionManagerdocLayoutEngine: DocLayoutEnginepluginManager: PluginManager<SearCoreDoc, NodeProperties>stepExecutorRegistry: PipelineStepExecutorRegistryruntimeLayers: SearCoreDocRuntimeLayers
propertyblockManager blockManager: BlockManagerpropertyconfigEngine configEngine: ConfigEngine<any> | nullConfiguration layer used by standalone document hosts when configured by assembly.
propertyeventEngine eventEngine: EventEngine<NodeProperties> | nullEvent 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 | nullRender engine used by standalone document hosts when configured by assembly.
propertyrenderStage renderStage: SceneGraph<NodeProperties> | nullScene graph used by standalone document rendering when configured by assembly.
propertypluginManagerSymbolstatic readonly pluginManagerSymbol: symbolDI token for resolving the Doc-owned PluginManager without colliding with Sheet managers.
propertyruntimeLayersSymbolstatic readonly runtimeLayersSymbol: symbolDI token for resolving the Doc runtime layers owned by this Core instance.
propertysymbolstatic readonly symbol: symbolDI token for resolving SearCoreDoc.
methodbindDocRenderRequestHandler bindDocRenderRequestHandler(handler: DocRenderRequestHandler): voidBinds the document render scheduler used by hosts that execute document commands.
handler: DocRenderRequestHandler
methodclearDocRenderRequests clearDocRenderRequests(): voidClears diagnostic document render request history.
methoddestroy destroy(ownerToken?: object): voidReleases standalone document runtime ownership held by Core.
ownerToken: object
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidPermanently require command dispatch for state-changing pipelines in an assembled editor.
isCommandExecuting: (): booleanrunWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodenforceTeardownBoundary enforceTeardownBoundary(ownerToken: object): voidReserves assembled Doc Core cleanup for its editor facade.
ownerToken: object
methodexecutePipeline executePipeline(pipeline: Pipeline): voidExecutes 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 | nullReturns 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 | nullReturns the latest document layout snapshot prepared by Core.
methodgetPlugin getPlugin<T>(pluginKey: PluginKey): T | undefinedReturns the plugin.
pluginKey: PluginKey
methodgetPluginInstance getPluginInstance(pluginKey: PluginKey): Plugin<SearCoreDoc, NodeProperties, any> | undefinedGet a plugin instance by key (for calling plugin-specific methods).
pluginKey: PluginKey
methodinitialize initialize(): voidInitializes 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): DocPreparedEditorRenderLayoutPrepares 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>): (): voidRegisters the plugin.
plugin: Plugin<SearCoreDoc, NodeProperties, T>
methodrequestDocRender requestDocRender(pluginKey?: PluginKey): voidRequests a document render for plugin-owned render nodes.
pluginKey: PluginKey
methodresolveCursorFromPoint resolveCursorFromPoint(x: number, y: number, snapshot: LayoutSnapshot): DocCursorPosResolves a point inside the editable document frame to the closest
document cursor position.x: numbery: numbersnapshot: LayoutSnapshot
methodsetDocRenderLayoutState setDocRenderLayoutState(state: DocRenderLayoutState | null): voidSets the layout state consumed by DocPlugin.render().
state: DocRenderLayoutState | null
methodstart start(): voidStarts standalone document runtime layers after initial plugin-node construction.
methodunregisterPlugin unregisterPlugin(pluginKey: PluginKey): voidUnregisters 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): SearCoreSheetCreates a sheet core from the DI-provided runtime services.
stage: SceneGraph<CellProperties>pluginManager: PluginManager<SearCoreSheet, CellProperties>dataEngine: SheetDataEnginerenderEngine: RenderEngine<CellProperties, SheetRenderCoordinatorManager>eventEngine: EventEngine<CellProperties>configEngine: ConfigEnginelifecycleCoordinator: SheetLifecycleCoordinatorinteractionStore: SheetInteractionStorestepExecutorRegistry: PipelineStepExecutorRegistryplatform: Platform
propertyconfigEngine configEngine: ConfigEngineConfiguration registry used by sheet plugins.
propertydataEngine dataEngine: DataEngineData 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: symbolDI token for resolving the active core implementation.
methoddestroy destroy(token?: object): voidReleases runtime controllers and their subscriptions owned by this sheet.
token: object
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidPermanently require command dispatch for state-changing pipelines in an assembled editor.
isCommandExecuting: (): boolean
methodenforceTeardownBoundary enforceTeardownBoundary(token: object): voidReserves assembled runtime teardown for the owning editor facade.
token: object
methodexecutePipeline executePipeline(pipeline: Pipeline): voidExecute 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(): SheetDataEngineReturns the sheet data engine with sheet-specific helpers.
methodgetPlugin getPlugin(pluginKey: PluginKey): unknownReturns 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(): voidBuilds plugin state and initial scene nodes without starting runtime effects.
methodregisterPlugin registerPlugin<T>(plugin: Plugin<SearCoreSheet, CellProperties, T>): voidRegisters and initializes a plugin after core startup.
plugin: Plugin<SearCoreSheet, CellProperties, T>
methodrequestRender requestRender<T>(plugin: Plugin<SearCoreSheet, CellProperties, T>): voidConvenience: wrap a render-only refresh in a Pipeline and execute it.
plugin: Plugin<SearCoreSheet, CellProperties, T>
methodstart start(): voidStarts rendering, events, and lifecycle-owned runtime controllers.
- classSearDocParseErrorsource ↗
-
class SearDocParseError extends SearErrorError thrown when document input cannot be parsed.
constructorconstructor SearDocParseError(message: string, details?: SearErrorDetails): SearDocParseErrorCreates a SearDocParseError instance.
message: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_DOC_PARSE"Stable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSearLifecycleErrorsource ↗
-
class SearLifecycleError extends SearErrorError thrown for invalid sheet lifecycle transitions.
constructorconstructor SearLifecycleError(operation: string, state: string, message?: string): SearLifecycleErrorCreates a SearLifecycleError instance.
operation: stringstate: stringmessage: string
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_LIFECYCLE_INVALID_STATE"Stable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSearPipelineStepExecutorNotFoundErrorsource ↗
-
class SearPipelineStepExecutorNotFoundError extends SearErrorError thrown when a pipeline step kind has no registered executor.
constructorconstructor SearPipelineStepExecutorNotFoundError(kind: string): SearPipelineStepExecutorNotFoundErrorCreates a SearPipelineStepExecutorNotFoundError instance.
kind: string
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"Stable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSearRegistryConflictErrorsource ↗
-
class SearRegistryConflictError extends SearErrorError thrown when a registry key is registered more than once.
constructorconstructor SearRegistryConflictError(registry: string, key: string, message?: string): SearRegistryConflictErrorCreates a SearRegistryConflictError instance.
registry: stringkey: stringmessage: string
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_REGISTRY_CONFLICT"Stable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSearRegistryEntryNotFoundErrorsource ↗
-
class SearRegistryEntryNotFoundError extends SearErrorError thrown when a required registry entry is missing.
constructorconstructor SearRegistryEntryNotFoundError(registry: string, key: string, message?: string): SearRegistryEntryNotFoundErrorCreates a SearRegistryEntryNotFoundError instance.
registry: stringkey: stringmessage: string
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_REGISTRY_ENTRY_NOT_FOUND"Stable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSheetInteractionReducerRegistrysource ↗
-
class SheetInteractionReducerRegistryExtensible dispatch table for local interaction-state transitions.
constructorconstructor SheetInteractionReducerRegistry(): SheetInteractionReducerRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetInteractionReducerRegistry.
methodget get(type: string): SheetInteractionReducer | undefinedReturns the value.
type: string
methodregister register(reducer: SheetInteractionReducer): (): voidRegisters the value.
reducer: SheetInteractionReducer
- classSheetInteractionStoresource ↗
-
class SheetInteractionStorePer-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): SheetInteractionStoreCreates a SheetInteractionStore instance.
reducers: SheetInteractionReducerRegistryplatform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetInteractionStore.
methodapply apply(signal: SheetInteractionSignal): voidApplies a transaction to SheetInteractionStore state.
signal: SheetInteractionSignal
methodcommit commit(state: SheetInteractionState, signals: readonly SheetInteractionSignal[]): voidPublishes 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): voidRequires an editor command for every assembled interaction-state commit.
isCommandExecuting: (): booleanrunWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodgetState getState(): Readonly<SheetInteractionState>Returns the state.
methodreduce reduce(state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): SheetInteractionStateReduces 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): (): voidSubscribes to state changes and returns an idempotent disposer.
listener: (state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): void
- classSheetLifecycleCoordinatorsource ↗
-
class SheetLifecycleCoordinatorStarts and disposes the runtime controllers owned by one sheet instance.
constructorconstructor SheetLifecycleCoordinator(): SheetLifecycleCoordinatorpropertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetLifecycleCoordinator.
methodbeginTeardown beginTeardown(token: object): voidPermits cleanup only for the owning editor.
token: object
methoddestroy destroy(): voidReleases resources owned by SheetLifecycleCoordinator.
methodenforceCommandBoundary enforceCommandBoundary(assertCommandWrite: (): void, teardownToken: object): voidCloses runtime registration after editor assembly.
assertCommandWrite: (): voidteardownToken: object
methodregister register(controller: SheetLifecycleController): (): voidAdds a controller. Controllers registered after startup begin immediately,
so applications can add lifecycle behavior without changing SearCoreSheet.controller: SheetLifecycleController
methodstart start(context: SheetLifecycleContext): voidStarts SheetLifecycleCoordinator.
context: SheetLifecycleContext
- classSheetMatrixsource ↗
-
class SheetMatrix extends CSRMatrix<CellMatrixElement>SheetMatrix public API.
constructorconstructor SheetMatrix(data?: { data: CellMatrixElement[]; indices: number[]; indptr: number[] }, shape?: [number, number]): SheetMatrixConstructs 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: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: CellMatrixElement | null[]): SheetMatrixAdds 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): SheetMatrixAdds 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): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: CellMatrixElement | null[]): SheetMatrixAdds 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(): thisCopies stored cell payloads as well as sparse indexes.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: CellMatrixElement): CellMatrixElement): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: CellMatrixElement): CellMatrixElement
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetMatrixDeletes 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): SheetMatrixDeletes 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>[]): SheetMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: CellMatrixElement, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: CellMatrixElement, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: CellMatrixElement, col: number): void
methodfromDenseinherited fromDense(denseArray: CellMatrixElement | null[][]): SheetMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: CellMatrixElement | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): CellMatrixElement | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: CellMatrixElement): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: CellMatrixElement- The default value to return for missing elements
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): SheetMatrixSwaps 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): SheetMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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 SheetLifecycleControllerKeeps rendering, scrolling, and viewport-culled plugin nodes in sync with viewport size.
constructorconstructor SheetViewportResizeController(subscriptionManager: SubscriptionManager): SheetViewportResizeControllerCreates a SheetViewportResizeController instance.
subscriptionManager: SubscriptionManager
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetViewportResizeController.
methodapplyViewportResize applyViewportResize(width: number, height: number): voidApplies a resize inside the command dispatched by the owning editor.
width: numberheight: number
methoddestroy destroy(): voidReleases resources owned by SheetViewportResizeController.
methodsetResizeExecutor setResizeExecutor(executor: (size: { height: number; width: number }): void): voidRoutes platform resize notifications through the owning editor's command bus.
executor: (size: { height: number; width: number }): void
methodstart start(context: SheetLifecycleContext): voidStarts SheetViewportResizeController.
context: SheetLifecycleContext
- interfaceCellMatrixElementsource ↗
-
interface CellMatrixElementPersisted cell payload stored in the sheet matrix.
propertyformula formula?: stringFormula 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: stringCell type identifier owned by the cell type catalog.
propertyvalue value?: unknownRaw value whose shape is owned by the cell type.
- interfaceCursorRenderInfosource ↗
-
interface CursorRenderInfoPre-computed pixel cursor state set by document layout before each render.
propertyheight height: numberLine height in pixels (used to size the cursor bar).
propertyvisible visible: booleanWhether the cursor bar is currently visible (blink phase).
propertyx x: numberAbsolute canvas X for the committed text caret.
propertyy y: numberAbsolute canvas Y for the laid-out line that owns the cursor.
- interfaceDocCompositionLayoutsource ↗
-
interface DocCompositionLayoutLayout contribution from an in-flight IME composition.
propertyactive readonly active: booleanWhether there is active composing text to render.
propertycaretPixelOffset readonly caretPixelOffset: numberPixel offset from the composing-text start to the IME caret.
propertytext readonly text: stringCurrent in-flight composing text.
propertytextWidth readonly textWidth: numberFull composing text width in pixels.
- interfaceDocCompositionProvidersource ↗
-
interface DocCompositionProviderProvider used by layout code to account for optional IME composition.
methodmeasure measure(font: string): DocCompositionLayoutMeasures the active composing text against the current render font.
font: string
- interfaceDocEditorRenderLayoutInputsource ↗
-
interface DocEditorRenderLayoutInputInput used by SearCoreDoc to initialize one editable document frame.
propertycompositionProvider readonly compositionProvider?: DocCompositionProviderOptional IME composition provider installed by a feature plugin or embedded host.
propertycursorVisible readonly cursorVisible?: booleanWhether 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?: booleanWhether the editable frame may grow horizontally to fit unwrapped content.
propertyfont readonly font?: stringFont descriptor used by the text shaper for this layout.
propertyminContentWidth readonly minContentWidth?: numberOptional minimum width needed to preserve pre-edit overflow sizing.
propertyminHeight readonly minHeight: numberMinimum editor height supplied by the host surface.
propertyminWidth readonly minWidth: numberMinimum editor width supplied by the host surface.
propertyorigin readonly origin: Pick<PositionRectProps, "x" | "y">Editor origin in world coordinates.
propertypadding readonly padding?: numberPadding inside the editable frame.
propertyselection readonly selection: DocSelectionCurrent document selection.
propertyverticalAlign readonly verticalAlign?: DocVerticalAlignVertical positioning inside the editable frame. Defaults to center for embedded cell editors.
- interfaceDocImmediateRenderPainterContentInputsource ↗
-
interface DocImmediateRenderPainterContentInputInput 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?: stringBase font selected by the host for this document frame.
propertyorigin readonly origin: Pick<PositionRectProps, "x" | "y">Content origin in world coordinates.
propertysnapshot readonly snapshot: LayoutSnapshotLayout snapshot whose lines are relative to the content origin.
- interfaceDocInputDispatchResultsource ↗
-
interface DocInputDispatchResultResult of applying one domain input command to the active document input session.
propertycontentChanged readonly contentChanged: booleanWhether the command produced document OT operations.
propertyselection readonly selection: DocSelectionSelection after all command steps have been applied and mapped.
propertyselectionOnly readonly selectionOnly: booleanWhether the command only changed selection/caret state.
- interfaceDocInputStatesource ↗
-
interface DocInputStateState for an active rich-document input session.
propertydocSelection docSelection: DocSelectionCurrent rich-document selection.
propertypendingDoc pendingDoc: RichDocNode[]Pending document content owned by the current edit session.
propertypreferredX preferredX: number | nullPreferred x-position for repeated vertical cursor movement.
- interfaceDocPreparedEditorRenderLayoutsource ↗
-
interface DocPreparedEditorRenderLayoutDoc-owned layout result consumed by host render surfaces.
propertycomposingCaretPixelOffset readonly composingCaretPixelOffset: numberPixel offset from composing-text start to the IME caret.
propertycontentWidth readonly contentWidth: numberWidth 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: PositionRectPropsFinal editor frame in world coordinates.
propertysnapshot readonly snapshot: LayoutSnapshotLayout snapshot owned by the Doc input/render session.
- interfaceDocRenderLayoutStatesource ↗
-
interface DocRenderLayoutStateLayout and viewport state exposed to document plugins during render().
propertyblockLayoutDiff readonly blockLayoutDiff: DocBlockLayoutDiffBlock-level diff between the previous and current layout caches.
propertyblockRender readonly blockRender?: DocBlockRenderDebugSnapshotDebug and performance stats for the most recent block-render frame.
propertycontentRect readonly contentRect: PositionRectPropsEditable content rectangle in viewport coordinates.
propertydocumentRect readonly documentRect: PositionRectPropsCurrent document layout rectangle in world coordinates.
propertyfont readonly font: stringFont selected by the host for this document render layout.
propertylayoutCache readonly layoutCache: DocLayoutCacheLatest 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 DocRenderOperationRender-facing operation derived from a RichDoc OT operation.
- interfaceDocRenderRequestsource ↗
-
interface DocRenderRequestOne queued render request targeting plugin-owned document render nodes.
propertyrenderOperations readonly renderOperations?: DocRenderOperationsRender-facing operations derived from committed RichDoc OT, or null when they cannot be converted safely.
propertyrenderPluginKey readonly renderPluginKey?: PluginKeyPlugin whose render nodes should be refreshed. Omitted means every document plugin may refresh.
- interfaceDocRenderViewportsource ↗
-
interface DocRenderViewportSnapshot of the current document viewport used by render strategies.
propertycontentRect readonly contentRect: PositionRectPropsEditable content rectangle inside the viewport.
propertyheight readonly height: numberVisible viewport height in host-view units.
propertywidth readonly width: numberVisible viewport width in host-view units.
- interfacePipelineLifecyclesource ↗
-
interface PipelineLifecycleObserver hooks emitted while a pipeline executes.
methodonComplete onComplete(pipeline: Pipeline, rendered: boolean): voidPipeline finished (all steps + render).
pipeline: Pipelinerendered: boolean
methodonStart onStart(pipeline: Pipeline): voidPipeline begins execution.
pipeline: Pipeline
methodonStepComplete onStepComplete(step: PipelineStep, pipeline: Pipeline): voidA single step has finished executing.
step: PipelineSteppipeline: Pipeline
methodonStepStart onStepStart(step: PipelineStep, pipeline: Pipeline, detail: string): voidA single step is about to execute. Receives auto-derived detail.
step: PipelineSteppipeline: Pipelinedetail: string
- interfacePipelineStepsource ↗
-
interface PipelineStepOne ordered unit of work inside a pipeline.
propertydata data?: unknownExtension-owned payload for a custom step executor.
propertyinteraction interaction?: SheetInteractionSignalLocal interaction transition for interaction steps.
propertykind kind: stringBuilt-in or extension-provided executor key.
propertylocalAction localAction?: (): voidCommand-owned action for local-action steps.
propertyname name: stringHuman-readable step name used by diagnostics.
propertypostCommit postCommit?: (): voidDeferred local state publication after document and interaction commits.
propertyprepare prepare?: (): (): voidLocal preparation that returns its rollback action.
propertyrenderPluginKey renderPluginKey?: PluginKeyPlugin key to re-render for render steps.
propertytransaction transaction?: Transaction<Operation>Transaction payload for transaction steps.
- interfacePipelineStepExecutionContextsource ↗
-
interface PipelineStepExecutionContextEffects an executor may request without taking ownership of frame flushing.
methodapplyInteraction applyInteraction(step: PipelineStep): voidstep: PipelineStep
methodexecuteTransaction executeTransaction(step: PipelineStep): voidstep: PipelineStep
methodmarkDirty markDirty(rect: PositionRect<templateLiteral>): voidrect: PositionRect<templateLiteral>
methodprepareLocalAction prepareLocalAction(step: PipelineStep): voidstep: PipelineStep
methodrenderPlugin renderPlugin(step: PipelineStep): voidstep: PipelineStep
methodrunLocalAction runLocalAction(step: PipelineStep): voidstep: PipelineStep
methodschedulePostCommit schedulePostCommit(step: PipelineStep): voidstep: PipelineStep
methodschedulePostRender schedulePostRender(step: PipelineStep): voidstep: PipelineStep
- interfacePipelineStepExecutorsource ↗
-
interface PipelineStepExecutorHandles one extensible Pipeline step kind.
- interfaceSearCoreDocRuntimeLayerssource ↗
-
interface SearCoreDocRuntimeLayersRuntime layers owned by one SearCoreDoc instance.
propertyconfigEngine readonly configEngine?: ConfigEngine<any> | nullConfiguration layer used by standalone document hosts.
propertyeventEngine readonly eventEngine?: EventEngine<NodeProperties> | nullEvent pipeline and hit-testing facade used by standalone document hosts.
propertyplatform readonly platform?: Platform | nullPlatform diagnostics adapter used by document core guard clauses.
propertyrenderEngine readonly renderEngine?: DocRenderEngine | nullRender engine used by standalone document hosts.
propertyrenderStage readonly renderStage?: SceneGraph<NodeProperties> | nullScene graph used by standalone document rendering.
- interfaceSelectionRectsource ↗
-
interface SelectionRectA single selection highlight rectangle in canvas coordinates.
- interfaceSheetEditSessionsource ↗
-
interface SheetEditSessionPublic contract for SheetEditSession.
- interfaceSheetInteractionReducersource ↗
-
interface SheetInteractionReducerReduces one local interaction signal into the per-sheet interaction state.
- interfaceSheetInteractionSignalsource ↗
-
interface SheetInteractionSignalA 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 SheetInteractionStatePublic contract for SheetInteractionState.
propertyeditSession editSession: SheetEditSession | nullpropertyselection selection: { anchor: readonly [number, number]; focus: readonly [number, number]; source: string } | nullpropertyselectionRevision selectionRevision: numberIncrements for every explicit selection transition.
propertysuppressedSelectionRevision suppressedSelectionRevision: number | nullThe selection revision consumed when the current/last edit session began.
- interfaceSheetLifecycleContextsource ↗
-
interface SheetLifecycleContextShared context supplied to lifecycle controllers for one sheet instance.
propertycore readonly core: SearCoreSheetmethodrefreshSheetBoundaries refreshSheetBoundaries(): void - interfaceSheetLifecycleControllersource ↗
-
interface SheetLifecycleControllerA startable and disposable runtime concern owned by a sheet instance.
- typeDocRenderDirtyBlockIdssource ↗
-
type DocRenderDirtyBlockIds = ReadonlySet<DocNodeId> | nullDirty block ids extracted from document render operations, or null when reflow cannot be localized safely.
- typeDocRenderOperationssource ↗
-
type DocRenderOperations = readonly DocRenderOperation[] | nullRender operations derived from document transactions, or null when they cannot be converted safely.
- typeDocRenderRequestHandlersource ↗
-
type DocRenderRequestHandler = (requests: readonly DocRenderRequest[]): voidFunction 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[]): DocRenderDirtyBlockIdsCollects blocks whose layout cache must be refreshed for reflow operations.
renderOperations: DocRenderOperationsdocument: readonly RichDocNode[]
- functioncollectDocRenderOperationssource ↗
-
collectDocRenderOperations(transactions: readonly Transaction<Operation>[]): DocRenderOperationsCollects 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: DocRenderOperationsdocument: readonly RichDocNode[]
- functiongetActiveCommandIdsource ↗
-
getActiveCommandId(): string | null - functiongetCommandObserverEpochsource ↗
-
getCommandObserverEpoch(): numberIdentifies the active observer scope so an older command cannot lend it write authority.
- functionisInsideCommandExecutionsource ↗
-
isInsideCommandExecution(): boolean - functionlockCommittedSheetStatesource ↗
-
lockCommittedSheetState(state: unknown): voidLocks document-owned state after initialization or a successful transaction commit.
state: unknown
- functionrunInsideCommandExecutionsource ↗
-
runInsideCommandExecution<T>(commandId: string, callback: CommandExecutionCallback<T>): TcommandId: stringcallback: CommandExecutionCallback<T>
- functionrunOutsideCommandExecutionsource ↗
-
runOutsideCommandExecution<T>(callback: CommandExecutionCallback<T>): TRuns observers without inheriting the enclosing command's mutation authority.
callback: CommandExecutionCallback<T>
- functionwarnIfOutsideCommandExecutionsource ↗
-
warnIfOutsideCommandExecution(operationName: string, warn?: CommandExecutionWarningReporter): voidoperationName: stringwarn: CommandExecutionWarningReporter
- functionwarnIfSyntheticCommandDefinitionsource ↗
-
warnIfSyntheticCommandDefinition(busName: string, commandId: string, warn?: CommandExecutionWarningReporter): voidbusName: stringcommandId: stringwarn: CommandExecutionWarningReporter
Package
@searsuite/sear-assembly-doc
Composable rich-document plugins for nodes, layout, inline styles, commands, and observations.
- enumBoldTextStyleKeysource ↗
-
enum BoldTextStyleKeyPersisted style key owned by the bold text-style plugin.
enum memberBold Bold: "bold" - enumFontFamilyTextStyleKeysource ↗
-
enum FontFamilyTextStyleKeyPersisted style key owned by the font-family text-style plugin.
enum memberFontFamily FontFamily: "fontFamily" - enumFontSizeTextStyleKeysource ↗
-
enum FontSizeTextStyleKeyPersisted style key owned by the font-size text-style plugin.
enum memberFontSize FontSize: "fontSize" - enumItalicTextStyleKeysource ↗
-
enum ItalicTextStyleKeyenum memberItalic Italic: "italic" - enumStrikethroughTextStyleKeysource ↗
-
enum StrikethroughTextStyleKeyenum memberStrikethrough Strikethrough: "strikethrough" - enumTextColorStyleKeysource ↗
-
enum TextColorStyleKeyPersisted style key owned by the text-color style plugin.
enum memberColor Color: "color" - enumUnderlineTextStyleKeysource ↗
-
enum UnderlineTextStyleKeyenum memberUnderline Underline: "underline" - classBoldTextStylePluginsource ↗
-
class BoldTextStylePlugin extends InlineTextStylePluginBaseContributes bold rendering and bold document commands.
constructorconstructor BoldTextStylePlugin(): BoldTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving BoldTextStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
memberkeyinherited key: unknownmethodapplyinherited apply(pluginState: StateType, transaction: Transaction): StateType | nullApplies a transaction to plugin-owned state and returns the next state.
pluginState: StateTypetransaction: Transaction
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(searCore: SearCoreDoc): unknownReturns this plugin's runtime configuration view for the current core.
searCore: SearCoreDoc
methodgetStateinherited getState(): StateTypeReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: StateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: StateType
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(context: DocPluginRuntimeContext): voidReleases resources owned by this plugin before the Core is destroyed.
context: DocPluginRuntimeContext
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: StateTypetransaction: Transaction
methodregisterBlockFlows registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilities registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStyles registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
searCore: SearCoreDocoffset: { x: number; y: number }
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: StateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: StateTypecommitToken: object
methodstart start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- classDocRuntimeExtensionRegistrysource ↗
-
class DocRuntimeExtensionRegistry extends RuntimeCapabilityRegistryRegistry of extension capabilities available to document plugins.
constructorconstructor DocRuntimeExtensionRegistry(): DocRuntimeExtensionRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the document runtime extension registry.
methoddestroyinherited destroy(): voidPermanently closes the registry and releases all published values.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for capability changes after assembly.
assertWrite: (): void
methodgetinherited get<T>(capability: RuntimeCapability<T>): T | undefinedcapability: RuntimeCapability<T>
methodgetRegisteredCapabilityIdsinherited getRegisteredCapabilityIds(): readonly string[]methodhasinherited has(capability: RuntimeCapability<unknown>): booleancapability: RuntimeCapability<unknown>
methodregisterinherited register<T>(capability: RuntimeCapability<T>, value: T): (): voidRegisters one value and returns an idempotent disposer for that registration.
capability: RuntimeCapability<T>value: T
methodrequireinherited require<T>(capability: RuntimeCapability<T>): Tcapability: RuntimeCapability<T>
- classFontFamilyTextStylePluginsource ↗
-
class FontFamilyTextStylePlugin extends InlineTextStylePluginBaseContributes font-family rendering and the set-font-family document command.
constructorconstructor FontFamilyTextStylePlugin(): FontFamilyTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FontFamilyTextStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- classFontSizeTextStylePluginsource ↗
-
class FontSizeTextStylePlugin extends InlineTextStylePluginBaseContributes font-size rendering and the set-font-size document command.
constructorconstructor FontSizeTextStylePlugin(): FontSizeTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FontSizeTextStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStyles registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- classItalicTextStylePluginsource ↗
-
class ItalicTextStylePlugin extends InlineTextStylePluginBaseContributes italic rendering, mutation, and keyboard commands.
constructorconstructor ItalicTextStylePlugin(): ItalicTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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(): ParagraphPluginCreates a ParagraphPlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving ParagraphPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlows registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters 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(): RichTextLineBoxPluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving RichTextLineBoxPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(context: DocPluginRuntimeContext): voidReleases resources owned by this plugin before the Core is destroyed.
context: DocPluginRuntimeContext
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- classStrikethroughTextStylePluginsource ↗
-
class StrikethroughTextStylePlugin extends InlineTextStylePluginBaseContributes strikethrough rendering, mutation, and keyboard commands.
constructorconstructor StrikethroughTextStylePlugin(): StrikethroughTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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(): TablePluginCreates a TablePlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving TablePlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters table node model support owned by this plugin.
context: DocPluginServiceContext
- classTextColorStylePluginsource ↗
-
class TextColorStylePlugin extends InlineTextStylePluginBaseContributes text-color rendering and mutation for text nodes.
constructorconstructor TextColorStylePlugin(): TextColorStylePluginCreates a TextColorStylePlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving TextColorStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- classUnderlineTextStylePluginsource ↗
-
class UnderlineTextStylePlugin extends InlineTextStylePluginBaseContributes underline rendering, mutation, and keyboard commands.
constructorconstructor UnderlineTextStylePlugin(): UnderlineTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- interfaceDocCaretStateCapabilitysource ↗
-
interface DocCaretStateCapabilityCaret-state capability consumed by document plugins.
- interfaceDocInputBindingRegistryCapabilitysource ↗
-
interface DocInputBindingRegistryCapabilityInput-binding capability consumed by document plugins.
methodregisterKeyboardHandlers registerKeyboardHandlers(handlers: KeyboardRouterHandlers): (): voidhandlers: KeyboardRouterHandlers
methodregisterTextHandlers registerTextHandlers(handlers: TextInputHandlers): (): voidhandlers: TextInputHandlers
- interfaceDocInteractionContentRectsource ↗
-
interface DocInteractionContentRect extends DocInteractionViewportCurrent document content rectangle exposed to interaction plugins.
- interfaceDocInteractionRuntimesource ↗
-
interface DocInteractionRuntimeView services exposed to document interaction plugins.
methodgetContentRect getContentRect(): DocInteractionContentRectmethodgetRoot getRoot(): unknownmethodgetViewport getViewport(): DocInteractionViewportmethodreadRootViewOffset readRootViewOffset(): { x: number; y: number }methodresolveCursorFromPointer resolveCursorFromPointer(input: DocPointerInput): DocCursorPosinput: DocPointerInput
methodsubscribePointerDrag subscribePointerDrag(handlers: DocPointerDragHandlers): (): voidhandlers: DocPointerDragHandlers
- interfaceDocInteractionViewportsource ↗
-
interface DocInteractionViewportCurrent document viewport model exposed to interaction plugins.
- interfaceDocKeyboardHandlerRegistrationContextsource ↗
-
interface DocKeyboardHandlerRegistrationContextServices available while a Doc plugin registers keyboard bindings.
- interfaceDocPluginImplementationsource ↗
-
interface DocPluginImplementation<TPlugin>Injectable DocPlugin class accepted by createDocEditor().
constructorconstructor DocPluginImplementation(...args: never[]): TPluginargs: never[]
propertysymbol readonly symbol: symbolmethodregisterServices registerServices(context: DocPluginServiceContext): voidcontext: DocPluginServiceContext
- interfaceDocPluginRuntimesource ↗
-
interface DocPluginRuntimeStable host capabilities supplied to a DocPlugin after editor assembly.
propertycommands readonly commands: DocCommandBusCommand 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: DocRuntimeExtensionRegistryExtension 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: ObservationRegistryTyped state and event observations owned by this editor instance.
propertyplatform readonly platform: PlatformPlatform 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: SessionStateRegistryLocal remount state contributed by built-in and third-party plugins.
propertytextShaper readonly textShaper: TextShaperText shaper used by document layout and rendering.
- interfaceDocPluginRuntimeContextsource ↗
-
interface DocPluginRuntimeContext extends DocPluginSetupContextDocument setup capabilities plus the Core created by createDocEditor().
- interfaceDocPluginServiceContextsource ↗
-
interface DocPluginServiceContextServices available while createDocEditor() registers document plugins.
propertycontainer readonly container: ContainerDI container used by the document assembly root.
- interfaceDocPluginSetupContextsource ↗
-
interface DocPluginSetupContextTyped public services available before createDocEditor() starts Core.
- interfaceDocPointerDragHandlerssource ↗
-
interface DocPointerDragHandlersDocument pointer-drag lifecycle consumed by interaction plugins.
- interfaceDocPointerInputsource ↗
-
interface DocPointerInputPointer input used by document interaction plugins.
propertyviewX readonly viewX: numberpropertyviewY readonly viewY: numbermethodpreventDefault preventDefault(): void - interfaceDocRenderEngineCapabilitysource ↗
-
interface DocRenderEngineCapabilityRender-engine surface exposed to Doc plugins.
methodrender render(pluginKey?: unknown): voidpluginKey: unknown
- interfaceDocRenderLayoutServiceCapabilitysource ↗
-
interface DocRenderLayoutServiceCapabilityPublic layout-service surface exposed to Doc plugins and hosts.
methodgetLatestVirtualLayoutSummary getLatestVirtualLayoutSummary(): DocVirtualLayoutSummary | nullmethodreset reset(): voidmethodsubscribeVirtualLayoutSummary subscribeVirtualLayoutSummary(listener: DocVirtualLayoutSummaryListener): (): voidlistener: DocVirtualLayoutSummaryListener
- interfaceDocVirtualLayoutSummarysource ↗
-
interface DocVirtualLayoutSummaryPublic virtual layout summary exposed through the Doc layout-service capability.
propertyblockRender readonly blockRender?: DocBlockRenderDebugSnapshotpropertycacheHits readonly cacheHits: numberpropertycacheMisses readonly cacheMisses: numberpropertycursorBlock readonly cursorBlock: number | nullpropertydocumentHeight readonly documentHeight: numberpropertyheightIndexUpdated readonly heightIndexUpdated: booleanpropertyinitialLoadMs readonly initialLoadMs?: numberpropertymaterializedBlocks readonly materializedBlocks: numberpropertymaterializedIndexes readonly materializedIndexes: stringpropertymodel readonly model: "reused" | "rebuilt"propertyrangeEnd readonly rangeEnd: numberpropertyrangeStart readonly rangeStart: numberpropertyrenderPhase readonly renderPhase?: DocVirtualLayoutRenderPhasepropertytimings readonly timings: DocVirtualLayoutTimingSummarypropertytotalBlocks readonly totalBlocks: number - interfaceDocVirtualLayoutTimingSummarysource ↗
-
interface DocVirtualLayoutTimingSummaryTiming summary reported by virtual document layout instrumentation.
propertycursorSelectionMs readonly cursorSelectionMs: numberpropertydocumentModelMs readonly documentModelMs: numberpropertyheightCorrectionMs readonly heightCorrectionMs: numberpropertymaterializeBlocksMs readonly materializeBlocksMs: numberpropertyrenderPrepareMode readonly renderPrepareMode?: "full" | "viewport"propertyrenderPrepareMs readonly renderPrepareMs?: numberpropertysnapshotCacheMs readonly snapshotCacheMs: numberpropertyviewportRangeMs readonly viewportRangeMs: numberpropertyvirtualLayoutTotalMs readonly virtualLayoutTotalMs: number - interfaceInsertDocTableInputsource ↗
-
interface InsertDocTableInputInput accepted by InsertDocTableCommand.
- interfaceInsertDocTextInputsource ↗
-
interface InsertDocTextInputInput accepted by InsertDocTextCommand.
propertytext readonly text: stringText to insert at the current document selection.
- interfaceLoadDocumentInputsource ↗
-
interface LoadDocumentInputInput accepted by LoadDocumentCommand.
propertydocument readonly document: RichDocNode[]Rich-document content to load into the document editor.
- interfaceMoveDocCursorInputsource ↗
-
interface MoveDocCursorInputInput accepted by MoveDocCursorCommand.
- interfaceSetDocBoldInputsource ↗
-
interface SetDocBoldInputInput accepted by SetDocBoldCommand. A null or false value clears bold.
propertybold readonly bold: boolean | null - interfaceSetDocCompositionInputsource ↗
-
interface SetDocCompositionInputInput accepted by SetDocCompositionCommand.
propertycaretOffset readonly caretOffset: numberCaret offset inside the composing text.
propertytext readonly text: stringCurrent composing text emitted by the host input method.
- interfaceSetDocFontFamilyInputsource ↗
-
interface SetDocFontFamilyInputInput accepted by SetDocFontFamilyCommand. A null or empty value clears the font family.
propertyfontFamily readonly fontFamily: string | null - interfaceSetDocFontSizeInputsource ↗
-
interface SetDocFontSizeInputInput accepted by SetDocFontSizeCommand. A null or empty value clears the font size.
propertyfontSize readonly fontSize: number | null - interfaceSetDocItalicInputsource ↗
-
interface SetDocItalicInputpropertyitalic readonly italic: boolean | null - interfaceSetDocLineSpacingInputsource ↗
-
interface SetDocLineSpacingInputInput accepted by SetDocLineSpacingCommand. Null clears the paragraph override.
propertylineSpacing readonly lineSpacing: RichTextLineSpacing | null - interfaceSetDocParagraphSpacingAfterInputsource ↗
-
interface SetDocParagraphSpacingAfterInputInput accepted by SetDocParagraphSpacingAfterCommand. Null clears the paragraph override.
propertyspacingAfter readonly spacingAfter: number | null - interfaceSetDocSelectionInputsource ↗
-
interface SetDocSelectionInputInput accepted by SetDocSelectionCommand.
propertyselection readonly selection: DocSelectionSelection to make active in the document editor.
- interfaceSetDocStrikethroughInputsource ↗
-
interface SetDocStrikethroughInputpropertystrikethrough readonly strikethrough: boolean | null - interfaceSetDocTextColorInputsource ↗
-
interface SetDocTextColorInputInput accepted by SetDocTextColorCommand. A null or empty value clears the text color.
propertycolor readonly color: string | null - interfaceSetDocUnderlineInputsource ↗
-
interface SetDocUnderlineInputpropertyunderline readonly underline: boolean | null - typeDocRuntimeCapabilityReadersource ↗
-
type DocRuntimeCapabilityReader = RuntimeCapabilityReaderRead-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): voidListener 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: PluginKeyDefault 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(): RichTextInlineStyleContributionCreates the shared bold inline style contribution.
- functioncreateBoldRenderContributionsource ↗
-
createBoldRenderContribution(): RichTextRunRenderContributionCreates the render-layer bold contribution.
- functioncreateDocCommandsource ↗
-
createDocCommand(id: string, renderPluginKey: PluginKey | readonly PluginKey[], createTransaction?: (): Transaction, effects?: readonly DocCommandEffect[] | undefined, localAction?: (): void): DocEditorCommandCreates a pipeline-backed document command with an optional transaction or local action.
id: stringrenderPluginKey: PluginKey | readonly PluginKey[]createTransaction: (): Transactioneffects: readonly DocCommandEffect[] | undefinedlocalAction: (): void
- functioncreateFontFamilyContributionsource ↗
-
createFontFamilyContribution(): RichTextInlineStyleContributionCreates the shared font-family inline style contribution.
- functioncreateFontFamilyRenderContributionsource ↗
-
createFontFamilyRenderContribution(): RichTextRunRenderContributionCreates the render-layer font-family contribution.
- functioncreateFontSizeContributionsource ↗
-
createFontSizeContribution(): RichTextInlineStyleContributionCreates the shared font-size inline style contribution.
- functioncreateFontSizeRenderContributionsource ↗
-
createFontSizeRenderContribution(): RichTextRunRenderContributionCreates the render-layer font-size contribution.
- functioncreateItalicContributionsource ↗
-
createItalicContribution(): RichTextInlineStyleContribution - functioncreateItalicRenderContributionsource ↗
-
createItalicRenderContribution(): RichTextRunRenderContributionCreates the render-layer italic contribution.
- functioncreateStrikethroughContributionsource ↗
-
createStrikethroughContribution(): RichTextInlineStyleContribution - functioncreateStrikethroughRenderContributionsource ↗
-
createStrikethroughRenderContribution(): RichTextRunRenderContributionCreates the render-layer strikethrough contribution.
- functioncreateTextColorContributionsource ↗
-
createTextColorContribution(): RichTextInlineStyleContributionCreates the shared text-color inline style contribution.
- functioncreateTextColorRenderContributionsource ↗
-
createTextColorRenderContribution(): RichTextRunRenderContributionCreates the render-layer text-color contribution.
- functioncreateUnderlineContributionsource ↗
-
createUnderlineContribution(): RichTextInlineStyleContribution - functioncreateUnderlineRenderContributionsource ↗
-
createUnderlineRenderContribution(): RichTextRunRenderContributionCreates 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): (): voidRegisters every top-level block flow contribution owned by document plugins.
plugins: readonly unknown[]registry: RichTextBlockFlowRegistry
- functionregisterDocPluginCapabilitiessource ↗
-
registerDocPluginCapabilities(plugins: readonly unknown[], registry: DocRuntimeExtensionRegistry): voidPublishes every typed runtime capability contributed by document plugins.
plugins: readonly unknown[]registry: DocRuntimeExtensionRegistry
- functionregisterDocPluginCommandssource ↗
-
registerDocPluginCommands(plugins: readonly unknown[], commands: DocCommandBus): (): voidRuns the register document plugin commands helper.
plugins: readonly unknown[]commands: DocCommandBus
- functionregisterDocPluginInlineStyleRendererssource ↗
-
registerDocPluginInlineStyleRenderers(plugins: readonly unknown[], registry: RichTextRunRenderRegistry): (): voidRegisters every rich-text run renderer contributed by document plugins.
plugins: readonly unknown[]registry: RichTextRunRenderRegistry
- functionregisterDocPluginInlineStylessource ↗
-
registerDocPluginInlineStyles(plugins: readonly unknown[], registry: RichTextInlineStyleRegistry): (): voidRegisters every inline text-style contribution owned by document plugins.
plugins: readonly unknown[]registry: RichTextInlineStyleRegistry
- functionregisterDocPluginKeyboardHandlerssource ↗
-
registerDocPluginKeyboardHandlers(plugins: readonly unknown[], context: DocKeyboardHandlerRegistrationContext): (): voidRegisters every keyboard binding contributed by document plugins.
plugins: readonly unknown[]context: DocKeyboardHandlerRegistrationContext
- functionregisterDocPluginLineBoxessource ↗
-
registerDocPluginLineBoxes(plugins: readonly unknown[], registry: RichTextLineBoxRegistry): (): voidRegisters every rich-text line box contribution owned by document plugins.
plugins: readonly unknown[]registry: RichTextLineBoxRegistry
- functionregisterDocPluginObservationssource ↗
-
registerDocPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): voidRegisters every typed observation source contributed by document plugins.
plugins: readonly unknown[]observations: ObservationRegistry
- functionregisterDocPluginSessionStatessource ↗
-
registerDocPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): voidRegisters every local session-state adapter contributed by document plugins.
plugins: readonly unknown[]registry: SessionStateRegistry
Package
@searsuite/sear-assembly-headless
Headless Sheet composition for tests, servers, and runtimes without a visual host.
- classHeadlessXmlXPathEvaluatorsource ↗
-
class HeadlessXmlXPathEvaluator extends XmlXPathEvaluatorNode-safe XML/XPath adapter for tests, servers, and other headless hosts.
constructorconstructor HeadlessXmlXPathEvaluator(): HeadlessXmlXPathEvaluatorpropertysymbolstatic readonly symbol: symbolDI token for resolving the editor-local XML/XPath adapter.
methodevaluateinherited evaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluationEvaluates an XPath expression against one XML document.
xml: stringxpath: stringoptions: XmlXPathOptions
- typeHeadlessEditorsource ↗
-
type HeadlessEditor = SheetEditorPublic 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 = WorkbookEditorPublic 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): SheetEditorcreateHeadlessEditor(options: HeadlessWorkbookEditorOptions): WorkbookEditorCreates 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): WorkbookEditorCreates 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
Plugin lifecycle, runtime capabilities, state contributions, and extension registries.
- classEditorLifecycleErrorsource ↗
-
class EditorLifecycleError extends SearErrorPublic error raised when lifecycle stack ownership is violated.
constructorconstructor EditorLifecycleError(code: EditorLifecycleErrorCode, message: string, details?: SearErrorDetails): EditorLifecycleErrorcode: EditorLifecycleErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: EditorLifecycleErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classEditorLifecycleStacksource ↗
-
class EditorLifecycleStackIdempotent reverse-order disposer stack used by editor composition roots.
constructorconstructor EditorLifecycleStack(): EditorLifecycleStackmethodadd add(disposer: (): void): voidAdds one owned resource disposer in acquisition order.
disposer: (): void
methoddispose dispose(): voidRuns every disposer in reverse order and continues cleanup after individual failures.
- classHeadlessToolbarsource ↗
-
class HeadlessToolbar extends SearToolbarToolbar implementation for hosts without a UI surface.
constructorconstructor HeadlessToolbar(): HeadlessToolbarpropertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessToolbar.
methoddestroy destroy(): voidReleases resources owned by SearToolbar.
methodmount mount(_target: unknown): voidAttaches 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: numberDraw 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 callapplywhen 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 transactionspropertypluginKey pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistory readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOT readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
memberkey key: unknownmethodapply apply(pluginState: PluginStateType, transaction: Transaction): PluginStateType | nullApplies a transaction to plugin-owned state and returns the next state.
pluginState: PluginStateTypetransaction: Transaction
methoddirtyRect dirtyRect(searCore: SearCoreType, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreTypetransaction: Transaction
methodenforceRuntimeWriteBoundary enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundary enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(searCore: SearCoreType): unknownReturns this plugin's runtime configuration view for the current core.
searCore: SearCoreType
methodgetState getState(): PluginStateTypeReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundary hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedState lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClick onClick(earCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreTypeevent: EventWithOffsetAndTarget<NodeTypeProperties>
methodonDblClick onDblClick(earCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreTypeevent: EventWithOffsetAndTarget<NodeTypeProperties>
methodonInitialDataCell onInitialDataCell(searCore: SearCoreType, cell: unknown, row: number, col: number): voidReceives 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: SearCoreTypecell: unknownrow: numbercol: number
methodonInitialDataComplete onInitialDataComplete(searCore: SearCoreType): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreType
methodonMouseDown onMouseDown(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreTypeevent: EventWithOffsetAndTarget<NodeTypeProperties>
methodonMouseMove onMouseMove(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreTypeevent: EventWithOffsetAndTarget<NodeTypeProperties>
methodonMouseUp onMouseUp(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreTypeevent: EventWithOffsetAndTarget<NodeTypeProperties>
methodonResize onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScroll onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
searCore: SearCoreTypeoffset: { x: number; y: number }
methodsealRuntimeMetadata sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethods sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWrites sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetState setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: object
- classPluginKeysource ↗
-
class PluginKeyStable 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): PluginKeyConstructs a key using the provided base name.
key: string- Human-readable plugin key prefix.
propertykey readonly key: stringUnique 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: symbolDI token for resolving the runtime plugin manager.
methodclearPlugins clearPlugins(token?: object): voidRemoves all registered plugins during host teardown.
token: object
methodenforceWriteBoundary enforceWriteBoundary(token: object): voidGives the owning runtime exclusive registry write access after assembly.
token: object
methodforEach forEach(callbackfn: (plugin: Plugin<SearCoreType, NodeTypeProperties, any>): void): voidVisits 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> | undefinedResolves 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 | undefinedReturns the state owned by a registered plugin key, if present.
key: PluginKey
methodgetTransactionHistoryAdapter getTransactionHistoryAdapter(transaction: Transaction): PluginTransactionHistoryAdapter | undefinedReturns the history adapter contributed by a transaction's state owner.
transaction: Transaction
methodgetTransactionOTContribution getTransactionOTContribution(transaction: Transaction): PluginTransactionOTContribution<OTOperation> | undefinedReturns the shared transaction OT contribution for one local transaction owner.
transaction: Transaction
methodinvertTransaction invertTransaction(transaction: Transaction): Transaction<Operation> | nullInverts a transaction through its owner's registered OT definition.
transaction: Transaction
methodregisterPlugin registerPlugin<T>(plugin: Plugin<SearCoreType, NodeTypeProperties, T>, token?: object): voidRegisters a plugin under its key and rejects duplicate ownership.
plugin: Plugin<SearCoreType, NodeTypeProperties, T>token: object
methodtransformTransaction transformTransaction(transaction: Transaction, other: Transaction): Transaction<Operation> | nullRebases a retained transaction over another committed transaction through the shared registry.
transaction: Transactionother: Transaction
methodunregisterPlugin unregisterPlugin(pluginOrKey: string | PluginKey | Plugin<SearCoreType, NodeTypeProperties, any>, token?: object): voidUnregisters a plugin and clears the manager-owned state reference.
pluginOrKey: string | PluginKey | Plugin<SearCoreType, NodeTypeProperties, any>token: object
- classRuntimeCapabilityErrorsource ↗
-
class RuntimeCapabilityError extends SearErrorPublic error raised when a runtime capability contract is violated.
constructorconstructor RuntimeCapabilityError(code: RuntimeCapabilityErrorCode, message: string, details?: SearErrorDetails): RuntimeCapabilityErrorcode: RuntimeCapabilityErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: RuntimeCapabilityErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classRuntimeCapabilityRegistrysource ↗
-
class RuntimeCapabilityRegistry extends RuntimeCapabilityReaderEditor-local registry shared by Sheet, Doc and Workbook assemblies.
constructorconstructor RuntimeCapabilityRegistry(owner?: string): RuntimeCapabilityRegistryowner: string
methoddestroy destroy(): voidPermanently closes the registry and releases all published values.
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for capability changes after assembly.
assertWrite: (): void
methodget get<T>(capability: RuntimeCapability<T>): T | undefinedcapability: RuntimeCapability<T>
methodgetRegisteredCapabilityIds getRegisteredCapabilityIds(): readonly string[]methodhas has(capability: RuntimeCapability<unknown>): booleancapability: RuntimeCapability<unknown>
methodregister register<T>(capability: RuntimeCapability<T>, value: T): (): voidRegisters one value and returns an idempotent disposer for that registration.
capability: RuntimeCapability<T>value: T
methodrequire require<T>(capability: RuntimeCapability<T>): Tcapability: RuntimeCapability<T>
- classSearFormulaBarsource ↗
-
class SearFormulaBarPlatform-neutral lifecycle for a Sheet formula input surface.
constructorconstructor SearFormulaBar(): SearFormulaBarpropertysymbolstatic readonly symbol: symbolmethoddestroy destroy(): voidmethodmount mount(target: unknown): voidtarget: unknown
- classSearToolbarsource ↗
-
class SearToolbarPlatform-neutral toolbar lifecycle contract.
constructorconstructor SearToolbar(): SearToolbarpropertysymbolstatic readonly symbol: symbolDI token for resolving SearToolbar.
methoddestroy destroy(): voidReleases resources owned by SearToolbar.
methodmount mount(target: unknown): voidAttaches this adapter to its host surface.
target: unknown
- classSessionStateErrorsource ↗
-
class SessionStateError extends SearErrorError raised when a session-state contributor violates its registry contract.
constructorconstructor SessionStateError(code: SessionStateErrorCode, message: string, details?: SearErrorDetails): SessionStateErrorCreates a session-state contract error.
code: SessionStateErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: SessionStateErrorCodeStable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSessionStateRegistrysource ↗
-
class SessionStateRegistryEditor-local coordinator for all built-in and plugin-contributed session state.
constructorconstructor SessionStateRegistry(): SessionStateRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the editor-local registry.
methodassertRestorationOpen assertRestorationOpen(): voidRejects a retained contributor restore callback after editor initialization.
methodcapture capture(): SessionStateSnapshotCaptures every registered contributor while preserving state whose owner is not loaded.
methodclear clear(lifecycleToken?: object): voidClears 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): voidLoads a complete snapshot before lifecycle restoration begins.
snapshot: SessionStateSnapshot
methodregister register<State>(definition: SessionStateDefinition<State>, adapter: SessionStateAdapter<State>): (): voidRegisters one state owner and returns an idempotent disposer.
definition: SessionStateDefinition<State>adapter: SessionStateAdapter<State>
methodrestorePhase restorePhase(phase: SessionStateRestorePhase): voidRestores every registered contributor assigned to one ordered lifecycle phase.
phase: SessionStateRestorePhase
methodsealRestoration sealRestoration(lifecycleToken: object): voidCloses initialization-only restore operations for an assembled editor.
lifecycleToken: object
- classSheetFormatTransferRegistrysource ↗
-
class SheetFormatTransferRegistryEditor-local composition of state-owner format transfers.
constructorconstructor SheetFormatTransferRegistry(): SheetFormatTransferRegistrypropertysymbolstatic readonly symbol: typeof symbolmethodcapture capture(source: SheetMoveRange): SheetFormatTransferSnapshotsource: SheetMoveRange
methodclear clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans all format owners against the same unchanged pre-clear state.
range: SheetMoveRange
methoddestroy destroy(): voidmethodregister register(owner: SheetFormatTransferContribution): (): voidowner: SheetFormatTransferContribution
- classSheetRangeMoveRegistrysource ↗
-
class SheetRangeMoveRegistryEditor-local range-move planning extension point shared by state owners.
constructorconstructor SheetRangeMoveRegistry(): SheetRangeMoveRegistrypropertysymbolstatic readonly symbol: typeof symbolmethodanalyze analyze(context: SheetRangeMoveContext): SheetRangeMoveAnalysisAssesses all owner constraints without planning or publishing any mutation.
context: SheetRangeMoveContext
methoddestroy destroy(): voidReleases all editor-owned registrations.
methodhasConflict hasConflict(context: SheetRangeMoveContext): booleanValidates 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): (): voidRegisters one owner and returns an idempotent disposer.
contribution: SheetRangeMoveContribution
- classSheetRangeMoveRejectedErrorsource ↗
-
class SheetRangeMoveRejectedError extends SearErrorA 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" }): SheetRangeMoveRejectedErrorCreates 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?: unknownpropertycode readonly code: stringStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSheetRangeReorderRegistrysource ↗
-
class SheetRangeReorderRegistryconstructorconstructor SheetRangeReorderRegistry(): SheetRangeReorderRegistrypropertysymbolstatic readonly symbol: typeof symbolmethoddestroy destroy(): voidmethodplan plan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]context: SheetRangeReorderContext
methodregister register(contribution: SheetRangeReorderContribution): (): voidcontribution: SheetRangeReorderContribution
- classSheetStructureMoveRegistrysource ↗
-
class SheetStructureMoveRegistryEditor-local preflight and operation planning for complete-axis moves.
constructorconstructor SheetStructureMoveRegistry(): SheetStructureMoveRegistrypropertysymbolstatic readonly symbol: typeof symbolmethoddestroy destroy(): voidReleases editor-owned contributions.
methodplan plan(context: SheetStructureMoveContext): readonly Operation[]Validates the original intent before compiling dependent operation updates.
context: SheetStructureMoveContext
methodregister register(contribution: SheetStructureMoveContribution): (): voidRegisters 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): voidRegisters 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): voidRegisters every stable command id owned by this plugin.
commands: CommandBus
- interfacePluginConfigRegistrationsource ↗
-
interface PluginConfigRegistration<ConfigType>Default configuration contributed by one plugin during editor setup.
- 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?: booleanWhen 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: stringField name written into the named view. Duplicate names in one view are rejected by DataEngine.
propertyrequired readonly required?: booleanWhen false, a missing state or void field does not make the containing view unavailable.
propertyselect readonly select: (state: PluginStateType): unknownReads the field value from the current plugin-owned state whenever the view is requested.
propertyviewKey readonly viewKey: stringNamed 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: stringmethoddeserialize deserialize(payload: unknown, path: string): Partial<TDocumentState>payload: unknownpath: string
methodserialize serialize(state: TDocumentState): unknownstate: TDocumentState
- interfacePluginDocumentStateContributionsource ↗
-
interface PluginDocumentStateContribution<TOwnerState, TDocumentState>Document-state export contribution owned by one plugin state owner.
- interfacePluginObservationExtensionsource ↗
-
interface PluginObservationExtension<ObservationRegistry>Plugin capability for registering typed observations against one host observation registry.
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters 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): voidRegisters every typed state and event observation source owned by this plugin.
observations: ObservationRegistry
- interfacePluginQueryRegistrarsource ↗
-
interface PluginQueryRegistrar<QueryRegistry>methodregisterQueries registerQueries(queries: QueryRegistry): voidqueries: QueryRegistry
- interfacePluginRuntimeCapabilityExtensionsource ↗
-
interface PluginRuntimeCapabilityExtension<RuntimeCapabilityRegistry>Plugin capability for publishing typed editor-owned services to plugins and hosts.
methodregisterCapabilities registerCapabilities(registry: RuntimeCapabilityRegistry): voidRegisters 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): voidregistry: RuntimeCapabilityRegistry
- interfacePluginSessionStateExtensionsource ↗
-
interface PluginSessionStateExtension<SessionStateRegistry>Plugin capability for registering editor-local session capture and restore behavior.
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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): voidRegisters 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.
- 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: PluginKeyPlugin key that owns the registered state.
propertystate readonly state: PluginStateTypeState value to register for that plugin key.
- interfacePluginTransactionHistoryAdaptersource ↗
-
interface PluginTransactionHistoryAdapterConverts one plugin-owned transaction into history operations and rebases
retained history over transactions that committed later.methodinvert invert(transaction: Transaction): Transaction<Operation> | nullCreates the transaction that reverses the supplied committed transaction.
transaction: Transaction
methodtransform transform(transaction: Transaction, other: Transaction): Transaction<Operation> | nullRebases a retained transaction over a transaction that committed later.
transaction: Transactionother: Transaction
- interfacePluginTransactionHistoryOperationssource ↗
-
interface PluginTransactionHistoryOperationsOperation-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?: booleanWhether 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: stringStable 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 RegisteredPluginDocumentStateContributionDocument-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.
- interfaceRuntimeCapabilityReadersource ↗
-
interface RuntimeCapabilityReaderRead-only capability view exposed by an editor facade.
methodget get<T>(capability: RuntimeCapability<T>): T | undefinedcapability: RuntimeCapability<T>
methodgetRegisteredCapabilityIds getRegisteredCapabilityIds(): readonly string[]methodhas has(capability: RuntimeCapability<unknown>): booleancapability: RuntimeCapability<unknown>
methodrequire require<T>(capability: RuntimeCapability<T>): Tcapability: 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: SessionStateRestorePhaseLifecycle phase in which restore() may safely update the owning feature.
methodcapture capture(): State | undefinedReturns plain data or a supported built-in value; custom class instances are not session snapshots.
methodrestore restore(state: State): voidRestores local state during the declared lifecycle phase.
state: State
- interfaceSessionStateDefinitionsource ↗
-
interface SessionStateDefinition<State>Typed identity owned and exported by one local-state contributor.
- 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): voidstartRow: numberstartColumn: numberendRow: numberendColumn: numbervisit: (value: Value, row: number, column: number): void
methodgetDefaultValue getDefaultValue(): Value | null | undefinedmethodgetItem getItem(row: number, column: number): Value | null | undefinedrow: numbercolumn: number
- interfaceSheetFormatTransferContributionsource ↗
-
interface SheetFormatTransferContributionOptional state-owner contribution to format painting.
propertyid readonly id: stringmethodcapture capture(source: SheetMoveRange): SheetFormatTransferSnapshotsource: SheetMoveRange
methodclear clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans removal of this owner's explicit formats without changing cell content.
range: SheetMoveRange
- interfaceSheetFormatTransferPlansource ↗
-
interface SheetFormatTransferPlanOne owner's isolated plan; only the owner interprets its operations.
propertyoperations readonly operations: readonly Operation[]propertytarget readonly target: PluginKey - interfaceSheetFormatTransferRegistrarsource ↗
-
interface SheetFormatTransferRegistrarOptional plugin lifecycle extension for format-transfer registration.
methodregisterFormatTransfers registerFormatTransfers(registry: SheetFormatTransferRegistry): voidregistry: SheetFormatTransferRegistry
- interfaceSheetFormatTransferSnapshotsource ↗
-
interface SheetFormatTransferSnapshotCaptured format data, independent of subsequent source changes.
methodplan plan(destination: SheetMoveRange): readonly SheetFormatTransferPlan[]destination: SheetMoveRange
- interfaceSheetMoveRangesource ↗
-
interface SheetMoveRangeZero-based inclusive bounds of a cell range.
- interfaceSheetRangeMoveContextsource ↗
-
interface SheetRangeMoveContextNormalized source and destination of a same-sheet cell move.
propertydestination readonly destination: SheetMoveRangepropertysource readonly source: SheetMoveRange - interfaceSheetRangeMoveContributionsource ↗
-
interface SheetRangeMoveContributionA state owner's participation in range moves, independent of storage representation.
propertyid readonly id: stringUnique registration identity, conventionally
<owner>.rangeMove; not a document field or operation target.methodhasConflict hasConflict(context: SheetRangeMoveContext): booleanReports 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: SheetRangeMoveContextplans: readonly SheetRangeMovePlan[]
methodvalidate validate(context: SheetRangeMoveContext): voidReads owner-specific invariants without mutation; rejected constraints throw a SearError.
context: SheetRangeMoveContext
- interfaceSheetRangeMovePlansource ↗
-
interface SheetRangeMovePlanOperations produced by one state owner without mutating its live state.
propertyoperations readonly operations: readonly Operation[]propertytarget readonly target: PluginKey - interfaceSheetRangeReorderContextsource ↗
-
interface SheetRangeReorderContextOne stable row permutation within an inclusive cell range.
propertydestinationOf readonly destinationOf: (row: number): numberMaps a source row to its final row; columns never change.
propertyrange readonly range: SheetMoveRange - interfaceSheetRangeReorderContributionsource ↗
-
interface SheetRangeReorderContributionState owners contribute atomic updates without exposing their matrices to the sorter.
propertyid readonly id: stringmethodplan plan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]context: SheetRangeReorderContext
methodtransformPlans transformPlans(context: SheetRangeReorderContext, plans: readonly SheetRangeReorderPlan[]): readonly SheetRangeReorderPlan[]context: SheetRangeReorderContextplans: readonly SheetRangeReorderPlan[]
methodvalidate validate(context: SheetRangeReorderContext): voidcontext: SheetRangeReorderContext
- interfaceSheetRangeReorderPlansource ↗
-
interface SheetRangeReorderPlanpropertyoperations readonly operations: readonly Operation[]propertytarget readonly target: PluginKey - interfaceSheetRangeRuleEntrysource ↗
-
interface SheetRangeRuleEntry<Rule>A feature-owned rule and the rectangle it covers.
- interfaceSheetRangeRuleFragmentsource ↗
-
interface SheetRangeRuleFragment<Rule>One retained or relocated piece of an original rule.
- interfaceSheetRangeRuleMoveAdaptersource ↗
-
interface SheetRangeRuleMoveAdapter<Rule>Feature-specific storage and operation mapping for splittable range rules.
propertyid readonly id: stringmethodplan plan(context: SheetRangeMoveContext, affected: readonly SheetRangeRuleEntry<Rule>[], fragments: readonly SheetRangeRuleFragment<Rule>[]): readonly SheetRangeMovePlan[]context: SheetRangeMoveContextaffected: readonly SheetRangeRuleEntry<Rule>[]fragments: readonly SheetRangeRuleFragment<Rule>[]
methodreadRules readRules(): readonly SheetRangeRuleEntry<Rule>[]methodvalidate validate(context: SheetRangeMoveContext): voidcontext: SheetRangeMoveContext
- interfaceSheetStructureMoveContextsource ↗
-
interface SheetStructureMoveContextOne original-state structure permutation owned by a matrix plugin.
propertyoperations readonly operations: readonly Operation[]propertytarget readonly target: PluginKey - interfaceSheetStructureMoveContributionsource ↗
-
interface SheetStructureMoveContributionOwner-local validation and dependent edits compiled before a structure move is staged.
propertyid readonly id: stringmethodtransformOperations transformOperations(context: SheetStructureMoveContext): readonly Operation[]context: SheetStructureMoveContext
methodvalidate validate(context: SheetStructureMoveContext): voidcontext: 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 & conditionalMinimal 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 = SheetMoveRangeInclusive 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): voidChecks registration changes without adding work to query or planning paths.
owner: object
- functioncloneSessionStateValuesource ↗
-
cloneSessionStateValue<T>(value: T): TCopies 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: stringtarget: PluginKeyreadMatrix: (): SheetFormatMatrix<Value>
- functioncreatePluginTransactionHistoryAdaptersource ↗
-
createPluginTransactionHistoryAdapter(operations: PluginTransactionHistoryOperations): PluginTransactionHistoryAdapterCreates a transaction history adapter while preserving owner identity and metadata.
operations: PluginTransactionHistoryOperations
- functioncreateRuntimeCapabilityReadersource ↗
-
createRuntimeCapabilityReader(registry: RuntimeCapabilityRegistry, hidden?: readonly RuntimeCapability<unknown>[]): RuntimeCapabilityReaderExposes selected capabilities without handing hosts the mutable registry itself.
registry: RuntimeCapabilityRegistryhidden: readonly RuntimeCapability<unknown>[]
- functioncreateSheetRangeRuleMoveContributionsource ↗
-
createSheetRangeRuleMoveContribution<Rule>(adapter: SheetRangeRuleMoveAdapter<Rule>): SheetRangeMoveContributionCreates 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): pluginReturns whether a plugin contributes command registration for the current host.
plugin: unknown
- functionhasPluginObservationRegistrarsource ↗
-
hasPluginObservationRegistrar<ObservationRegistry>(plugin: unknown): pluginReturns whether a plugin contributes observation registration for the current host.
plugin: unknown
- functionhasPluginQueryRegistrarsource ↗
-
hasPluginQueryRegistrar<QueryRegistry>(plugin: unknown): pluginplugin: unknown
- functionhasPluginRuntimeCapabilityRegistrarsource ↗
-
hasPluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>(plugin: unknown): pluginReturns whether a plugin publishes runtime capabilities for the current editor.
plugin: unknown
- functionhasPluginSessionStateRegistrarsource ↗
-
hasPluginSessionStateRegistrar<SessionStateRegistry>(plugin: unknown): pluginReturns whether a plugin contributes local session-state registration for the current host.
plugin: unknown
- functionintersectSheetMoveRangessource ↗
-
intersectSheetMoveRanges(left: SheetMoveRange, right: SheetMoveRange): SheetMoveRange | nullReturns the shared inclusive area of two ranges, if any.
left: SheetMoveRangeright: SheetMoveRange
- functionisPointInSheetMoveRangesource ↗
-
isPointInSheetMoveRange(range: SheetMoveRange, row: number, column: number): booleanTests inclusive range membership.
range: SheetMoveRangerow: numbercolumn: number
- functionreadSessionStatesource ↗
-
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefinedReads one contributor value from an opaque snapshot through its typed definition.
snapshot: SessionStateSnapshotdefinition: SessionStateDefinition<State>
- functionsealSheetContributionWritessource ↗
-
sealSheetContributionWrites(owner: object, assertWrite: (): void): voidSeals setup-time Sheet contribution registries after editor startup.
owner: objectassertWrite: (): void
- functionsubtractSheetMoveRangesource ↗
-
subtractSheetMoveRange(original: SheetMoveRange, cut: SheetMoveRange): SheetMoveRange[]Removes one inclusive rectangle, retaining at most four disjoint pieces.
original: SheetMoveRangecut: SheetMoveRange
- functiontranslateSheetMoveRangesource ↗
-
translateSheetMoveRange(range: SheetMoveRange, source: SheetMoveRange, destination: SheetMoveRange): SheetMoveRangeTranslates a rule fragment by the source-to-destination displacement.
range: SheetMoveRangesource: SheetMoveRangedestination: SheetMoveRange
Package
@searsuite/sear-assembly-setup
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): CaretPluginCreates a CaretPlugin instance.
caretState: DocCaretState
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving CaretPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters caret-owned state before the plugin is resolved.
context: DocPluginServiceContext
- classDefaultSheetClipboardDataSourcesource ↗
-
class DefaultSheetClipboardDataSource extends SheetClipboardDataSourceDefault data source bridging clipboard commands to the active Sheet data view.
constructorconstructor DefaultSheetClipboardDataSource(dataEngine: DataEngine, queries: SheetQueryRegistry): DefaultSheetClipboardDataSourcedataEngine: DataEnginequeries: SheetQueryRegistry
propertyformatTarget readonly formatTarget: PluginKeypropertytarget readonly target: PluginKeymethodgetColumnCount getColumnCount(): numbermethodgetRowCount getRowCount(): numbermethodgetSelection getSelection(): SheetRangeBounds | nullmethodreadCell readCell(row: number, column: number): CellMatrixElement | nullrow: numbercolumn: number
methodreadCellFormat readCellFormat(row: number, column: number): CellFormat | nullrow: numbercolumn: number
- classDocCaretStatesource ↗
-
class DocCaretStateShared caret blink state used by document feature plugins and render layout.
constructorconstructor DocCaretState(): DocCaretStatepropertysymbolstatic readonly symbol: typeof symbolDI token for resolving caret state owned by CaretPlugin.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidCloses direct caret writes after editor assembly.
isCommandExecuting: (): boolean
methodisVisible isVisible(): booleanReturns whether the caret should be painted in the current frame.
methodreset reset(): voidRestarts the blink cycle with the caret visible.
methodsetVisible setVisible(visible: boolean): voidSets the current caret visibility.
visible: boolean
methodtoggle toggle(): booleanToggles 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(): DocContentRenderPluginCreates a DocContentRenderPlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving DocContentRenderPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
searCore: SearCoreDoc
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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(): DocDebugOverlayPluginCreates a DocDebugOverlayPlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving DocDebugOverlayPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstart start(): voidStarts runtime behavior after the first document frame.
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- classDocInputBindingRegistrysource ↗
-
class DocInputBindingRegistryRegistry that lets multiple document plugins contribute handlers to single-subscription input adapters.
constructorconstructor DocInputBindingRegistry(): DocInputBindingRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the input binding registry.
methodclear clear(): voidRemoves every registered handler.
methodcreateKeyboardHandlers createKeyboardHandlers(): KeyboardRouterHandlersCreates the composed keyboard handlers passed to the host keyboard adapter.
methodcreateTextHandlers createTextHandlers(): TextInputHandlersCreates the composed text handlers passed to the host text adapter.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, isTearingDown: (): boolean): voidCloses registration changes after editor startup.
isCommandExecuting: (): booleanisTearingDown: (): boolean
methodregisterKeyboardHandlers registerKeyboardHandlers(handlers: KeyboardRouterHandlers): (): voidAdds keyboard-action handlers and returns a disposer.
handlers: KeyboardRouterHandlers
methodregisterTextHandlers registerTextHandlers(handlers: TextInputHandlers): (): voidAdds text-input handlers and returns a disposer.
handlers: TextInputHandlers
- classDocRenderLayoutServicesource ↗
-
class DocRenderLayoutServiceOwns 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): DocRenderLayoutServiceCreates a render-layout service for one standalone document editor.
inputPlugin: DocInputPluginextensions: DocRuntimeExtensionRegistryrenderContext: RenderContextscrollManager: ScrollManagersceneTree: Tree<PositionRect<templateLiteral>>configuration: DocEditorRuntimeConfigurationconfigEngine: ConfigEnginecursorManager: DocCursorManagercompositionProvider: DocCompositionProviderlayoutEngine: DocLayoutEnginevirtualLayouts: DocVirtualLayoutStorecommands: DocCommandBus
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the render-layout service.
methodgetLatestVirtualLayoutSummary getLatestVirtualLayoutSummary(): DocVirtualLayoutSummary | nullmethodprepareRenderLayout prepareRenderLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport, renderOperations?: DocRenderOperations): DocRenderLayoutBuilds the current render layout before plugins produce render nodes.
contentRect: DocEditorContentRectviewport: DocEditorViewportrenderOperations: DocRenderOperations
methodprepareViewportLayout prepareViewportLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport): DocRenderLayoutReuses the previous full-document layout and updates only viewport-derived fields.
contentRect: DocEditorContentRectviewport: DocEditorViewport
methodrecordBlockRenderDebugSnapshot recordBlockRenderDebugSnapshot(snapshot: DocBlockRenderDebugSnapshot): voidRecords block-render reuse/debug stats for the latest render frame.
snapshot: DocBlockRenderDebugSnapshot
methodrecordRenderPrepareTiming recordRenderPrepareTiming(mode: DocRenderPrepareMode, durationMs: number): voidmode: DocRenderPrepareModedurationMs: number
methodrefreshInteractionLayout refreshInteractionLayout(contentRect: DocEditorContentRect, _viewport: DocEditorViewport): DocRenderLayout | nullReuses the latest layout snapshot and refreshes selection/caret geometry only.
contentRect: DocEditorContentRect_viewport: DocEditorViewport
methodreset reset(): voidClears cached layout and page state.
methodsubscribeVirtualLayoutSummary subscribeVirtualLayoutSummary(listener: DocVirtualLayoutSummaryListener): (): voidlistener: DocVirtualLayoutSummaryListener
- classHistoryPluginsource ↗
-
class HistoryPlugin extends DocPlugin<null>Tracks committed document snapshots and contributes transaction-safe undo/redo commands.
constructorconstructor HistoryPlugin(input: DocInputPlugin, platform?: Platform): HistoryPlugininput: DocInputPluginplatform: Platform
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving HistoryPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: Transaction
methodconfigure configure(context: DocPluginSetupContext): voidRegisters document undo and redo shortcuts with the composed keyboard adapter.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodgetStatus getStatus(): DocHistoryStatusmethodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(): voidAligns the history baseline with state restored before Core initialization.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidUpdates 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodsubscribe subscribe(listener: (status: DocHistoryStatus): void): (): voidlistener: (status: DocHistoryStatus): void
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- classRichTextBlockNodesource ↗
-
class RichTextBlockNode extends RichTextVisualNodeScene 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 }): RichTextBlockNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws all visible text runs inside this block.
context: RenderContextclipRegion: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextBlockNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextVisualNodeScene 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>>; … }): RichTextRunNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the text run into the active world-space transform.
context: RenderContextclipRegion: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextRunNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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): SelectionPlugininput: DocInputPlugin
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SelectionPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters the host-facing selection observation.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstart start(): voidStarts runtime behavior after the first document frame.
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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(): SheetDebugOverlayPluginCreates a SheetDebugOverlayPlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetDebugOverlayPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: SheetPluginSetupContext): voidConfigures the Sheet editor before its Core is created.
context: SheetPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: SheetPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before
the first frame and other runtime effects.context: SheetPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroyinherited onEditorDestroy(context: SheetPluginRuntimeContext): voidReleases resources owned by this plugin before the Core is destroyed.
This deliberately does not use the namedestroy: 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): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCapabilitiesinherited registerCapabilities(registry: SheetRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this plugin.
registry: SheetRuntimeExtensionRegistry
methodregisterCellVisualReadersinherited registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidRegisters plugin-owned properties used to compose rendered Sheet cells.
registry: SheetCellVisualReaderRegistrycontext: SheetCellVisualReaderRegistrationContext
methodregisterCommandsinherited registerCommands(commands: SheetCommandBus): voidRegisters 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): voidContributes owner-defined format capture and transfer plans.
registry: SheetFormatTransferRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this plugin.
observations: ObservationRegistry
methodregisterQueriesinherited registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMovesinherited registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes state-owner planning for same-sheet cell moves.
registry: SheetRangeMoveRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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): voidContributes preflight and dependent operation planning for whole-axis reordering.
registry: SheetStructureMoveRegistry
methodrender render(): Node<CellProperties>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: SheetPluginRuntimeContext): voidStarts runtime behavior after the Core has rendered its first frame.
context: SheetPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: SheetPluginServiceContext): voidRegisters 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: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
memberkeyinherited key: unknownmethodapplyinherited apply(pluginState: StateType, transaction: Transaction): StateType | nullApplies a transaction to plugin-owned state and returns the next state.
pluginState: StateTypetransaction: Transaction
methodconfigure configure(context: SheetPluginSetupContext): voidConfigures the Sheet editor before its Core is created.
context: SheetPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(searCore: SearCoreSheet): unknownReturns this plugin's runtime configuration view for the current core.
searCore: SearCoreSheet
methodgetStateinherited getState(): StateTypeReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(context: SheetPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before
the first frame and other runtime effects.context: SheetPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: StateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: StateType
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroy onEditorDestroy(context: SheetPluginRuntimeContext): voidReleases resources owned by this plugin before the Core is destroyed.
This deliberately does not use the namedestroy: 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): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: StateTypetransaction: Transaction
methodregisterCapabilities registerCapabilities(registry: SheetRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this plugin.
registry: SheetRuntimeExtensionRegistry
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidRegisters plugin-owned properties used to compose rendered Sheet cells.
registry: SheetCellVisualReaderRegistrycontext: SheetCellVisualReaderRegistrationContext
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidContributes owner-defined format capture and transfer plans.
registry: SheetFormatTransferRegistry
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this plugin.
observations: ObservationRegistry
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes state-owner planning for same-sheet cell moves.
registry: SheetRangeMoveRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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): voidContributes preflight and dependent operation planning for whole-axis reordering.
registry: SheetStructureMoveRegistry
methodrenderinherited render(searCore: SearCoreSheet, offset?: { x: number; y: number }): Node<CellProperties> | Node<CellProperties>[] | nullProduces scene nodes owned by this plugin for the current core state.
searCore: SearCoreSheetoffset: { x: number; y: number }
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: StateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: StateTypecommitToken: object
methodstart start(context: SheetPluginRuntimeContext): voidStarts runtime behavior after the Core has rendered its first frame.
context: SheetPluginRuntimeContext
methodregisterServicesstatic registerServices(context: SheetPluginServiceContext): voidRegisters bindings required before this Sheet plugin is instantiated.
context: SheetPluginServiceContext
- classSheetRuntimeExtensionRegistrysource ↗
-
class SheetRuntimeExtensionRegistry extends RuntimeCapabilityRegistryRegistry 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(): SheetRuntimeExtensionRegistrymethoddestroyinherited destroy(): voidPermanently closes the registry and releases all published values.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for capability changes after assembly.
assertWrite: (): void
methodgetinherited get<T>(capability: RuntimeCapability<T>): T | undefinedcapability: RuntimeCapability<T>
methodgetRegisteredCapabilityIdsinherited getRegisteredCapabilityIds(): readonly string[]methodhasinherited has(capability: RuntimeCapability<unknown>): booleancapability: RuntimeCapability<unknown>
methodregisterinherited register<T>(capability: RuntimeCapability<T>, value: T): (): voidRegisters one value and returns an idempotent disposer for that registration.
capability: RuntimeCapability<T>value: T
methodrequireinherited require<T>(capability: RuntimeCapability<T>): Tcapability: RuntimeCapability<T>
- classTextInputPluginsource ↗
-
class TextInputPlugin extends DocPlugin<null>Owns printable text input and delete bindings.
constructorconstructor TextInputPlugin(): TextInputPluginCreates a TextInputPlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving TextInputPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters text node model support owned by this plugin.
context: DocPluginServiceContext
- classViewportOverlayNodesource ↗
-
class ViewportOverlayNode extends RichTextVisualNodeViewport 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" }): ViewportOverlayNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext): voidDraws overlay content; the node owns transform isolation for viewport-space plugins.
context: RenderContext
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): ViewportOverlayNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 DocCommandResultResult 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: PipelineCommand-owned pipeline containing mutation, render and local-action steps.
propertysessionState readonly sessionState: DocSessionState - interfaceCaptureSheetSessionStateCommandResultsource ↗
-
interface CaptureSheetSessionStateCommandResult extends SheetCommandResultResult 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: PipelinePipeline containing transaction, render, interaction and local-action steps.
propertysessionState readonly sessionState: SheetSessionState - interfaceDocBaseServicessource ↗
-
interface DocBaseServicesBase service instances created before runtime adapters and plugins are wired.
propertyconfigEngine readonly configEngine: ConfigEngineConfiguration engine registered in the DI container.
propertystage readonly stage: SceneGraph<RichTextRenderNodeProperties>Scene graph that owns standalone document content render nodes.
- interfaceDocDocumentStatesource ↗
-
interface DocDocumentStateDocument-owned rich content eligible for future ExportPlugin serialization.
propertydocument readonly document: RichDocNode[]Rich-document tree owned by this editor document.
- interfaceDocEditorsource ↗
-
interface DocEditorPublic standalone document editor API returned by
createDocEditor().propertycapabilities readonly capabilities: RuntimeCapabilityReaderRead-only access to typed services owned by this editor's isolated runtime.
propertycommands readonly commands: DocCommandBusThe supported command entry point for document user and program actions.
propertyobservations readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
methoddestroy destroy(): voidReleases listeners, timers, adapter state, and DI-owned services for this editor instance.
methodfocus focus(): voidRequests focus for the host text-input adapter, preserving IME placement.
methodgetDocument getDocument(): RichDocNode[]Returns a clone of the current rich-document content.
methodgetText getText(): stringReturns the current plain-text view using one newline between paragraphs.
methodloadDocument loadDocument(document: RichDocNode[]): voidReplaces the document content and renders the new state.
document: RichDocNode[]
methodrender render(): voidRenders the current editor state into the configured render context.
- interfaceDocEditorAdapterssource ↗
-
interface DocEditorAdaptersPlatform-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(): RenderContextCreates the visible render context used by the document editor.
methodcreateTextShaper createTextShaper(renderContext: RenderContext): TextShaperOptional text-shaping adapter; omission uses render-context measurements.
renderContext: RenderContext
methodregisterEnvironment registerEnvironment(container: Container): voidRegisters 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 DocEditorChangeSnapshot delivered when the document content changes.
- interfaceDocEditorConfigurationsource ↗
-
interface DocEditorConfigurationConfiguration for assembling a standalone rich-document editor.
propertyadapters adapters: DocEditorAdaptersPlatform 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?: numberRaster scale used to initialize and resize the render context.
propertydocumentState documentState: DocDocumentStateInitial document-owned state.
propertyfontFamily fontFamily?: stringDefault font family and fallback list applied to document text.
propertyfontSize fontSize?: numberDefault font size applied when measuring and rendering document text.
propertyincrementalRenderPolicyLimits incrementalRenderPolicyLimits?: IncrementalRenderPolicyLimitsConfigGuardrails used when deciding whether document block raster reuse should run for a frame.
propertylineHeightMultiplier lineHeightMultiplier?: numberDefault line-height multiplier applied to paragraphs without an explicit override.
propertyparagraphSpacingAfter paragraphSpacingAfter?: numberDefault 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?: DocVerticalAlignVertical positioning used by standalone document layout; defaults to top.
propertyviewport viewport?: DocEditorViewportInitial viewport size; defaults to 800 by 600 when the host cannot know it yet.
methodcontentRect contentRect(viewport: DocEditorViewport): DocEditorContentRectResolves 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): voidCalled once the editor object has been assembled and initial content rendered.
editor: DocEditor
- interfaceDocEditorContentRectsource ↗
-
interface DocEditorContentRect extends DocEditorViewportRectangle used for document text layout and rendering.
- interfaceDocEditorViewportsource ↗
-
interface DocEditorViewportViewport dimensions in host-view coordinates.
- interfaceDocHistoryEntrysource ↗
-
interface DocHistoryEntryDetached before/after snapshots for one committed document mutation.
propertyafterDocument readonly afterDocument: RichDocNode[]propertyafterSelection readonly afterSelection: DocSelectionpropertybeforeDocument readonly beforeDocument: RichDocNode[]propertybeforeSelection readonly beforeSelection: DocSelectionpropertyoperations readonly operations?: readonly RichDocOTOperation[]RichDoc OT operations committed by the document mutation.
- interfaceDocHistorySessionStatesource ↗
-
interface DocHistorySessionStateDocument-local undo and redo stacks retained during editor remounts.
- interfaceDocHistoryStatussource ↗
-
interface DocHistoryStatusCurrent document undo/redo availability.
- interfaceDocInlineStyleStatussource ↗
-
interface DocInlineStyleStatusWhether one inline style can be applied, is active, and has a common selected value.
- interfaceDocRenderLayoutsource ↗
-
interface DocRenderLayoutLayout/cache/page-map result exposed to document plugins for one render pass.
propertyblockLayoutDiff readonly blockLayoutDiff: DocBlockLayoutDiffBlock-level diff between the previous and current layout caches.
propertycomposingCaretPixelOffset readonly composingCaretPixelOffset: numberPixel offset from composing-text start to the IME caret.
propertycursorX readonly cursorX: numberCursor x in world coordinates.
propertycursorY readonly cursorY: numberCursor 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: DocLayoutCacheLatest full-document layout cache.
propertypageMap readonly pageMap: DocPageMapLatest page map derived from the layout cache.
propertyvisibleBlocks readonly visibleBlocks: readonly DocBlockLayout[]Laid-out blocks selected for plugin-owned render nodes.
- interfaceDocRuntimesource ↗
-
interface DocRuntimeRuntime 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: EventRegistrarEvent 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: DocRenderEngineDocument render engine populated with the shared Sheet-like strategy chain.
propertyscrollManager readonly scrollManager: ScrollManagerScroll manager coordinating document viewport state.
- interfaceDocViewportSessionStatesource ↗
-
interface DocViewportSessionStateLocal viewport position retained while remounting one document editor.
- interfaceExportDocStateCommandResultsource ↗
-
interface ExportDocStateCommandResult extends DocCommandResultResult of exporting detached document-owned state for an in-memory remount.
propertydocumentState readonly documentState: DocDocumentStatepropertyeffectsinherited readonly effects?: readonly DocCommandEffect[]Optional local effects requested after operation execution.
propertypipelineinherited readonly pipeline: PipelineCommand-owned pipeline containing mutation, render and local-action steps.
- interfaceExportSheetStateCommandResultsource ↗
-
interface ExportSheetStateCommandResult extends SheetCommandResultCommand 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: PipelinePipeline containing transaction, render, interaction and local-action steps.
propertysheetState readonly sheetState: SheetDocumentStateCloned state payload suitable for workbook persistence or sheet remounting.
- interfaceRichTextRenderLinesource ↗
-
interface RichTextRenderLineMinimal layout-line shape consumed by rich-text render nodes.
propertychars readonly chars: readonly RichTextRenderChar[]propertycharStartOffset readonly charStartOffset: numberpropertycursorXOffsets readonly cursorXOffsets?: readonly number[]propertyfontAscent readonly fontAscent: numberpropertyheight readonly height: numberpropertytextNodePath readonly textNodePath: readonly number[]propertyx readonly x: numberpropertyy readonly y: number - interfaceRichTextRenderNodePropertiessource ↗
-
interface RichTextRenderNodeProperties extends NodePropertiesRender-node properties used by rich-text scene graphs.
propertyblockId readonly blockId?: stringStable top-level rich-text block id.
propertyblockIndex readonly blockIndex?: numberTop-level rich-text block index.
propertybottominherited bottom?: numberpropertycontentInsetStartinherited contentInsetStart?: numberSpace reserved before projected text for a cell visual.
propertycornerRadiusinherited cornerRadius?: [number, number, number, number]propertydepthinherited depth?: numberpropertyfillinherited fill?: stringpropertyfitNumberValueinherited fitNumberValue?: numberRaw General-format number fitted against the actual render width.
propertyhideTextinherited hideText?: booleanSuppresses projected text while preserving its underlying value.
propertyhorizontalAligninherited horizontalAlign?: SheetHorizontalAlignmentpropertyisEditinherited isEdit?: booleanpropertyleftinherited left?: numberpropertylineDashinherited lineDash?: number[]propertylineIndex readonly lineIndex?: numberLayout line index inside the full rich-text snapshot.
propertynodeKeyinherited nodeKey?: stringStable 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?: PositionRectPropsOptional 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?: numberpropertysemanticOwnerinherited semanticOwner?: stringStable semantic ownership exposed by retained render targets.
propertysemanticRoleinherited semanticRole?: stringStable semantic role exposed by retained render targets.
propertyshouldBeClipInDirtyRenderinherited shouldBeClipInDirtyRender?: booleanBusiness 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?: booleanVisual-only nodes do not participate in hit canvas.
Background:FixBoxNode.drawHitfills 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.
SettingskipHit: truein properties makesdrawHitskip directly.propertystrokeinherited stroke?: stringpropertystrokeWidthinherited strokeWidth?: numberpropertytextColorinherited textColor?: stringForeground color used by text-rendering nodes.
propertytextFillCharacterinherited textFillCharacter?: stringCharacter repeated to fill the remaining inline width of formatted text.
propertytopinherited top?: numberpropertyverticalAligninherited verticalAlign?: SheetVerticalAlignment - interfaceSheetDocumentStatesource ↗
-
interface SheetDocumentStateDocument data owned by one sheet and eligible for future ExportPlugin serialization.
propertycellAlignments cellAlignments: AlignmentMatrixpropertycellBorders cellBorders?: CellBorderMatrixSparse custom cell-edge state; absence initializes an empty border owner.
propertycellFills cellFills: CellFillMatrixSparse cell fill state.
propertycellFormats cellFormats: CellFormatMatrixSparse per-cell number-format state.
propertycellHighlights cellHighlights: CellHighlightMatrixSparse conditional highlight rules anchored at their range starts.
propertycellMerges cellMerges: CellMergeMatrixpropertycellVerticalAlignments cellVerticalAlignments: VerticalAlignmentMatrixSparse vertical cell alignment state.
propertycolumnSizes columnSizes: ColumnShapeDimensionsCSRMatrixpropertydataValidations dataValidations?: DataValidationMatrixSparse data validation rules anchored at range starts.
propertyduplicates duplicates: DuplicateMatrixSparse duplicate-item highlight state.
propertyfilters filters?: SheetFilterMatrixSheet-owned filter range and column rules.
propertyfixedRows fixedRows?: FixedRowMatrixSparse per-row fixed state.
propertyfreeze freeze?: SheetFreezeMatrixPersistent top and left freeze boundaries.
propertyrowSizes rowSizes: RowShapeDimensionsCSRMatrixpropertysheetData sheetData: SheetMatrix - interfaceSheetEditorsource ↗
-
interface SheetEditorPublic contract for SheetEditor.
propertycapabilities readonly capabilities: RuntimeCapabilityReaderRead-only access to typed services owned by this editor's isolated runtime.
propertycommands readonly commands: SheetCommandBusThe sole supported entry point for user and program commands.
propertyobservations readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
propertyqueries readonly queries: SheetQueryRegistryTyped runtime query registry for side-effect-free editor reads.
methoddestroy destroy(): voidReleases runtime services and every active host observation subscription.
- interfaceSheetEditorAdapterssource ↗
-
interface SheetEditorAdaptersPlatform-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(): IFunctionRegistryCreates the function catalog owned by this editor or its parent workbook.
methodcreateRenderContexts createRenderContexts(): { hitRenderContext: RenderContext; offScreenRenderContext: RenderContext; renderContext: RenderContext }methodcreateTextShaper createTextShaper(renderContext: RenderContext): TextShaperCreates an editor-local text shaper; omission uses render-context measurements.
renderContext: RenderContext
methodregisterEnvironment registerEnvironment(container: Container): voidcontainer: Container
- interfaceSheetEditorConfigurationsource ↗
-
interface SheetEditorConfigurationPublic contract for SheetEditorConfiguration.
propertyadapters adapters: SheetEditorAdapterspropertycellFontFamily cellFontFamily?: stringDefault font family and fallback list used by ordinary Sheet cells.
propertycellFontSize cellFontSize?: numberDefault font size used by ordinary Sheet cells.
propertyembeddedEditor embeddedEditor?: SheetEmbeddedEditorOptional 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: SheetDocumentStatepropertyviewport viewport?: { height: number; width: number }methodonCreated onCreated(editor: SheetEditor): voideditor: SheetEditor
- interfaceSheetPluginImplementationsource ↗
-
interface SheetPluginImplementation<TPlugin>Injectable SheetPlugin class accepted by createSheetEditor().
constructorconstructor SheetPluginImplementation(...args: never[]): TPluginargs: never[]
propertysymbol readonly symbol: symbolmethodregisterServices registerServices(context: SheetPluginServiceContext): voidcontext: SheetPluginServiceContext
- interfaceSheetPluginRuntimesource ↗
-
interface SheetPluginRuntime extends SheetPluginSetupRuntimeRuntime 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: SheetCommandBuspropertyconfiginherited readonly config: ConfigEnginepropertydatainherited readonly data: SheetDataEnginepropertyembeddedEditorinherited 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: SheetRuntimeExtensionRegistrypropertyformulainherited 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: SheetLifecycleCoordinatorpropertyobservationsinherited readonly observations: ObservationRegistrypropertyplatforminherited readonly platform: Platformpropertypluginsinherited readonly plugins: PluginManager<SearCoreSheet, CellProperties>propertyqueriesinherited readonly queries: SheetQueryRegistrypropertyrenderinherited 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: SessionStateRegistryEditor-local capture and restore registry shared by every session-state owner.
propertytextShaperinherited readonly textShaper: TextShaperpropertytoolbar readonly toolbar: SearToolbar - interfaceSheetPluginRuntimeContextsource ↗
-
interface SheetPluginRuntimeContext extends SheetPluginSetupContextSheet setup capabilities plus the Core created by createSheetEditor().
propertycontainerinherited readonly container: Containerpropertycore readonly core: SearCoreSheetpropertyruntime readonly runtime: SheetPluginRuntimemethodaddStrategyinherited addStrategy(token: symbol, strategy: RenderStrategy<CellProperties>, position: { before: symbol } | { after: symbol }): voidtoken: symbolstrategy: RenderStrategy<CellProperties>position: { before: symbol } | { after: symbol }
- interfaceSheetPluginServiceContextsource ↗
-
interface SheetPluginServiceContextServices available while createSheetEditor() registers Sheet plugins.
propertycontainer readonly container: Container - interfaceSheetPluginSetupContextsource ↗
-
interface SheetPluginSetupContextTyped public services available before createSheetEditor() creates its Core.
propertycontainer readonly container: Containerpropertyruntime readonly runtime: SheetPluginSetupRuntimemethodaddStrategy addStrategy(token: symbol, strategy: RenderStrategy<CellProperties>, position: { before: symbol } | { after: symbol }): voidtoken: symbolstrategy: RenderStrategy<CellProperties>position: { before: symbol } | { after: symbol }
- interfaceSheetPluginSetupRuntimesource ↗
-
interface SheetPluginSetupRuntimeStable 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: ConfigEnginepropertydata readonly data: SheetDataEnginepropertyembeddedEditor 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: SheetRuntimeExtensionRegistrypropertyformula 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: SheetLifecycleCoordinatorpropertyobservations readonly observations: ObservationRegistrypropertyplatform readonly platform: Platformpropertyplugins readonly plugins: PluginManager<SearCoreSheet, CellProperties>propertyqueries readonly queries: SheetQueryRegistrypropertyrender 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: SessionStateRegistryEditor-local capture and restore registry shared by every session-state owner.
propertytextShaper readonly textShaper: TextShaper - interfaceSheetScrollToInputsource ↗
-
interface SheetScrollToInputPublic programmatic input for an absolute world-space viewport position.
- interfaceSheetViewportSessionStatesource ↗
-
interface SheetViewportSessionStateLocal viewport position retained while remounting one workbook sheet.
- typeDocInlineStyleStatesource ↗
-
type DocInlineStyleState = Readonly<Record<string, DocInlineStyleStatus>>Inline style state consumed by document toolbars and other host controls.
- typeDocSessionStatesource ↗
-
type DocSessionState = SessionStateSnapshotOpaque in-memory contributor snapshot retained while remounting a document editor.
- typeDocViewportScrollInputsource ↗
-
type DocViewportScrollInput = ScrollManagerStateInternal adapter input for one platform-originated document scroll state update.
- typeDocVirtualLayoutSummaryListenersource ↗
-
type DocVirtualLayoutSummaryListener = (summary: DocVirtualLayoutSummary): void - typeSheetRuntimeCapabilityReadersource ↗
-
type SheetRuntimeCapabilityReader = RuntimeCapabilityReaderRead-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 = ScrollManagerStateInternal adapter input for one platform-originated scroll state update.
- typeSheetSessionStatesource ↗
-
type SheetSessionState = SessionStateSnapshotOpaque, 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): SheetDocumentStateTakes 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): DocEditorAssembles 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.
Exampleconst 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): SheetDocumentStateCreates an empty Sheet document with matching dimensions for import adapters.
rowCount: numbercolumnCount: 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: numberbaselineY: numberwidth: numberheight: numberfontAscent: number
- functioncreateSheetEditorsource ↗
-
createSheetEditor(options: SheetEditorConfiguration): SheetEditorAssembles 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 calldestroy()when the session is
no longer mounted.ReturnsA fully initialized Sheet editor facade.
Exampleconst 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): TSheetStateDeserializes one Sheet document state through registered state-owner codecs.
payload: unknownregistry: DocumentStateCodecRegistry<TSheetState>path: string
- functionregisterDefaultDependenciessource ↗
-
registerDefaultDependencies(container: Container): voidRegisters 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: Containermanager: PluginManager<SearCoreDoc, NodeProperties>implementations: false | readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined
- functionregisterDocBaseServicessource ↗
-
registerDocBaseServices(container: Container, adapters: DocEditorAdapters, _viewport: DocEditorViewport, defaultConfigOverrides?: EditorDefaultConfigOverrides<DocConfig>): DocBaseServicesRegisters document editor base services into the DI container.
container: Containeradapters: DocEditorAdapters_viewport: DocEditorViewportdefaultConfigOverrides: EditorDefaultConfigOverrides<DocConfig>
- functionregisterDocConfigCommandssource ↗
-
registerDocConfigCommands(commands: DocCommandBus, config: ConfigEngine<DocConfig>): voidRegisters Doc configuration changes on the owning command bus.
commands: DocCommandBusconfig: ConfigEngine<DocConfig>
- functionregisterDocDocumentObservationsource ↗
-
registerDocDocumentObservation(observations: ObservationRegistry, document: DocDocumentSessionCoordinator): voidRegisters the document-owned read projection with the editor observation registry.
observations: ObservationRegistrydocument: 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: Containermanager: PluginManager<SearCoreDoc, NodeProperties>implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined
- functionregisterDocInlineStyleObservationsource ↗
-
registerDocInlineStyleObservation(observations: ObservationRegistry, input: DocInputPlugin, inlineStyles: RichTextInlineStyleRegistry): voidRegisters the selection-derived inline-style state with the editor observation registry.
observations: ObservationRegistryinput: DocInputPlugininlineStyles: RichTextInlineStyleRegistry
- functionregisterDocRuntimesource ↗
-
registerDocRuntime(container: Container, adapters: DocEditorAdapters, viewport: DocEditorViewport): DocRuntimeRegisters render, input, scroll, command, and plugin runtime services for Doc.
container: Containeradapters: DocEditorAdaptersviewport: DocEditorViewport
- functionregisterDocSessionStateCommandssource ↗
-
registerDocSessionStateCommands(commands: DocCommandBus, session: SessionStateRegistry): voidRegisters the in-memory document session capture command.
commands: DocCommandBussession: SessionStateRegistry
- functionregisterDocStateSnapshotCommandssource ↗
-
registerDocStateSnapshotCommands(commands: DocCommandBus, document: DocDocumentSessionCoordinator): voidRegisters the document-owned state snapshot command.
commands: DocCommandBusdocument: DocDocumentSessionCoordinator
- functionregisterDocViewportCommandssource ↗
-
registerDocViewportCommands(input: { commands: DocCommandBus; renderCoordinator: DocRenderCoordinator; scrollManager: ScrollManager; viewportEnvironment: DocViewportEnvironment }): voidRegisters 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): voidRegisters viewport remount state and its host-facing observation.
session: SessionStateRegistryobservations: ObservationRegistryscrollManager: ScrollManager
- functionregisterSheetConfigCommandssource ↗
-
registerSheetConfigCommands(commands: SheetCommandBus, config: ConfigEngine<SheetConfig>): voidRegisters Sheet configuration changes on the owning command bus.
commands: SheetCommandBusconfig: ConfigEngine<SheetConfig>
- functionregisterSheetPluginCapabilitiessource ↗
-
registerSheetPluginCapabilities(plugins: readonly unknown[], registry: SheetRuntimeExtensionRegistry): voidPublishes every typed runtime capability contributed by Sheet plugins.
plugins: readonly unknown[]registry: SheetRuntimeExtensionRegistry
- functionregisterSheetPluginCellVisualReaderssource ↗
-
registerSheetPluginCellVisualReaders(plugins: readonly unknown[], registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidRegisters every plugin-owned Sheet cell visual reader.
plugins: readonly unknown[]registry: SheetCellVisualReaderRegistrycontext: SheetCellVisualReaderRegistrationContext
- functionregisterSheetPluginCommandssource ↗
-
registerSheetPluginCommands(plugins: readonly unknown[], commands: SheetCommandBus): voidRuns the register sheet plugin commands helper.
plugins: readonly unknown[]commands: SheetCommandBus
- functionregisterSheetPluginObservationssource ↗
-
registerSheetPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): voidRegisters every typed observation source contributed by Sheet plugins.
plugins: readonly unknown[]observations: ObservationRegistry
- functionregisterSheetPluginQueriessource ↗
-
registerSheetPluginQueries(plugins: readonly unknown[], queries: SheetQueryRegistry): voidplugins: readonly unknown[]queries: SheetQueryRegistry
- functionregisterSheetPluginSessionStatessource ↗
-
registerSheetPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): voidRegisters every local session-state adapter contributed by Sheet plugins.
plugins: readonly unknown[]registry: SessionStateRegistry
- functionregisterSheetSessionStateCommandssource ↗
-
registerSheetSessionStateCommands(commands: SheetCommandBus, session: SessionStateRegistry): voidRegisters the in-memory Sheet session capture command.
commands: SheetCommandBussession: SessionStateRegistry
- functionregisterSheetStateSnapshotCommandssource ↗
-
registerSheetStateSnapshotCommands(commands: SheetCommandBus, pluginManager: PluginManager<SearCoreSheet, CellProperties>): voidRegisters sheet state snapshot commands for the default sheet assembly.
commands: SheetCommandBuspluginManager: PluginManager<SearCoreSheet, CellProperties>
- functionregisterSheetViewportCommandssource ↗
-
registerSheetViewportCommands(commands: SheetCommandBus, scrollManager: ScrollManager, resizeController: SheetViewportResizeController): voidRegisters viewport-owned commands on the editor command bus.
commands: SheetCommandBusscrollManager: ScrollManagerresizeController: SheetViewportResizeController
- functionregisterSheetViewportSessionStatesource ↗
-
registerSheetViewportSessionState(registry: SessionStateRegistry, scrollManager: ScrollManager): voidRegisters viewport-owned local remount state with the editor-local registry.
registry: SessionStateRegistryscrollManager: ScrollManager
- functionserializeSheetDocumentStatesource ↗
-
serializeSheetDocumentState<TSheetState>(sheetState: TSheetState, registry?: DocumentStateCodecRegistry<TSheetState>): SearSheetDocumentFileSerializes one Sheet document state through registered state-owner codecs.
sheetState: TSheetStateregistry: DocumentStateCodecRegistry<TSheetState>
- enumBoldTextStyleKeysource ↗
-
enum BoldTextStyleKeyPersisted style key owned by the bold text-style plugin.
enum memberBold Bold: "bold" - classBoldTextStylePluginsource ↗
-
class BoldTextStylePlugin extends InlineTextStylePluginBaseContributes bold rendering and bold document commands.
constructorconstructor BoldTextStylePlugin(): BoldTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving BoldTextStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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: PluginKeyDefault document feature plugin keys used by command pipelines.
- interfaceDocInteractionRuntimesource ↗
-
interface DocInteractionRuntimeView services exposed to document interaction plugins.
methodgetContentRect getContentRect(): DocInteractionContentRectmethodgetRoot getRoot(): unknownmethodgetViewport getViewport(): DocInteractionViewportmethodreadRootViewOffset readRootViewOffset(): { x: number; y: number }methodresolveCursorFromPointer resolveCursorFromPointer(input: DocPointerInput): DocCursorPosinput: DocPointerInput
methodsubscribePointerDrag subscribePointerDrag(handlers: DocPointerDragHandlers): (): voidhandlers: 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: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
memberkeyinherited key: unknownmethodapplyinherited apply(pluginState: StateType, transaction: Transaction): StateType | nullApplies a transaction to plugin-owned state and returns the next state.
pluginState: StateTypetransaction: Transaction
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(searCore: SearCoreDoc): unknownReturns this plugin's runtime configuration view for the current core.
searCore: SearCoreDoc
methodgetStateinherited getState(): StateTypeReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: StateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: StateType
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(context: DocPluginRuntimeContext): voidReleases resources owned by this plugin before the Core is destroyed.
context: DocPluginRuntimeContext
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: StateTypetransaction: Transaction
methodregisterBlockFlows registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilities registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStyles registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
searCore: SearCoreDocoffset: { x: number; y: number }
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: StateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: StateTypecommitToken: object
methodstart start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- interfaceDocPluginImplementationsource ↗
-
interface DocPluginImplementation<TPlugin>Injectable DocPlugin class accepted by createDocEditor().
constructorconstructor DocPluginImplementation(...args: never[]): TPluginargs: never[]
propertysymbol readonly symbol: symbolmethodregisterServices registerServices(context: DocPluginServiceContext): voidcontext: DocPluginServiceContext
- interfaceDocPluginRuntimesource ↗
-
interface DocPluginRuntimeStable host capabilities supplied to a DocPlugin after editor assembly.
propertycommands readonly commands: DocCommandBusCommand 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: DocRuntimeExtensionRegistryExtension 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: ObservationRegistryTyped state and event observations owned by this editor instance.
propertyplatform readonly platform: PlatformPlatform 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: SessionStateRegistryLocal remount state contributed by built-in and third-party plugins.
propertytextShaper readonly textShaper: TextShaperText 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 DocPluginSetupContextDocument setup capabilities plus the Core created by createDocEditor().
- interfaceDocPluginServiceContextsource ↗
-
interface DocPluginServiceContextServices available while createDocEditor() registers document plugins.
propertycontainer readonly container: ContainerDI container used by the document assembly root.
- interfaceDocPluginSetupContextsource ↗
-
interface DocPluginSetupContextTyped public services available before createDocEditor() starts Core.
- 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 = RuntimeCapabilityReaderRead-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 RuntimeCapabilityRegistryRegistry of extension capabilities available to document plugins.
constructorconstructor DocRuntimeExtensionRegistry(): DocRuntimeExtensionRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the document runtime extension registry.
methoddestroyinherited destroy(): voidPermanently closes the registry and releases all published values.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for capability changes after assembly.
assertWrite: (): void
methodgetinherited get<T>(capability: RuntimeCapability<T>): T | undefinedcapability: RuntimeCapability<T>
methodgetRegisteredCapabilityIdsinherited getRegisteredCapabilityIds(): readonly string[]methodhasinherited has(capability: RuntimeCapability<unknown>): booleancapability: RuntimeCapability<unknown>
methodregisterinherited register<T>(capability: RuntimeCapability<T>, value: T): (): voidRegisters one value and returns an idempotent disposer for that registration.
capability: RuntimeCapability<T>value: T
methodrequireinherited require<T>(capability: RuntimeCapability<T>): Tcapability: RuntimeCapability<T>
- interfaceDocVirtualLayoutSummarysource ↗
-
interface DocVirtualLayoutSummaryPublic virtual layout summary exposed through the Doc layout-service capability.
propertyblockRender readonly blockRender?: DocBlockRenderDebugSnapshotpropertycacheHits readonly cacheHits: numberpropertycacheMisses readonly cacheMisses: numberpropertycursorBlock readonly cursorBlock: number | nullpropertydocumentHeight readonly documentHeight: numberpropertyheightIndexUpdated readonly heightIndexUpdated: booleanpropertyinitialLoadMs readonly initialLoadMs?: numberpropertymaterializedBlocks readonly materializedBlocks: numberpropertymaterializedIndexes readonly materializedIndexes: stringpropertymodel readonly model: "reused" | "rebuilt"propertyrangeEnd readonly rangeEnd: numberpropertyrangeStart readonly rangeStart: numberpropertyrenderPhase readonly renderPhase?: DocVirtualLayoutRenderPhasepropertytimings readonly timings: DocVirtualLayoutTimingSummarypropertytotalBlocks readonly totalBlocks: number - variableFocusDocCommandsource ↗
-
FocusDocCommand: DocCommandDefinition<void, DocCommandResult>Focuses the host text-input adapter for the document editor.
- enumFontFamilyTextStyleKeysource ↗
-
enum FontFamilyTextStyleKeyPersisted style key owned by the font-family text-style plugin.
enum memberFontFamily FontFamily: "fontFamily" - classFontFamilyTextStylePluginsource ↗
-
class FontFamilyTextStylePlugin extends InlineTextStylePluginBaseContributes font-family rendering and the set-font-family document command.
constructorconstructor FontFamilyTextStylePlugin(): FontFamilyTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FontFamilyTextStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- enumFontSizeTextStyleKeysource ↗
-
enum FontSizeTextStyleKeyPersisted style key owned by the font-size text-style plugin.
enum memberFontSize FontSize: "fontSize" - classFontSizeTextStylePluginsource ↗
-
class FontSizeTextStylePlugin extends InlineTextStylePluginBaseContributes font-size rendering and the set-font-size document command.
constructorconstructor FontSizeTextStylePlugin(): FontSizeTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FontSizeTextStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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 InsertDocTableInputInput accepted by InsertDocTableCommand.
- variableInsertDocTextCommandsource ↗
-
InsertDocTextCommand: DocCommandDefinition<InsertDocTextInput, DocCommandResult>Inserts text at the current document selection.
- interfaceInsertDocTextInputsource ↗
-
interface InsertDocTextInputInput accepted by InsertDocTextCommand.
propertytext readonly text: stringText to insert at the current document selection.
- enumItalicTextStyleKeysource ↗
-
enum ItalicTextStyleKeyenum memberItalic Italic: "italic" - classItalicTextStylePluginsource ↗
-
class ItalicTextStylePlugin extends InlineTextStylePluginBaseContributes italic rendering, mutation, and keyboard commands.
constructorconstructor ItalicTextStylePlugin(): ItalicTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
- variableLoadDocumentCommandsource ↗
-
LoadDocumentCommand: DocCommandDefinition<LoadDocumentInput, DocCommandResult>Replaces the active document content.
- interfaceLoadDocumentInputsource ↗
-
interface LoadDocumentInputInput 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 MoveDocCursorInputInput accepted by MoveDocCursorCommand.
- classParagraphPluginsource ↗
-
class ParagraphPlugin extends DocPlugin<null>Registers paragraph and text node model support plus block-level commands.
constructorconstructor ParagraphPlugin(): ParagraphPluginCreates a ParagraphPlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving ParagraphPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlows registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters paragraph node model support owned by this plugin.
context: DocPluginServiceContext
- functionreadSessionStatesource ↗
-
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefinedReads one contributor value from an opaque snapshot through its typed definition.
snapshot: SessionStateSnapshotdefinition: SessionStateDefinition<State>
- functionregisterDocPluginCapabilitiessource ↗
-
registerDocPluginCapabilities(plugins: readonly unknown[], registry: DocRuntimeExtensionRegistry): voidPublishes every typed runtime capability contributed by document plugins.
plugins: readonly unknown[]registry: DocRuntimeExtensionRegistry
- functionregisterDocPluginCommandssource ↗
-
registerDocPluginCommands(plugins: readonly unknown[], commands: DocCommandBus): (): voidRuns the register document plugin commands helper.
plugins: readonly unknown[]commands: DocCommandBus
- functionregisterDocPluginInlineStylessource ↗
-
registerDocPluginInlineStyles(plugins: readonly unknown[], registry: RichTextInlineStyleRegistry): (): voidRegisters every inline text-style contribution owned by document plugins.
plugins: readonly unknown[]registry: RichTextInlineStyleRegistry
- functionregisterDocPluginLineBoxessource ↗
-
registerDocPluginLineBoxes(plugins: readonly unknown[], registry: RichTextLineBoxRegistry): (): voidRegisters every rich-text line box contribution owned by document plugins.
plugins: readonly unknown[]registry: RichTextLineBoxRegistry
- functionregisterDocPluginObservationssource ↗
-
registerDocPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): voidRegisters every typed observation source contributed by document plugins.
plugins: readonly unknown[]observations: ObservationRegistry
- functionregisterDocPluginSessionStatessource ↗
-
registerDocPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): voidRegisters 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(): RichTextLineBoxPluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving RichTextLineBoxPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(context: DocPluginRuntimeContext): voidReleases resources owned by this plugin before the Core is destroyed.
context: DocPluginRuntimeContext
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommandsinherited registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxes registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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: SessionStateRestorePhaseLifecycle phase in which restore() may safely update the owning feature.
methodcapture capture(): State | undefinedReturns plain data or a supported built-in value; custom class instances are not session snapshots.
methodrestore restore(state: State): voidRestores local state during the declared lifecycle phase.
state: State
- interfaceSessionStateDefinitionsource ↗
-
interface SessionStateDefinition<State>Typed identity owned and exported by one local-state contributor.
- classSessionStateErrorsource ↗
-
class SessionStateError extends SearErrorError raised when a session-state contributor violates its registry contract.
constructorconstructor SessionStateError(code: SessionStateErrorCode, message: string, details?: SearErrorDetails): SessionStateErrorCreates a session-state contract error.
code: SessionStateErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: SessionStateErrorCodeStable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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 SessionStateRegistryEditor-local coordinator for all built-in and plugin-contributed session state.
constructorconstructor SessionStateRegistry(): SessionStateRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the editor-local registry.
methodassertRestorationOpen assertRestorationOpen(): voidRejects a retained contributor restore callback after editor initialization.
methodcapture capture(): SessionStateSnapshotCaptures every registered contributor while preserving state whose owner is not loaded.
methodclear clear(lifecycleToken?: object): voidClears 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): voidLoads a complete snapshot before lifecycle restoration begins.
snapshot: SessionStateSnapshot
methodregister register<State>(definition: SessionStateDefinition<State>, adapter: SessionStateAdapter<State>): (): voidRegisters one state owner and returns an idempotent disposer.
definition: SessionStateDefinition<State>adapter: SessionStateAdapter<State>
methodrestorePhase restorePhase(phase: SessionStateRestorePhase): voidRestores every registered contributor assigned to one ordered lifecycle phase.
phase: SessionStateRestorePhase
methodsealRestoration sealRestoration(lifecycleToken: object): voidCloses 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 SetDocBoldInputInput 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 SetDocCompositionInputInput accepted by SetDocCompositionCommand.
propertycaretOffset readonly caretOffset: numberCaret offset inside the composing text.
propertytext readonly text: stringCurrent composing text emitted by the host input method.
- variableSetDocFontFamilyCommandsource ↗
-
SetDocFontFamilyCommand: DocCommandDefinition<SetDocFontFamilyInput, DocCommandResult>Sets the font family on the selected document text.
- interfaceSetDocFontFamilyInputsource ↗
-
interface SetDocFontFamilyInputInput 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 SetDocFontSizeInputInput accepted by SetDocFontSizeCommand. A null or empty value clears the font size.
propertyfontSize readonly fontSize: number | null - variableSetDocItalicCommandsource ↗
-
SetDocItalicCommand: DocCommandDefinition<SetDocItalicInput, DocCommandResult> - interfaceSetDocItalicInputsource ↗
-
interface SetDocItalicInputpropertyitalic readonly italic: boolean | null - variableSetDocSelectionCommandsource ↗
-
SetDocSelectionCommand: DocCommandDefinition<SetDocSelectionInput, DocCommandResult>Sets the active document selection without changing content.
- interfaceSetDocSelectionInputsource ↗
-
interface SetDocSelectionInputInput accepted by SetDocSelectionCommand.
propertyselection readonly selection: DocSelectionSelection to make active in the document editor.
- variableSetDocStrikethroughCommandsource ↗
-
SetDocStrikethroughCommand: DocCommandDefinition<SetDocStrikethroughInput, DocCommandResult> - interfaceSetDocStrikethroughInputsource ↗
-
interface SetDocStrikethroughInputpropertystrikethrough readonly strikethrough: boolean | null - variableSetDocTextColorCommandsource ↗
-
SetDocTextColorCommand: DocCommandDefinition<SetDocTextColorInput, DocCommandResult>Sets the text color on the selected document text.
- interfaceSetDocTextColorInputsource ↗
-
interface SetDocTextColorInputInput accepted by SetDocTextColorCommand. A null or empty value clears the text color.
propertycolor readonly color: string | null - variableSetDocUnderlineCommandsource ↗
-
SetDocUnderlineCommand: DocCommandDefinition<SetDocUnderlineInput, DocCommandResult> - interfaceSetDocUnderlineInputsource ↗
-
interface SetDocUnderlineInputpropertyunderline readonly underline: boolean | null - variableSplitDocParagraphCommandsource ↗
-
SplitDocParagraphCommand: DocCommandDefinition<void, DocCommandResult>Splits the current paragraph at the current document selection.
- enumStrikethroughTextStyleKeysource ↗
-
enum StrikethroughTextStyleKeyenum memberStrikethrough Strikethrough: "strikethrough" - classStrikethroughTextStylePluginsource ↗
-
class StrikethroughTextStylePlugin extends InlineTextStylePluginBaseContributes strikethrough rendering, mutation, and keyboard commands.
constructorconstructor StrikethroughTextStylePlugin(): StrikethroughTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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(): TablePluginCreates a TablePlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving TablePlugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigure configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroy onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstatic registerServices(context: DocPluginServiceContext): voidRegisters table node model support owned by this plugin.
context: DocPluginServiceContext
- enumTextColorStyleKeysource ↗
-
enum TextColorStyleKeyPersisted style key owned by the text-color style plugin.
enum memberColor Color: "color" - classTextColorStylePluginsource ↗
-
class TextColorStylePlugin extends InlineTextStylePluginBaseContributes text-color rendering and mutation for text nodes.
constructorconstructor TextColorStylePlugin(): TextColorStylePluginCreates a TextColorStylePlugin instance.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving TextColorStylePlugin.
memberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlersinherited registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
context: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters 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 UnderlineTextStyleKeyenum memberUnderline Underline: "underline" - classUnderlineTextStylePluginsource ↗
-
class UnderlineTextStylePlugin extends InlineTextStylePluginBaseContributes underline rendering, mutation, and keyboard commands.
constructorconstructor UnderlineTextStylePlugin(): UnderlineTextStylePluginpropertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapplyinherited apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: unknown
methodconfigureinherited configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
context: DocPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreDoc, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreDoctransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfiginherited getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before runtime effects.
context: DocPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonEditorDestroyinherited onEditorDestroy(): voidReleases resources owned by this plugin before the Core is destroyed.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreDoc, cell: unknown, row: number, col: number): voidReceives 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: SearCoreDoccell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreDoc): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreDoc
methodonMouseDowninherited onMouseDown(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreDoc, event: EventWithOffsetAndTarget<NodeProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreDocevent: EventWithOffsetAndTarget<NodeProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterBlockFlowsinherited registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registry: RichTextBlockFlowRegistry
methodregisterCapabilitiesinherited registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registry: DocRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: DocCommandBus): voidRegisters 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): voidRegisters plugin-owned render behavior for styled text runs.
registry: RichTextRunRenderRegistry
methodregisterInlineStylesinherited registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registry: RichTextInlineStyleRegistry
methodregisterKeyboardHandlers registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters keyboard-to-command bindings owned by this document plugin.
__namedParameters: DocKeyboardHandlerRegistrationContext
methodregisterLineBoxesinherited registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registry: RichTextLineBoxRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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>[] | nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstartinherited start(context: DocPluginRuntimeContext): voidStarts runtime behavior after the first document frame.
context: DocPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
context: DocPluginServiceContext
Package
@searsuite/sear-assembly-test
Reusable test platforms, render contexts, and editor fixtures for package consumers.
- classRecordingRenderContextsource ↗
-
class RecordingRenderContext extends RenderContextRenderContext implementation that records drawing calls without Canvas pixels.
constructorconstructor RecordingRenderContext(): RecordingRenderContextpropertycalls readonly calls: RenderCall[]Recorded render calls captured by RecordingRenderContext.
propertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstaticinherited readonly symbol: symbolDI token for the primary visible render layer.
methodaddClickEventListener addClickEventListener(callBack: (event: EventWithOffset): void): voidAdds the click event listener.
callBack: (event: EventWithOffset): void
methodaddEventListener addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidAdds the event listener.
type: stringcallBack: (event: EventWithOffset): void
methodaddMouseDownEventListener addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAdds the mouse down event listener.
callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAdds the mouse move event listener.
callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAdds the mouse up event listener.
callBack: (event: EventWithOffset): void
methodaddResizeListener addResizeListener(_callBack: (): void): voidAdds the resize listener.
_callBack: (): void
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPath beginPath(): voidBegins a recorded vector path.
methodclearRect clearRect(x: number, y: number, width: number, height: number): voidRecords a rectangular clear operation.
x: numbery: numberwidth: numberheight: number
methodclip clip(): voidClips subsequent recorded operations to the current path.
methodcloneNode cloneNode(): RenderContextCreates an independent copy of a recorded render node.
methodclosePath closePath(): voidCloses the current recorded vector path.
methodcreateHitNode createHitNode(): RenderContextCreates the hit node.
methoddrawImage drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidRecords an image draw operation using the supplied source and bounds.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemanticsinherited endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfill fill(): voidFills the current path or exposes the node fill paint, depending on the render contract.
methodfillText fillText(text: string, x: number, y: number, maxWidth?: number): voidRecords text painting at the supplied position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttribute getAttribute(name: string): stringReturns 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(): numberReturns the line width.
methodgetMaxLineWidth getMaxLineWidth(): numberReturns the max line width.
methodgetRasterScale getRasterScale(): numberReturns the raster scale.
methodgetRenderTarget getRenderTarget(): objectReturns the render target.
methodgetRoot getRoot(): EventTargetReturns the root.
methodgetViewScale getViewScale(): numberReturns the view scale.
methodinitialize initialize(_scale?: number): voidInitializes the recording context for a render target.
_scale: number
methodlineTo lineTo(x: number, y: number): voidAdds a line segment to the current recorded path.
x: numbery: 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): voidMoves the current recorded path without drawing a segment.
x: numbery: number
methodputImageData putImageData(imageData: RenderImageData, x: number, y: number): voidRecords raw pixel data at the supplied position.
imageData: RenderImageDatax: numbery: number
methodrect rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the current recorded path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListener removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves the click event listener.
callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves the mouse down event listener.
callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves the mouse move event listener.
callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves the mouse up event listener.
callBack: (event: EventWithOffset): void
methodremoveResizeListener removeResizeListener(): voidRemoves the resize listener.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransform resetTransform(): voidRestores the recorded transform to the identity matrix.
methodresize resize(width: number, height: number, scale?: number): voidResizes the render target and invalidates dependent frame state.
width: numberheight: numberscale: number
methodrestore restore(): voidRestores the most recently saved render state.
methodsave save(): voidPushes the current render state onto the recording stack.
methodsetAttribute setAttribute(name: string, value: string): voidUpdates the attribute.
name: stringvalue: string
methodsetFillStyle setFillStyle(fillStyle: RenderPaint): voidUpdates the fill style.
fillStyle: RenderPaint
methodsetFont setFont(font: string): voidUpdates the font.
font: string
methodsetLineDash setLineDash(segments: number[]): voidUpdates the line dash.
segments: number[]
methodsetLineWidth setLineWidth(width: number): voidUpdates the line width.
width: number
methodsetStrokeStyle setStrokeStyle(strokeStyle: RenderPaint): voidUpdates the stroke style.
strokeStyle: RenderPaint
methodsetTransform setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidUpdates the transform.
a: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScale setViewScale(scale: number): voidUpdates the view scale.
scale: number
methodstroke stroke(): voidStrokes the current recorded path.
methodstrokeRect strokeRect(x: number, y: number, width: number, height: number): voidRecords a stroked rectangle operation.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslate translate(x: number, y: number): voidOffsets subsequent recorded operations by the supplied vector.
x: numbery: number
- classTestPlatformsource ↗
-
class TestPlatform extends PlatformDeterministic Platform implementation for harnesses and integration tests.
constructorconstructor TestPlatform(): TestPlatformpropertysymbolstaticinherited readonly symbol: symbolDI token for resolving Platform.
methodaddEventListener addEventListener(_target: unknown, _type: string, _listener: (event: unknown): void): (): voidRegisters a host event listener and returns an idempotent disposer.
_target: unknown_type: string_listener: (event: unknown): void
methodcancelAnimationFrame cancelAnimationFrame(handle: number): voidCancels a previously scheduled host animation frame.
handle: number
methodclearInterval clearInterval(handle: number): voidCancels a repeating host timer.
handle: number
methodclearTimeout clearTimeout(handle: number): voidCancels a one-shot host timer.
handle: number
methodcreateId createId(prefix?: string): stringCreates a deterministic test identifier.
prefix: string
methodcurrentDateTime currentDateTime(): numberReturns the test host wall-clock time as Unix milliseconds.
methoddestroy destroy(): voidReleases resources owned by TestPlatform.
methodflush flush(): voidRuns all pending one-shot callbacks once, in creation order.
methodnow now(): numberReturns the current test platform time.
methodobserveResize observeResize(_target: unknown, _callback: (size: { height: number; width: number }): void): (): voidObserves host-view size changes and returns an idempotent disposer.
_target: unknown_callback: (size: { height: number; width: number }): void
methodqueueMicrotask queueMicrotask(callback: (): void): voidQueues a microtask in the test platform.
callback: (): void
methodreadViewOffset readViewOffset(_target: unknown): PlatformViewOffsetTest targets have no host-space offset unless a fixture overrides it.
_target: unknown
methodrequestAnimationFrame requestAnimationFrame(callback: PlatformFrameRequestCallback): numberSchedules a callback for the next host animation frame.
callback: PlatformFrameRequestCallback
methodsetInterval setInterval(callback: (): void, _ms: number): numberUpdates the interval.
callback: (): void_ms: number
methodsetTimeout setTimeout(callback: (): void, _ms: number): numberUpdates the timeout.
callback: (): void_ms: number
methodtoLowerCaseinherited toLowerCase(value: string): stringConverts text to lowercase without consulting the host's locale.
value: string
methodwarn warn(_message: string, ..._details: unknown[]): voidRecords or emits a platform warning.
_message: string_details: unknown[]
- interfaceCreateTestSheetOptionssource ↗
-
interface CreateTestSheetOptionsTest support contract for CreateTestSheetOptions.
- interfaceRenderCallsource ↗
-
interface RenderCallTest support contract for RenderCall.
- interfaceTestPluginRegistrationsource ↗
-
interface TestPluginRegistrationTest support contract for TestPluginRegistration.
propertyimplementation implementation: (...args: never[]): Plugin<SearCoreSheet, CellProperties, unknown>propertytoken token: symbol - interfaceTestProviderOverridesource ↗
-
interface TestProviderOverrideTest support contract for TestProviderOverride.
methodregister register(container: Container): voidcontainer: Container
- interfaceTestSheetCellsource ↗
-
interface TestSheetCellTest support contract for TestSheetCell.
- interfaceTestSheetDataOptionssource ↗
-
interface TestSheetDataOptionsTest support contract for TestSheetDataOptions.
- interfaceTestSheetHarnesssource ↗
-
interface TestSheetHarnessTest support contract for TestSheetHarness.
propertycommands readonly commands: SheetCommandBuspropertycontainer readonly container: Containerpropertycore readonly core: SearCoreSheetpropertyhitRenderContext readonly hitRenderContext: RecordingRenderContextpropertyoffScreenRenderContext readonly offScreenRenderContext: RecordingRenderContextpropertyrenderContext readonly renderContext: RecordingRenderContextpropertystage readonly stage: SceneGraph<CellProperties>methoddestroy destroy(): voidmethodexecuteTransaction executeTransaction(transaction: Transaction): voidtransaction: Transaction
methodflush flush(): void - functioncreateTestSheetsource ↗
-
createTestSheet(options?: CreateTestSheetOptions): TestSheetHarnessBuilds the smallest real Sheet runtime that includes the render pipeline.
Browser and scheduling boundaries are replaced with deterministic test implementations.options: CreateTestSheetOptions
Package
@searsuite/sear-assembly-workbook
Workbook structure, Sheet mounting, workbook commands, sessions, and shared runtime services.
- classWorkbookCollaborationPluginsource ↗
-
class WorkbookCollaborationPlugin extends WorkbookPlugin, WorkbookCollaborationSessionOwns collaboration state beyond the lifetime of any temporary active SheetEditor.
constructorconstructor WorkbookCollaborationPlugin(transports: WorkbookCollaborationTransportFactory, platform: Platform): WorkbookCollaborationPlugintransports: WorkbookCollaborationTransportFactoryplatform: Platform
propertysymbolstatic readonly symbol: typeof symbolmethodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidCloses 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 | undefinedsheetId: string
methodinitialize initialize(context: WorkbookPluginContext): (): voidcontext: WorkbookPluginContext
methodonBeforeSheetActivationinherited onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): voidRuns inside the activation command before the source Sheet is captured.
input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): voidRestores plugin-local work if activation fails before commit.
input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted onTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidevent: WorkbookTransactionCommittedEvent
methodonWorkbookDestroy onWorkbookDestroy(): voidmethodregisterCapabilities registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): voidRegisters every runtime capability owned by this plugin.
registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: WorkbookCommandBus): voidRegisters every stable command id owned by this plugin.
commands: WorkbookCommandBus
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters every typed state and event observation source owned by this plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters every local session value owned by this plugin.
registry: SessionStateRegistry
methodregisterServicesstaticinherited registerServices(context: WorkbookPluginServiceContext): voidcontext: WorkbookPluginServiceContext
- classWorkbookCommandBussource ↗
-
class WorkbookCommandBusEditor-scoped command bus for workbook-level sheet-list actions.
constructorconstructor WorkbookCommandBus(options?: WorkbookCommandBusOptions): WorkbookCommandBusCreates an empty workbook command bus.
options: WorkbookCommandBusOptions
propertysymbolstatic readonly symbol: typeof symbolDI token for the command bus owned by one WorkbookEditor.
methoddestroy destroy(): voidClears listeners and command registrations during teardown.
methodenforceRegistrationBoundary enforceRegistrationBoundary(assertWrite: (): void): voidCloses 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>): booleanReturns whether this workbook editor currently exposes a command id.
definition: string | WorkbookCommandDefinition<unknown, unknown>
methodisExecuting isExecuting(): booleanWhether this WorkbookEditor is currently dispatching a command.
methodregister register<Definition>(definition: Definition, handler: WorkbookCommandHandler<Definition>): (): voidRegisters one workbook command handler. The returned disposer removes the
handler and is primarily useful for extension commands.definition: Definitionhandler: WorkbookCommandHandler<Definition>
methodrun run<Definition>(definition: Definition, input: WorkbookCommandInput<Definition>): WorkbookCommandDefinitionResult<Definition>Executes a registered workbook command through its typed definition.
definition: Definitioninput: WorkbookCommandInput<Definition>
methodrunWithoutMutationAuthority runWithoutMutationAuthority<Value>(callback: (): Value): ValueInvokes external observers without inheriting this editor's command write authority.
callback: (): Value
methodsubscribe subscribe(listener: WorkbookCommandListener): (): voidSubscribes to command lifecycle events and returns an unsubscribe function.
listener: WorkbookCommandListener
- classWorkbookFormulaDependencyGraphsource ↗
-
class WorkbookFormulaDependencyGraphWorkbook-qualified dependency graph owned by WorkbookFormulaPlugin.
constructorconstructor WorkbookFormulaDependencyGraph(): WorkbookFormulaDependencyGraphmemberdirtySize dirtySize: unknownmemberresultSize resultSize: unknownmembersize size: unknownmethodclear clear(): voidRemoves 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 | undefinedReturns a derived workbook formula result, or #REF! when references are broken.
formulaCell: WorkbookCellReference
methodhasBrokenReferences hasBrokenReferences(formulaCell: WorkbookCellReference): booleanReports whether one formula cell currently contains broken references.
formulaCell: WorkbookCellReference
methodhasFormulaCell hasFormulaCell(formulaCell: WorkbookCellReference): booleanReports whether one workbook-qualified cell is registered as a formula cell.
formulaCell: WorkbookCellReference
methodisDirty isDirty(formulaCell: WorkbookCellReference): booleanReports 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[]): voidMarks formula cells themselves dirty after an external evaluation service changes.
formulaCells: readonly WorkbookCellReference[]
methodremoveFormulaCell removeFormulaCell(formulaCell: WorkbookCellReference): voidRemoves one formula cell and every reverse edge it owns.
formulaCell: WorkbookCellReference
methodremoveSheet removeSheet(sheetId: string): voidRemoves formulas on a deleted sheet and marks references to that sheet as broken.
sheetId: string
methodsetFormulaResult setFormulaResult(formulaCell: WorkbookCellReference, result: FormulaValue): voidStores a derived workbook formula result and marks the formula clean.
formulaCell: WorkbookCellReferenceresult: FormulaValue
methodupdateFormulaCell updateFormulaCell(formulaCell: WorkbookCellReference, dependencies: readonly WorkbookFormulaReference[]): voidRegisters dependencies for one workbook-qualified formula cell.
formulaCell: WorkbookCellReferencedependencies: readonly WorkbookFormulaReference[]
methodupdateFormulaCellReferences updateFormulaCellReferences(formulaCell: WorkbookCellReference, dependencies: readonly WorkbookFormulaGraphReference[]): voidRegisters graph references for one formula cell, including broken references.
formulaCell: WorkbookCellReferencedependencies: readonly WorkbookFormulaGraphReference[]
- classWorkbookFormulaEvaluationRuntimesource ↗
-
class WorkbookFormulaEvaluationRuntimeRuntime 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 }): WorkbookFormulaEvaluationRuntimeCreates 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>): CompiledWorkbookFormulaCompiles formula text into native AST plus stable workbook dependencies.
formulaCell: WorkbookCellReferencesource: stringworkbookState: WorkbookDocumentState<SheetDocumentState>
methodformatFormulaSource formatFormulaSource(compiled: CompiledWorkbookFormula, workbookState: WorkbookDocumentState<SheetDocumentState>): stringFormats workbook formula source with current sheet names while keeping stable sheet-id bindings.
compiled: CompiledWorkbookFormulaworkbookState: WorkbookDocumentState<SheetDocumentState>
methodrecalculateDirty recalculateDirty(input: { formulas: ReadonlyMap<string, CompiledWorkbookFormula>; graph: WorkbookFormulaDependencyGraph; runtime: WorkbookPluginRuntime }): WorkbookFormulaRecalculationResultRecalculates 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 }): WorkbookFormulaCompiledReferenceShiftResultShifts compiled formula references after a row or column structure change.
input: { changedSheetId: string; changes: readonly StructureChange[]; compiled: CompiledWorkbookFormula; formulaCell: WorkbookCellReference }
- classWorkbookFormulaObjectsPluginsource ↗
-
class WorkbookFormulaObjectsPlugin extends WorkbookPluginWorkbook-owned editing surface for named formulas and table references.
constructorconstructor WorkbookFormulaObjectsPlugin(): WorkbookFormulaObjectsPluginpropertysymbolstatic readonly symbol: typeof symbolmethodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidCloses 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): voidcontext: WorkbookPluginContext
methodonBeforeSheetActivationinherited onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): voidRuns inside the activation command before the source Sheet is captured.
input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): voidRestores plugin-local work if activation fails before commit.
input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted onTransactionCommitted(): voidmethodonWorkbookDestroy onWorkbookDestroy(): voidmethodregisterCapabilitiesinherited registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): voidRegisters every runtime capability owned by this plugin.
registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: WorkbookCommandBus): voidRegisters every stable command id owned by this plugin.
commands: WorkbookCommandBus
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters every typed state and event observation source owned by this plugin.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters every local session value owned by this plugin.
registry: SessionStateRegistry
methodregisterServicesstaticinherited registerServices(context: WorkbookPluginServiceContext): voidcontext: WorkbookPluginServiceContext
- classWorkbookFormulaPluginsource ↗
-
class WorkbookFormulaPlugin extends WorkbookPluginWorkbook-level formula coordinator and cross-sheet dependency owner.
constructorconstructor WorkbookFormulaPlugin(): WorkbookFormulaPluginpropertysymbolstatic readonly symbol: typeof symbolmethodassertSheetRangeMoveSupported assertSheetRangeMoveSupported(sheetId: string, context: SheetRangeMoveContext): voidRejects moves requiring reference edits outside the current Sheet transaction boundary.
sheetId: stringcontext: SheetRangeMoveContext
methodassertSheetStructureMoveSupported assertSheetStructureMoveSupported(sheetId: string, context: SheetStructureMoveContext): voidRejects qualified reference rewrites that cannot be persisted by a single Sheet transaction.
sheetId: stringcontext: SheetStructureMoveContext
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidCloses plugin-owned runtime mutations after Workbook assembly.
assertWrite: (): void
methodformatReference formatReference(reference: ParsedWorkbookFormulaReference): stringFormats a stable workbook reference with the latest workbook sheet name.
reference: ParsedWorkbookFormulaReference
methodgetDependencyGraph getDependencyGraph(): WorkbookFormulaDependencyGraphReaderReturns the workbook-qualified dependency graph owned by this plugin instance.
methodgetFormulaResult getFormulaResult(formulaCell: ParsedWorkbookFormulaReference): FormulaValue | undefinedReturns a workbook-level formula result when the skeleton can determine one.
formulaCell: ParsedWorkbookFormulaReference
methodgetSheetFormulaResult getSheetFormulaResult(sheetId: string, row: number, col: number): FormulaValue | undefinedReturns a result only for formula cells that contain workbook-qualified references.
sheetId: stringrow: numbercol: number
methodgetSheetFormulaSource getSheetFormulaSource(sheetId: string, row: number, col: number): string | undefinedReturns display-ready formula source for workbook formulas on one mounted sheet.
sheetId: stringrow: numbercol: 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): (): voidStarts observing workbook state for this WorkbookEditor instance.
context: WorkbookPluginContext
methodobserveSheetTransaction observeSheetTransaction(sheetId: string, transaction: Transaction): voidReceives a committed Sheet transaction from the active SheetEditor companion.
sheetId: stringtransaction: Transaction
methodonBeforeSheetActivationinherited onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): voidRuns inside the activation command before the source Sheet is captured.
input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): voidRestores plugin-local work if activation fails before commit.
input: ActivateWorkbookSheetCommandInput
methodonTransactionCommittedinherited onTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidevent: WorkbookTransactionCommittedEvent
methodonWorkbookDestroyinherited onWorkbookDestroy(context: WorkbookPluginContext): voidcontext: WorkbookPluginContext
methodparseReference parseReference(reference: string): ParsedWorkbookFormulaReferenceParses a displayed cross-sheet reference against the latest workbook sheet names.
reference: string
methodrecalculateDirtyFormulas recalculateDirtyFormulas(): RecalculateWorkbookFormulasCommandResultRecalculates workbook formulas currently marked dirty.
methodregisterCapabilitiesinherited registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): voidRegisters every runtime capability owned by this plugin.
registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: WorkbookCommandBus): voidRegisters workbook formula commands.
commands: WorkbookCommandBus
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters workbook formula diagnostic observations.
observations: ObservationRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters every local session value owned by this plugin.
registry: SessionStateRegistry
methodremoveFormulaCell removeFormulaCell(formulaCell: WorkbookCellReference): voidRemoves workbook formula bookkeeping for one formula cell.
formulaCell: WorkbookCellReference
methodsetFormulaCellFormula setFormulaCellFormula(formulaCell: ParsedWorkbookFormulaReference, formulaSource: string): voidRegisters and compiles one workbook formula source.
formulaCell: ParsedWorkbookFormulaReferenceformulaSource: string
methodsetFormulaResult setFormulaResult(formulaCell: ParsedWorkbookFormulaReference, result: FormulaValue): voidStores a derived workbook formula result and marks the formula clean.
formulaCell: ParsedWorkbookFormulaReferenceresult: FormulaValue
methodupdateFormulaCell updateFormulaCell(formulaCell: ParsedWorkbookFormulaReference, dependencies: readonly WorkbookFormulaReference[]): voidRegisters workbook-qualified dependencies for one formula cell.
formulaCell: ParsedWorkbookFormulaReferencedependencies: readonly WorkbookFormulaReference[]
methodregisterServicesstatic registerServices(__namedParameters: WorkbookPluginServiceContext): voidRegisters one workbook-owned formula runtime shared by mounted Sheet editors.
__namedParameters: WorkbookPluginServiceContext
- classWorkbookFormulaReferenceShiftersource ↗
-
class WorkbookFormulaReferenceShifterShifts workbook-qualified AST references for one structurally changed sheet.
constructorconstructor WorkbookFormulaReferenceShifter(): WorkbookFormulaReferenceShiftermethodshiftReferences shiftReferences(input: { ast: FormulaAST; changedSheetId: string; changes: readonly StructureChange[]; sheetBindings: ReadonlyMap<string, string> }): WorkbookFormulaReferenceShiftResultShifts 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 WorkbookPluginBuilt-in contributor for workbook structure history.
constructorconstructor WorkbookHistoryPlugin(): WorkbookHistoryPluginpropertysymbolstatic readonly symbol: typeof symbolmethodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidCloses 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(): WorkbookHistoryStatusmethodinitialize initialize(context: WorkbookPluginContext): voidcontext: WorkbookPluginContext
methodonBeforeSheetActivationinherited onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): voidRuns inside the activation command before the source Sheet is captured.
input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailedinherited onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): voidRestores plugin-local work if activation fails before commit.
input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted onTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidevent: WorkbookTransactionCommittedEvent
methodonWorkbookDestroy onWorkbookDestroy(): voidmethodregisterCapabilitiesinherited registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): voidRegisters every runtime capability owned by this plugin.
registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: WorkbookCommandBus): voidRegisters every stable command id owned by this plugin.
commands: WorkbookCommandBus
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters every typed state and event observation source owned by this plugin.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters every local session value owned by this plugin.
registry: SessionStateRegistry
methodregisterServicesstaticinherited registerServices(context: WorkbookPluginServiceContext): voidcontext: WorkbookPluginServiceContext
- classWorkbookPluginsource ↗
-
class WorkbookPlugin extends PluginExtension<WorkbookCommandBus, ObservationRegistry, SessionStateRegistry, WorkbookRuntimeExtensionRegistry>Base contract for plugins owned by createWorkbookEditor().
constructorconstructor WorkbookPlugin(): WorkbookPluginmethodenforceRuntimeWriteBoundary enforceRuntimeWriteBoundary(assertWrite: (): void): voidCloses 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 | WorkbookPluginDisposercontext: WorkbookPluginContext
methodonBeforeSheetActivation onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): voidRuns inside the activation command before the source Sheet is captured.
input: ActivateWorkbookSheetCommandInput
methodonSheetActivationFailed onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): voidRestores plugin-local work if activation fails before commit.
input: ActivateWorkbookSheetCommandInput
methodonTransactionCommitted onTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidevent: WorkbookTransactionCommittedEvent
methodonWorkbookDestroy onWorkbookDestroy(context: WorkbookPluginContext): voidcontext: WorkbookPluginContext
methodregisterCapabilities registerCapabilities(registry: WorkbookRuntimeExtensionRegistry): voidRegisters every runtime capability owned by this plugin.
registry: WorkbookRuntimeExtensionRegistry
methodregisterCommands registerCommands(commands: WorkbookCommandBus): voidRegisters every stable command id owned by this plugin.
commands: WorkbookCommandBus
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters every typed state and event observation source owned by this plugin.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters every local session value owned by this plugin.
registry: SessionStateRegistry
methodregisterServicesstatic registerServices(context: WorkbookPluginServiceContext): voidcontext: WorkbookPluginServiceContext
- classWorkbookRangeMoveErrorsource ↗
-
class WorkbookRangeMoveError extends SearErrorPrevents a same-sheet move from leaving workbook-qualified references stale.
constructorconstructor WorkbookRangeMoveError(sheetId: string): WorkbookRangeMoveErrorsheetId: string
propertycauseinherited cause?: unknownpropertycode readonly code: "WORKBOOK_RANGE_MOVE_QUALIFIED_REFERENCE"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classWorkbookRuntimeExtensionRegistrysource ↗
-
class WorkbookRuntimeExtensionRegistry extends RuntimeCapabilityRegistryEditor-local capability registry exposed through WorkbookEditor.capabilities.
constructorconstructor WorkbookRuntimeExtensionRegistry(): WorkbookRuntimeExtensionRegistrypropertysymbolstatic readonly symbol: typeof symbolmethoddestroyinherited destroy(): voidPermanently closes the registry and releases all published values.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for capability changes after assembly.
assertWrite: (): void
methodgetinherited get<T>(capability: RuntimeCapability<T>): T | undefinedcapability: RuntimeCapability<T>
methodgetRegisteredCapabilityIdsinherited getRegisteredCapabilityIds(): readonly string[]methodhasinherited has(capability: RuntimeCapability<unknown>): booleancapability: RuntimeCapability<unknown>
methodregisterinherited register<T>(capability: RuntimeCapability<T>, value: T): (): voidRegisters one value and returns an idempotent disposer for that registration.
capability: RuntimeCapability<T>value: T
methodrequireinherited require<T>(capability: RuntimeCapability<T>): Tcapability: RuntimeCapability<T>
- classWorkbookSessionStoresource ↗
-
class WorkbookSessionStoreOwns built-in workbook session values without exposing their shape to aggregate capture.
constructorconstructor WorkbookSessionStore(documentState: WorkbookDocumentState): WorkbookSessionStoredocumentState: WorkbookDocumentState
propertysymbolstatic readonly symbol: typeof symbolmethodbindActiveSheetCapture bindActiveSheetCapture(capture: (): { sheetId: string; state?: Readonly<Record<string, unknown>> }): voidcapture: (): { sheetId: string; state?: Readonly<Record<string, unknown>> }
methodclear clear(lifecycleToken?: object): voidlifecycleToken: object
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, lifecycleToken: object): voidRestricts runtime session changes to this editor's command dispatch.
isExecuting: (): booleanlifecycleToken: object
methodgetActiveSheetId getActiveSheetId(): stringmethodgetSheetSessionState getSheetSessionState(sheetId: string): Readonly<Record<string, unknown>> | undefinedsheetId: string
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters the built-in contributors beside third-party workbook contributors.
registry: SessionStateRegistry
methodremoveMissingSheets removeMissingSheets(liveSheetIds: ReadonlySet<string>, ownerToken?: object): voidliveSheetIds: ReadonlySet<string>ownerToken: object
methodsetActiveSheetId setActiveSheetId(sheetId: string, ownerToken?: object): voidsheetId: stringownerToken: object
methodsetSheetSessionState setSheetSessionState(sheetId: string, state: Readonly<Record<string, unknown>> | undefined, ownerToken?: object): voidsheetId: stringstate: Readonly<Record<string, unknown>> | undefinedownerToken: object
methodvalidate validate(documentState: WorkbookDocumentState): voiddocumentState: WorkbookDocumentState
- classWorkbookStructureMoveErrorsource ↗
-
class WorkbookStructureMoveError extends SearErrorPrevents an axis move from leaving qualified reference sources outside its transaction stale.
constructorconstructor WorkbookStructureMoveError(sheetId: string): WorkbookStructureMoveErrorsheetId: string
propertycauseinherited cause?: unknownpropertycode readonly code: "WORKBOOK_STRUCTURE_MOVE_QUALIFIED_REFERENCE"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classWorkbookTransactionsource ↗
-
class WorkbookTransactionOrdered, 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): WorkbookTransactionid: stringhistoryAction: WorkbookHistoryAction
propertyhistoryAction readonly historyAction: WorkbookHistoryActionpropertyid readonly id: stringmethodaddStep addStep(name: string, reduce: WorkbookTransactionReducer): thisAdds one pure reducer to the staged transaction.
name: stringreduce: WorkbookTransactionReducer
methodgetStepNames getStepNames(): readonly string[]Returns stable step names for diagnostics and tests.
- interfaceActivateWorkbookSheetCommandInputsource ↗
-
interface ActivateWorkbookSheetCommandInputInput for activating a workbook sheet.
propertysheetId readonly sheetId: stringSheet id to make active.
- interfaceCaptureWorkbookSessionStateCommandResultsource ↗
-
interface CaptureWorkbookSessionStateCommandResultCaptured local state for remounting one WorkbookEditor runtime.
propertysessionState readonly sessionState: WorkbookSessionState - interfaceCompiledWorkbookFormulasource ↗
-
interface CompiledWorkbookFormulaCompiled workbook formula with native workbook-reference AST nodes.
propertyast readonly ast: FormulaASTParsed 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?: booleanpropertyhasWorkbookReferences readonly hasWorkbookReferences: booleanWhether 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: stringOriginal user-authored formula source.
- interfaceExportWorkbookStateCommandResultsource ↗
-
interface ExportWorkbookStateCommandResultCurrent workbook-owned document snapshot.
propertydocumentState readonly documentState: WorkbookDocumentState<SheetDocumentState> - interfaceHideWorkbookSheetCommandInputsource ↗
-
interface HideWorkbookSheetCommandInputInput for hiding a workbook sheet.
propertynextActiveSheetId readonly nextActiveSheetId?: stringOptional active sheet to select when hiding the current active sheet.
propertysheetId readonly sheetId: stringSheet id to hide.
- interfaceRecalculateWorkbookFormulasCommandResultsource ↗
-
interface RecalculateWorkbookFormulasCommandResultResult 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 - interfaceUnhideWorkbookSheetCommandInputsource ↗
-
interface UnhideWorkbookSheetCommandInputInput for unhiding a workbook sheet.
propertysheetId readonly sheetId: stringSheet id to reveal.
- interfaceWorkbookActiveSheetEditorSnapshotsource ↗
-
interface WorkbookActiveSheetEditorSnapshotCurrent live SheetEditor mounted by one WorkbookEditor instance.
- interfaceWorkbookCollaborationSessionsource ↗
-
interface WorkbookCollaborationSessionRead-only host facade for Workbook-owned collaboration channels.
methodgetConnectedSheetIds getConnectedSheetIds(): readonly string[]methodgetSheetStatus getSheetStatus(sheetId: string): CollaborationStatus | undefinedsheetId: string
- interfaceWorkbookCollaborationTransportFactorysource ↗
-
interface WorkbookCollaborationTransportFactoryCreates one transport per Workbook-owned Sheet collaboration channel.
methodcreate create(): CollabTransport - interfaceWorkbookCommandBusOptionssource ↗
-
interface WorkbookCommandBusOptionsOptional diagnostics hooks used by the workbook command bus.
propertywarn readonly warn?: (message: string, ...details: unknown[]): voidReceives non-fatal command-boundary diagnostics.
- interfaceWorkbookCommandControllersource ↗
-
interface WorkbookCommandControllerInternal controller API implemented by the workbook editor facade.
methodactivateSheet activateSheet(input: ActivateWorkbookSheetCommandInput): WorkbookCommandResultinput: ActivateWorkbookSheetCommandInput
methodaddSheet addSheet(input: AddWorkbookSheetCommandInput): WorkbookCommandResultinput: AddWorkbookSheetCommandInput
methodhideSheet hideSheet(input: HideWorkbookSheetCommandInput): WorkbookCommandResultinput: HideWorkbookSheetCommandInput
methodmoveSheet moveSheet(input: MoveWorkbookSheetInput): WorkbookCommandResultinput: MoveWorkbookSheetInput
methodremoveSheet removeSheet(input: RemoveWorkbookSheetCommandInput): WorkbookCommandResultinput: RemoveWorkbookSheetCommandInput
methodrenameSheet renameSheet(input: RenameWorkbookSheetInput): WorkbookCommandResultinput: RenameWorkbookSheetInput
methodunhideSheet unhideSheet(input: UnhideWorkbookSheetCommandInput): WorkbookCommandResultinput: UnhideWorkbookSheetCommandInput
- interfaceWorkbookCommandDefinitionsource ↗
-
interface WorkbookCommandDefinition<Input, Result>Stable workbook command identifier carrying its input and result contract.
property[workbookCommandInputType] readonly [workbookCommandInputType]: InputPhantom field that preserves the command input type for callers.
property[workbookCommandResultType] readonly [workbookCommandResultType]: ResultPhantom field that preserves the command result type for callers.
propertyid readonly id: stringGlobally stable command id owned by the workbook assembly package.
- interfaceWorkbookCommandEventsource ↗
-
interface WorkbookCommandEventLifecycle event emitted by the workbook command bus for diagnostics and host UI.
- interfaceWorkbookCommandResultsource ↗
-
interface WorkbookCommandResultResult returned by workbook-level sheet-list commands.
propertyactiveSheetEditorChanged readonly activeSheetEditorChanged: booleanWhether the live active SheetEditor instance was replaced.
propertydocumentState readonly documentState: WorkbookDocumentState<SheetDocumentState>Latest workbook state after the command.
- interfaceWorkbookCompanionSheetPluginContextsource ↗
-
interface WorkbookCompanionSheetPluginContext extends WorkbookPluginContextContext used when a Workbook plugin contributes plugins to a mounted SheetEditor.
propertycontainerinherited readonly container: Containerpropertyruntimeinherited readonly runtime: WorkbookPluginRuntimepropertysheetId readonly sheetId: stringpropertysheetState readonly sheetState: SheetDocumentState - interfaceWorkbookCompanionSheetServicesource ↗
-
interface WorkbookCompanionSheetService<Value>One typed service value contributed to a temporary child SheetEditor container.
- interfaceWorkbookDocumentApisource ↗
-
interface WorkbookDocumentApiRead-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 WorkbookEditorPublic workbook facade returned by createWorkbookEditor().
propertycapabilities readonly capabilities: RuntimeCapabilityReaderRead-only access to typed services owned by this editor's isolated runtime.
propertycommands readonly commands: WorkbookCommandBusThe supported command entry point for workbook user and program actions.
propertydocument readonly document: WorkbookDocumentApiRead-only access to document-owned workbook state.
propertyobservations readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
propertysheets readonly sheets: WorkbookSheetsApiRead-only access to the active and mounted SheetEditor.
methoddestroy destroy(): voidReleases the active SheetEditor, plugins, observations, commands, and editor-local services.
- interfaceWorkbookEditorConfigurationsource ↗
-
interface WorkbookEditorConfigurationPublic configuration accepted by createWorkbookEditor().
propertyadapters readonly adapters: SheetEditorAdapterspropertycaptureSheetSessionState readonly captureSheetSessionState?: WorkbookSheetSessionStateCapturepropertycaptureSheetState readonly captureSheetState?: WorkbookSheetStateCapturepropertydocumentState readonly documentState: WorkbookDocumentState<SheetDocumentState>propertyonCreated readonly onCreated?: (editor: WorkbookEditor): voidOne-time assembly callback for registering host-owned commands.
propertyplugins readonly plugins?: readonly WorkbookPluginImplementation<WorkbookPlugin>[]propertysessionState readonly sessionState?: Readonly<Record<string, unknown>>propertysheetEditorFactory readonly sheetEditorFactory?: WorkbookSheetEditorFactorypropertysheetPlugins readonly sheetPlugins?: readonly SheetPluginImplementation<SheetPlugin<unknown>>[]propertyviewport readonly viewport?: { height: number; width: number }propertywarn readonly warn?: (message: string, ...details: unknown[]): void - interfaceWorkbookFormulaBrokenReferencesource ↗
-
interface WorkbookFormulaBrokenReferenceDependency entry retained after a workbook formula reference becomes invalid.
- interfaceWorkbookFormulaCompiledReferenceShiftResultsource ↗
-
interface WorkbookFormulaCompiledReferenceShiftResultResult of applying row/column structure edits to one compiled workbook formula.
- interfaceWorkbookFormulaObjectssource ↗
-
interface WorkbookFormulaObjects - interfaceWorkbookFormulaRecalculationResultsource ↗
-
interface WorkbookFormulaRecalculationResultResult 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 WorkbookFormulaReferenceShiftResultResult of shifting workbook-qualified formula references in one AST.
propertyast readonly ast: FormulaASTShifted 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: booleanWhether the AST identity changed.
- interfaceWorkbookFormulaSheetTransactionEventsource ↗
-
interface WorkbookFormulaSheetTransactionEventLocal event emitted when a companion Sheet plugin observes a committed transaction.
propertysheetId readonly sheetId: stringWorkbook sheet id that owned the active SheetEditor when the transaction committed.
propertytransaction readonly transaction: TransactionCommitted Sheet transaction observed from the active SheetEditor.
- interfaceWorkbookFormulaStateSnapshotsource ↗
-
interface WorkbookFormulaStateSnapshotState snapshot for the workbook-scoped formula runtime.
propertyactiveSheetId readonly activeSheetId: string | nullActive sheet id in the observed workbook state.
propertycachedFormulaResultCount readonly cachedFormulaResultCount: numberNumber of derived workbook formula results currently cached.
propertydirtyFormulaCellCount readonly dirtyFormulaCellCount: numberNumber of workbook formula cells waiting for recalculation.
propertyformulaCellCount readonly formulaCellCount: numberNumber of formula cells currently indexed in the workbook dependency graph.
propertyobservedSheetTransactionCount readonly observedSheetTransactionCount: numberNumber 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 | nullWorkbook id currently observed by WorkbookFormulaPlugin.
- interfaceWorkbookFormulaTablesource ↗
-
interface WorkbookFormulaTable - interfaceWorkbookHistoryEntrysource ↗
-
interface WorkbookHistoryEntryStructural before/after snapshots retained independently from SheetEditor history.
- interfaceWorkbookHistorySessionStatesource ↗
-
interface WorkbookHistorySessionStateWorkbook-local structural undo and redo stacks.
- interfaceWorkbookHistoryStatussource ↗
-
interface WorkbookHistoryStatusCurrent workbook structure undo/redo availability.
- interfaceWorkbookPluginContextsource ↗
-
interface WorkbookPluginContextContext passed to Workbook plugin lifecycle hooks.
- interfaceWorkbookPluginImplementationsource ↗
-
interface WorkbookPluginImplementation<TPlugin>Injectable Workbook plugin class accepted by createWorkbookEditor().
constructorconstructor WorkbookPluginImplementation(...args: never[]): TPluginargs: never[]
propertysymbol readonly symbol: symbolmethodregisterServices registerServices(context: WorkbookPluginServiceContext): voidcontext: WorkbookPluginServiceContext
- interfaceWorkbookPluginRuntimesource ↗
-
interface WorkbookPluginRuntimeRuntime services exposed to Workbook plugins for one WorkbookEditor instance.
propertycommands readonly commands: WorkbookCommandBuspropertydocument readonly document: WorkbookDocumentApipropertyextensions readonly extensions: WorkbookRuntimeExtensionRegistrypropertyformula readonly formula: { externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }propertyobservations readonly observations: ObservationRegistrypropertysession readonly session: SessionStateRegistrypropertysheets readonly sheets: WorkbookSheetsApimethodcreateCommandResult createCommandResult(activeSheetEditorChanged: boolean): WorkbookCommandResultReturns the current result shape for a command that performs no mutation.
activeSheetEditorChanged: boolean
methodexecuteTransaction executeTransaction(transaction: WorkbookTransaction): WorkbookCommandResultCommits a transaction assembled inside a typed Workbook command.
transaction: WorkbookTransaction
- interfaceWorkbookPluginServiceContextsource ↗
-
interface WorkbookPluginServiceContextServices available before a Workbook plugin is registered in its editor-local container.
propertycontainer readonly container: Container - interfaceWorkbookSheetEditorFactoryInputsource ↗
-
interface WorkbookSheetEditorFactoryInputInput passed when the workbook assembly creates one active SheetEditor.
propertyconfiguration readonly configuration: SheetEditorConfigurationpropertysheetId readonly sheetId: string - interfaceWorkbookSheetsApisource ↗
-
interface WorkbookSheetsApiRead-only access to SheetEditor instances owned by one WorkbookEditor.
methodgetActiveEditor getActiveEditor(): SheetEditorReturns the SheetEditor mounted for the active sheet.
methodgetActiveId getActiveId(): stringReturns the stable id of the active sheet.
methodgetEditor getEditor(sheetId: string): SheetEditor | nullReturns the mounted SheetEditor when sheetId is active; detached sheets return null.
sheetId: string
- interfaceWorkbookSheetSessionStateCaptureInputsource ↗
-
interface WorkbookSheetSessionStateCaptureInputRead-only active SheetEditor session capture hook.
propertyeditor readonly editor: SheetEditorpropertysessionState readonly sessionState: Readonly<Record<string, unknown>> | undefinedpropertysheetId readonly sheetId: string - interfaceWorkbookSheetStateCaptureInputsource ↗
-
interface WorkbookSheetStateCaptureInputRead-only active SheetEditor capture hook used by custom hosts and focused tests.
propertydocumentState readonly documentState: WorkbookDocumentState<SheetDocumentState>propertyeditor readonly editor: SheetEditorpropertysheetId readonly sheetId: stringpropertysheetState readonly sheetState: SheetDocumentState - interfaceWorkbookTransactionCommittedEventsource ↗
-
interface WorkbookTransactionCommittedEventImmutable event delivered after a complete workbook transaction commits.
propertyafter readonly after: WorkbookTransactionStatepropertybefore readonly before: WorkbookTransactionStatepropertytransaction readonly transaction: WorkbookTransaction - interfaceWorkbookTransactionStatesource ↗
-
interface WorkbookTransactionStateDetached state staged by workbook transaction reducers.
propertyactiveSheetId readonly activeSheetId: stringpropertydocumentState readonly documentState: WorkbookDocumentState<SheetDocumentState> - typeAddWorkbookSheetCommandInputsource ↗
-
type AddWorkbookSheetCommandInput = AddWorkbookSheetInput<SheetDocumentState> & { activate?: boolean }Input for adding a sheet to the workbook.
- typeMoveWorkbookSheetCommandInputsource ↗
-
type MoveWorkbookSheetCommandInput = MoveWorkbookSheetInputInput for moving a sheet tab.
- typeRemoveWorkbookSheetCommandInputsource ↗
-
type RemoveWorkbookSheetCommandInput = RemoveWorkbookSheetInput & { nextActiveSheetId?: WorkbookSheetId }Input for removing a sheet from the workbook.
- typeRenameWorkbookSheetCommandInputsource ↗
-
type RenameWorkbookSheetCommandInput = RenameWorkbookSheetInputInput for renaming a workbook sheet.
- typeWorkbookCommandDefinitionResultsource ↗
-
type WorkbookCommandDefinitionResult = conditionalExtracts 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 = conditionalExtracts the input contract from a typed workbook command definition.
- typeWorkbookCommandListenersource ↗
-
type WorkbookCommandListener = (event: WorkbookCommandEvent): voidObserver 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 | WorkbookFormulaBrokenReferenceDependency 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 = (): voidResource disposer returned by Workbook plugin lifecycle hooks.
- typeWorkbookRuntimeCapabilityReadersource ↗
-
type WorkbookRuntimeCapabilityReader = RuntimeCapabilityReader - typeWorkbookRuntimeCapabilityTokensource ↗
-
type WorkbookRuntimeCapabilityToken = RuntimeCapability<T> - typeWorkbookSessionStatesource ↗
-
type WorkbookSessionState = SessionStateSnapshotOpaque 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): WorkbookTransactionStateOne 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): WorkbookEditorCreates 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.
Exampleconst 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: unknownoptions: WorkbookDocumentStateSerializationOptions<TSheetState>
- functionisWorkbookFormulaBrokenReferencesource ↗
-
isWorkbookFormulaBrokenReference(reference: WorkbookFormulaGraphReference): referenceReports whether one workbook formula graph reference is a retained broken reference.
reference: WorkbookFormulaGraphReference
- functionregisterDefaultWorkbookCommandssource ↗
-
registerDefaultWorkbookCommands(commands: WorkbookCommandBus, controller: WorkbookCommandController): voidRegisters the built-in workbook commands on one workbook command bus.
commands: WorkbookCommandBuscontroller: WorkbookCommandController
- functionregisterWorkbookPluginCapabilitiessource ↗
-
registerWorkbookPluginCapabilities(plugins: readonly unknown[], registry: WorkbookRuntimeExtensionRegistry): voidPublishes every typed runtime capability contributed by Workbook plugins.
plugins: readonly unknown[]registry: WorkbookRuntimeExtensionRegistry
- functionregisterWorkbookPluginCommandssource ↗
-
registerWorkbookPluginCommands(plugins: readonly unknown[], commands: WorkbookCommandBus): voidplugins: readonly unknown[]commands: WorkbookCommandBus
- functionregisterWorkbookPluginObservationssource ↗
-
registerWorkbookPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): voidplugins: readonly unknown[]observations: ObservationRegistry
- functionregisterWorkbookPluginSessionStatessource ↗
-
registerWorkbookPluginSessionStates(plugins: readonly unknown[], session: SessionStateRegistry): voidplugins: readonly unknown[]session: SessionStateRegistry
- functionresolveWorkbookPluginssource ↗
-
resolveWorkbookPlugins(container: Container, implementations: readonly WorkbookPluginImplementation<WorkbookPlugin>[]): WorkbookPlugin[]Resolves isolated Workbook plugin singletons from one editor-local container.
container: Containerimplementations: 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
Built-in cell identities and commit strategies for text, numbers, formulas, and rich text.
- namespaceICellFormatLocaleProvidersource ↗
-
ICellFormatLocaleProvider: unknownDI token for resolving the current sheet's cell-format locale provider.
variablesymbol symbol: typeof symbol - enumSheetHorizontalAlignmentsource ↗
-
enum SheetHorizontalAlignmentHorizontal alignment values supported by the built-in Sheet alignment feature.
- enumSheetVerticalAlignmentsource ↗
-
enum SheetVerticalAlignmentVertical alignment values supported by the built-in Sheet alignment feature.
- classBooleanCellCommitStrategysource ↗
-
class BooleanCellCommitStrategy extends CellCommitStrategyRecognizes directly entered spreadsheet logical literals.
constructorconstructor BooleanCellCommitStrategy(): BooleanCellCommitStrategypropertykey readonly key: "boolean"Stable identifier for this commit strategy.
propertypriority readonly priority: 20Ordering priority used when more than one strategy matches.
methodcommit commit(context: CellCommitContext): CellMatrixElementConverts matching edit input into a persisted cell value.
context: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether this strategy can commit the supplied input.
context: CellCommitContext
- classCellClipboardCodecRegistrysource ↗
-
class CellClipboardCodecRegistryEditor-local registry for cell-type-owned clipboard behavior.
constructorconstructor CellClipboardCodecRegistry(): CellClipboardCodecRegistrypropertysymbolstatic readonly symbol: typeof symbolmethoddecode decode(payload: CellClipboardCellPayload, context: CellClipboardDecodeContext): CellMatrixElement | nullpayload: CellClipboardCellPayloadcontext: CellClipboardDecodeContext
methoddecodePlainText decodePlainText(text: string): CellMatrixElement | nulltext: string
methodencode encode(cell: CellMatrixElement): CellClipboardCellPayloadcell: CellMatrixElement
methodget get(cellType: string): CellClipboardCodecDefinition | undefinedcellType: string
methodregister register(codec: CellClipboardCodecDefinition): (): voidcodec: CellClipboardCodecDefinition
methodtoPlainText toPlainText(cell: CellMatrixElement): stringcell: CellMatrixElement
- classCellCommitStrategysource ↗
-
class CellCommitStrategy extends CellCommitStrategyDefinitionBase class for reusable strategies; plain definitions can also be registered.
constructorconstructor CellCommitStrategy(): CellCommitStrategypropertykey readonly key: stringStable identifier for this commit strategy.
propertypriority readonly priority: numberOrdering priority used when more than one strategy matches.
methodcommit commit(context: CellCommitContext): CellMatrixElement | nullConverts matching edit input into a persisted cell value.
context: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether this strategy can commit the supplied input.
context: CellCommitContext
- classCellCommitStrategyRegistrysource ↗
-
class CellCommitStrategyRegistryExtensible value-type registry. Hosts and plugins can add or replace input
classifiers without coupling their domain types to the cell editor.constructorconstructor CellCommitStrategyRegistry(): CellCommitStrategyRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving CellCommitStrategyRegistry.
methodcommit commit(context: CellCommitContext): CellMatrixElement | nullSelects 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 | undefinedReturns the value.
key: string
methodgetAll getAll(): readonly CellCommitStrategyDefinition[]Returns the all.
methodregister register(strategy: CellCommitStrategyDefinition): (): voidRegisters or replaces a strategy. The returned disposer restores the
replaced strategy when this registration remains active.strategy: CellCommitStrategyDefinition
methodunregister unregister(key: string): booleanUnregisters the value.
key: string
- classCellFormatTransferRegistrysource ↗
-
class CellFormatTransferRegistryEditor-local cell-format codecs; unregistered types preserve their payload verbatim.
constructorconstructor CellFormatTransferRegistry(): CellFormatTransferRegistrypropertysymbolstatic readonly symbol: typeof symbolmethodapply apply(cell: CellMatrixElement | null, format: Readonly<Record<string, unknown>>): CellMatrixElement | nullcell: CellMatrixElement | nullformat: Readonly<Record<string, unknown>>
methodcapture capture(cell: CellMatrixElement | null): Readonly<Record<string, unknown>>cell: CellMatrixElement | null
methoddestroy destroy(): voidmethodregister register(codec: CellFormatTransferCodec): (): voidcodec: CellFormatTransferCodec
- classDefaultStringCellCommitStrategysource ↗
-
class DefaultStringCellCommitStrategy extends CellCommitStrategyFinal fallback: persist otherwise-unclassified input as plain text.
constructorconstructor DefaultStringCellCommitStrategy(): DefaultStringCellCommitStrategypropertykey readonly key: "fallback-string"Stable identifier for the default string strategy.
propertypriority readonly priority: 0Ordering priority for the default string fallback.
methodcommit commit(context: CellCommitContext): CellMatrixElementPersists unmatched input as a string cell.
context: CellCommitContext
methodmatches matches(): booleanMatches input not claimed by a more specific strategy.
- classEmptyCellCommitStrategysource ↗
-
class EmptyCellCommitStrategy extends CellCommitStrategyRemoves a cell when its editor document has no semantic text.
constructorconstructor EmptyCellCommitStrategy(): EmptyCellCommitStrategypropertykey readonly key: "empty"Stable identifier for the empty-cell strategy.
propertypriority readonly priority: 100Ordering priority for empty input.
methodcommit commit(): nullConverts empty input into an absent cell value.
methodmatches matches(context: CellCommitContext): booleanReports whether the input should clear the cell.
context: CellCommitContext
- classFormulaCellCommitStrategysource ↗
-
class FormulaCellCommitStrategy extends CellCommitStrategyRecognizes formula source and normalizes it before persistence.
constructorconstructor FormulaCellCommitStrategy(): FormulaCellCommitStrategypropertykey readonly key: "formula"Stable identifier for the formula strategy.
propertypriority readonly priority: 90Ordering priority for formula input.
methodcommit commit(context: CellCommitContext): CellMatrixElementPersists formula source without evaluating it.
context: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether the input is formula source.
context: CellCommitContext
- classNumberCellCommitStrategysource ↗
-
class NumberCellCommitStrategy extends CellCommitStrategyInfers numeric values after more-specific domain types have had a chance to match.
constructorconstructor NumberCellCommitStrategy(): NumberCellCommitStrategypropertykey readonly key: "number"Stable identifier for the number strategy.
propertypriority readonly priority: 10Ordering priority for numeric input.
methodcommit commit(context: CellCommitContext): CellMatrixElementPersists input as a numeric cell.
context: CellCommitContext
methodinferFormat inferFormat(context: CellCommitContext): CellFormat | nullcontext: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether the input is a valid numeric value.
context: CellCommitContext
- classRichTextCellCommitStrategysource ↗
-
class RichTextCellCommitStrategy extends CellCommitStrategyPersists the document tree only when it contains durable inline/block semantics.
constructorconstructor RichTextCellCommitStrategy(): RichTextCellCommitStrategypropertykey readonly key: "richtext"Stable identifier for the rich-text strategy.
propertypriority readonly priority: 110Ordering priority for rich-text input.
methodcommit commit(context: CellCommitContext): CellMatrixElementPersists a cloned rich-document snapshot.
context: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether the input is a rich-document snapshot.
context: CellCommitContext
- classSheetCellInputValidationRegistrysource ↗
-
class SheetCellInputValidationRegistryEditor-local validation contributions, evaluated before a cell edit commits.
constructorconstructor SheetCellInputValidationRegistry(): SheetCellInputValidationRegistrypropertysymbolstatic readonly symbol: typeof symbolmethodbeginTeardown beginTeardown(token: object): voidAllows owner-controlled cleanup after command dispatch has ended.
token: object
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void, teardownToken: object): voidCloses direct writes once the editor finishes starting.
isExecuting: (): booleandispatchRemoval: (id: number): voidteardownToken: object
methodregister register(id: string, validator: SheetCellInputValidator): (): voidid: stringvalidator: SheetCellInputValidator
methodunregister unregister(registrationId: number): voidRemoves one registration, dispatching through its command after assembly.
registrationId: number
methodvalidate validate(row: number, column: number, text: string): SheetCellInputValidationResultrow: numbercolumn: numbertext: string
- classSheetDisplayedValueChangessource ↗
-
class SheetDisplayedValueChangesEditor-local fanout for changes to displayed cell values.
constructorconstructor SheetDisplayedValueChanges(warn: (error: unknown): void): SheetDisplayedValueChangeswarn: (error: unknown): void
propertysymbolstatic readonly symbol: typeof symbolmethoddispose dispose(): voidmethodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, runWithoutMutationAuthority: <Value>(callback: (): Value): Value): voidSeals publishing after startup while keeping host listeners outside command authority.
isExecuting: (): booleanrunWithoutMutationAuthority: <Value>(callback: (): Value): Value
methodpublish publish(cells: readonly SheetDisplayedValueCoordinate[]): voidcells: readonly SheetDisplayedValueCoordinate[]
methodsubscribe subscribe(listener: SheetDisplayedValueChangeListener): (): voidlistener: SheetDisplayedValueChangeListener
- classTextCellCommitStrategysource ↗
-
class TextCellCommitStrategy extends CellCommitStrategyHandles explicit text input: Text-format cells and apostrophe-prefixed values.
constructorconstructor TextCellCommitStrategy(): TextCellCommitStrategypropertykey readonly key: "string"Stable identifier for the explicit text strategy.
propertypriority readonly priority: 80Ordering priority for explicit text input.
methodcommit commit(context: CellCommitContext): CellMatrixElementPersists input as an explicit text cell.
context: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether the input is explicitly typed as text.
context: CellCommitContext
- interfaceCellClipboardCellPayloadsource ↗
-
interface CellClipboardCellPayloadJSON-safe representation owned by the cell type that produced it.
- interfaceCellClipboardCodecDefinitionsource ↗
-
interface CellClipboardCodecDefinitionClipboard behavior contributed by one persisted cell type.
propertycellType readonly cellType: stringmethoddecode decode(data: unknown, context: CellClipboardDecodeContext): CellMatrixElement | nulldata: unknowncontext: CellClipboardDecodeContext
methoddecodePlainText decodePlainText(text: string): CellMatrixElement | nulltext: string
methodencode encode(cell: CellMatrixElement): unknowncell: CellMatrixElement
methodrebase rebase(cell: CellMatrixElement, context: CellClipboardDecodeContext): CellMatrixElementcell: CellMatrixElementcontext: CellClipboardDecodeContext
methodtoPlainText toPlainText(cell: CellMatrixElement): stringcell: CellMatrixElement
- interfaceCellClipboardDecodeContextsource ↗
-
interface CellClipboardDecodeContextContext used by a cell type when a native clipboard cell is pasted elsewhere.
propertycolumnDelta readonly columnDelta: numberpropertyrowDelta readonly rowDelta: number - interfaceCellCommitContextsource ↗
-
interface CellCommitContextInput available when the cell editor commits one edited cell.
propertycol col: numberpropertyformat format?: CellFormat | nullExplicit format read from the Sheet cell-format state owner.
propertyformatLocale formatLocale?: CellFormatLocaleLocale used to interpret the formatted editor text.
propertyplainText plainText: stringpropertyprevious previous: CellMatrixElement | nullpropertyrichText richText: RichDocNode[]propertyrow row: number - interfaceCellCommitStrategyDefinitionsource ↗
-
interface CellCommitStrategyDefinitionContract for deciding how editor input becomes persisted cell data.
propertykey readonly key: stringpropertypriority readonly priority: numbermethodcommit commit(context: CellCommitContext): CellMatrixElement | nullcontext: CellCommitContext
methodinferFormat inferFormat(context: CellCommitContext): CellFormat | nullcontext: CellCommitContext
methodmatches matches(context: CellCommitContext): booleancontext: CellCommitContext
- interfaceCellFormatLocalesource ↗
-
interface CellFormatLocaleLocale defaults used when a cell format does not declare explicit display settings.
propertydatePattern readonly datePattern: stringpropertydateTimePattern readonly dateTimePattern: stringpropertydecimalSeparator readonly decimalSeparator?: stringpropertygroupSeparator readonly groupSeparator?: stringpropertylocale readonly locale: stringpropertytimePattern readonly timePattern: string - interfaceCellFormatTransferCodecsource ↗
-
interface CellFormatTransferCodecType-owned format projection that never substitutes source values for target values.
propertycellType readonly cellType: stringmethodapply apply(cell: CellMatrixElement, format: Readonly<Record<string, unknown>>): CellMatrixElementcell: CellMatrixElementformat: Readonly<Record<string, unknown>>
methodcapture capture(cell: CellMatrixElement): Readonly<Record<string, unknown>>cell: CellMatrixElement
- interfaceICellFormatLocaleProvidersource ↗
-
interface ICellFormatLocaleProviderProvides sheet-local defaults for number and date/time display formatting.
methodgetCellFormatLocale getCellFormatLocale(): CellFormatLocale - interfaceSheetCellInputValidationResultsource ↗
-
interface SheetCellInputValidationResultResult of validating a proposed cell edit.
- interfaceSheetDisplayedValueCoordinatesource ↗
-
interface SheetDisplayedValueCoordinateA cell whose displayed value changed after a derived value update.
- 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: CellFormatLocaleExcel-compatible formatting defaults used when no i18n plugin is installed.
- functionadjustCellFormatDecimalPlacessource ↗
-
adjustCellFormatDecimalPlaces(format: unknown, delta: number): CellFormatAdjusts the visible decimal-place count of numeric built-in formats.
format: unknowndelta: number
- functionassertCellExtensionWritesource ↗
-
assertCellExtensionWrite(owner: object): voidChecks registration changes only; cell reads and rendering stay on their existing hot paths.
owner: object
- functionassertSheetHorizontalAlignmentsource ↗
-
assertSheetHorizontalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet horizontal alignments.
value: unknown
- functionassertSheetVerticalAlignmentsource ↗
-
assertSheetVerticalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet vertical alignments.
value: unknown
- functioncellFormatToExcelCodesource ↗
-
cellFormatToExcelCode(format: unknown): string | undefinedConverts an explicit cell format into the Excel-style code exposed to formula metadata readers.
format: unknown
- functioncreateDefaultCellFormatLocaleProvidersource ↗
-
createDefaultCellFormatLocaleProvider(): ICellFormatLocaleProviderCreates 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): stringRuns the format cell number helper.
value: numberformat: unknownlocale: CellFormatLocale
- functionformatCellNumberDisplaysource ↗
-
formatCellNumberDisplay(value: number, format: unknown, locale?: CellFormatLocale): SpreadsheetFormatDisplayFormats one numeric cell and preserves format-section visual metadata.
value: numberformat: unknownlocale: CellFormatLocale
- functionformatCellTextsource ↗
-
formatCellText(value: string, format: unknown, locale?: CellFormatLocale): stringApplies the fourth custom-format section to a text cell.
value: stringformat: unknownlocale: CellFormatLocale
- functioninterpretNumberInputsource ↗
-
interpretNumberInput(source: string, currentFormat: CellFormat | null | undefined, locale?: CellFormatLocale): { format?: CellFormat; value: number } | nullParses direct numeric/date input and suggests a display format for General cells.
source: stringcurrentFormat: CellFormat | null | undefinedlocale: CellFormatLocale
- functionisSheetHorizontalAlignmentsource ↗
-
isSheetHorizontalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet horizontal alignment.
value: unknown
- functionisSheetVerticalAlignmentsource ↗
-
isSheetVerticalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet vertical alignment.
value: unknown
- functionnormalizeCellFormatsource ↗
-
normalizeCellFormat(value: unknown): CellFormatNormalizes a public CellFormat object, falling back to General for invalid input.
value: unknown
- functionparseFormattedNumbersource ↗
-
parseFormattedNumber(text: string, format: unknown, locale?: CellFormatLocale): number | undefinedRuns the parse formatted number helper.
text: stringformat: unknownlocale: CellFormatLocale
- functionsealCellExtensionWritessource ↗
-
sealCellExtensionWrites(owner: object, assertWrite: (): void): voidSeals an editor-local cell extension owner after setup contributions are registered.
owner: objectassertWrite: (): void
- interfaceCellMatrixElementsource ↗
-
interface CellMatrixElementPersisted cell payload stored in the sheet matrix.
propertyformula formula?: stringFormula 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: stringCell type identifier owned by the cell type catalog.
propertyvalue value?: unknownRaw value whose shape is owned by the cell type.
Package
@searsuite/sear-domain-cell
Cell catalogs that compose commit, display, render, and clipboard behavior.
- classCellDisplayTextRegistrysource ↗
-
class CellDisplayTextRegistryMaps persisted cell types to their display-text semantics without creating render Cells.
constructorconstructor CellDisplayTextRegistry(platform: Platform): CellDisplayTextRegistryCreates a CellDisplayTextRegistry instance.
platform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving CellDisplayTextRegistry.
methodgetDisplayText getDisplayText(cell: CellDisplayData, context: CellDisplayContext): stringReturns the display text.
cell: CellDisplayDatacontext: CellDisplayContext
methodregister register(provider: CellDisplayTextProvider): (): voidRegisters the value.
provider: CellDisplayTextProvider
- classCellRenderDefinitionsource ↗
-
class CellRenderDefinitionA rendering-only sheet cell definition, such as an editor overlay or header affix.
constructorconstructor CellRenderDefinition(): CellRenderDefinitionpropertytype readonly type: string | symbolStable type key for CellRenderDefinition.
methodcreateRenderer createRenderer(): CellRendererDefinitionCreates the renderer.
- classCellTypeCatalogsource ↗
-
class CellTypeCatalogWorkbook 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): CellTypeCatalogCreates a catalog over the specialised commit, display-text and renderer registries.
commitStrategies: CellCommitStrategyRegistrydisplayTexts: CellDisplayTextRegistryrenderCoordinator: SheetRenderCoordinatorManagerclipboardCodecs: CellClipboardCodecRegistryformatCodecs: CellFormatTransferRegistry
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the workbook cell type catalog.
methodget get(type: string | symbol): CellRenderDefinition | undefinedReturns 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): stringResolves display text through the registered provider for a persisted cell type.
cell: CellDisplayDatacontext: CellDisplayContext
methodregister register(definition: CellRenderDefinition): (): voidRegisters a definition atomically and returns a disposer that restores the previous definition.
definition: CellRenderDefinition
methodunregister unregister(type: string | symbol): booleanUnregisters a definition by type key.
type: string | symbol
methodinstallstatic install(container: Container): voidRegisters implementation registries without exposing them from the package entry point.
container: Container
- classCellTypeDefinitionsource ↗
-
class CellTypeDefinition extends CellRenderDefinitionA persisted spreadsheet cell type and all behaviours associated with it.
constructorconstructor CellTypeDefinition(): CellTypeDefinitionpropertytype readonly type: stringPersisted cell type identifier stored on sheet cell data.
methodcreateClipboardCodec createClipboardCodec(): CellClipboardCodecDefinition | undefinedCreates clipboard behavior owned by this persisted cell type.
methodcreateCommitStrategies createCommitStrategies(): readonly CellCommitStrategyDefinition[]Creates commit strategies associated with this cell type.
methodcreateDisplayTextProvider createDisplayTextProvider(): CellDisplayTextProvider | undefinedCreates the display-text provider associated with this cell type.
methodcreateFormatTransferCodec createFormatTransferCodec(): CellFormatTransferCodec | undefinedOptional format-transfer behavior owned by this cell type.
methodcreateRenderer createRenderer(): CellRendererDefinitionCreates the renderer definition associated with this cell type.
methodisStoredValue isStoredValue(_cell: { formula?: unknown; value?: unknown }): booleanValidates persisted data before it reaches a renderer-specific Cell.
_cell: { formula?: unknown; value?: unknown }
- interfaceCellDisplayContextsource ↗
-
interface CellDisplayContextRead-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?: CellFormatLocalepropertycol col?: numberpropertyformulaResultProvider formulaResultProvider?: FormulaResultReaderpropertyrow row?: number - interfaceCellDisplayDatasource ↗
-
interface CellDisplayDataPersisted data required to derive a cell's plain-text representation.
- interfaceCellDocumentFormattingsource ↗
-
interface CellDocumentFormattingPure document formatting supplied by an embedded editor implementation.
- interfaceCellRendererDefinitionsource ↗
-
interface CellRendererDefinitionRender contribution belonging to one spreadsheet cell definition.
- interfaceFormulaResultReadersource ↗
-
interface FormulaResultReaderMinimal formula-result capability required by formula display text.
methodgetFormulaResult getFormulaResult(row: number, col: number): unknownrow: numbercol: number
- functioncreateFormulaCellClipboardCodecsource ↗
-
createFormulaCellClipboardCodec(): CellClipboardCodecDefinitionClipboard 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>): CellRendererDefinitionCreates the standard renderer definition for a
Cellsubclass.cellType: string | symbolcell: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<DataType>
- functionregisterBuiltinCellDefinitionssource ↗
-
registerBuiltinCellDefinitions(catalog: CellTypeCatalog): (): voidRegisters built-in cell definitions and returns a disposer in reverse order.
catalog: CellTypeCatalog
- functionregisterTextFormatTransferCodecssource ↗
-
registerTextFormatTransferCodecs(registry: CellFormatTransferRegistry, readFormatting: (): CellDocumentFormatting | undefined): (): voidText cell type composition; numeric and formula values remain with their own codecs.
registry: CellFormatTransferRegistryreadFormatting: (): CellDocumentFormatting | undefined
Package
@searsuite/sear-domain-collaboration
Host-neutral revision, pending-operation, acknowledgement, catch-up, and rebase algorithms.
- classCollaborationAuthoritysource ↗
-
class CollaborationAuthorityIn-memory authority that validates, rebases, orders, and deduplicates collaboration batches.
constructorconstructor CollaborationAuthority(contributors: CollaborationContributorRegistry): CollaborationAuthoritycontributors: CollaborationContributorRegistry
methodaccept accept(submission: CollaborationSubmission): CollaborationAcceptedBatchAccepts one client submission into the canonical resource order.
submission: CollaborationSubmission
methodsync sync(resourceId: string, fromRevision: number): CollaborationSyncMessageReturns ordered canonical batches after a known revision.
resourceId: stringfromRevision: number
- classCollaborationContributorRegistrysource ↗
-
class CollaborationContributorRegistryOwner-to-OT mapping used by clients, authorities, and editor bridges.
constructorconstructor CollaborationContributorRegistry(operations: TransactionOTRegistry): CollaborationContributorRegistryoperations: TransactionOTRegistry
propertyoperations readonly operations: TransactionOTRegistrymethoddestroy destroy(): voidmethodgetRegisteredOwnerIds getRegisteredOwnerIds(): readonly string[]methodhas has(ownerId: string): booleanownerId: string
methodregister register<OperationType>(ownerId: string, definition: TransactionOTDefinition<OperationType>, relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]): (): voidRegisters one collaborative state owner and returns an idempotent disposer.
ownerId: stringdefinition: TransactionOTDefinition<OperationType>relations: readonly OTTransformRelation<OTOperation, OTOperation>[]
methodrequire require(ownerId: string, operationType?: CollaborationOperationType): TransactionOTDefinitionResolves one registered owner and optionally validates its wire operation type.
ownerId: stringoperationType: CollaborationOperationType
- classCollaborationEnginesource ↗
-
class CollaborationEngineSingle client-side collaboration algorithm shared by all editor bridges.
constructorconstructor CollaborationEngine(contributors: CollaborationContributorRegistry): CollaborationEnginecontributors: CollaborationContributorRegistry
methodconnect connect(resourceId: string, clientId: string, revision?: number): voidStarts one resource session from a host-supplied document revision.
resourceId: stringclientId: stringrevision: number
methoddisconnect disconnect(): voidEnds the current session and releases transient pending state.
methodgetPendingCount getPendingCount(): numbermethodgetRevision getRevision(): numbermethodreceive 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: stringoperations: readonly OperationType[]
- classCollaborationErrorsource ↗
-
class CollaborationError extends SearErrorPublic collaboration failure with stable diagnostics.
constructorconstructor CollaborationError(code: CollaborationErrorCode, message: string, details?: SearErrorDetails): CollaborationErrorcode: CollaborationErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: CollaborationErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- interfaceCollaborationAcceptedBatchsource ↗
-
interface CollaborationAcceptedBatchCanonical operation batch accepted and ordered by the authority.
propertybaseRevision readonly baseRevision: numberpropertyclientId readonly clientId: stringpropertykind readonly kind: "accepted"propertyoperationId readonly operationId: stringpropertyoperationType readonly operationType: CollaborationOperationTypepropertyownerId readonly ownerId: stringpropertypayload readonly payload: OTEncodedValuepropertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: stringpropertyserverRevision readonly serverRevision: number - interfaceCollaborationContributionsource ↗
-
interface CollaborationContribution<OperationType>Open collaboration contribution shared by editor clients and authorities.
propertydefinition readonly definition: TransactionOTDefinition<OperationType>propertyownerId readonly ownerId: stringpropertyrelations readonly relations?: readonly OTTransformRelation<OTOperation, OTOperation>[] - interfaceCollaborationOperationTypesource ↗
-
interface CollaborationOperationTypeVersioned OT family identity carried on the wire.
- interfaceCollaborationRejectedMessagesource ↗
-
interface CollaborationRejectedMessageExplicit authority rejection; clients must not infer recovery from dropped frames.
propertycode readonly code: stringpropertykind readonly kind: "rejected"propertymessage readonly message: stringpropertyoperationId readonly operationId?: stringpropertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: string - interfaceCollaborationSubmissionsource ↗
-
interface CollaborationSubmissionClient submission before the authority assigns a canonical revision.
propertybaseRevision readonly baseRevision: numberpropertyclientId readonly clientId: stringpropertykind readonly kind: "submit"propertyoperationId readonly operationId: stringpropertyoperationType readonly operationType: CollaborationOperationTypepropertyownerId readonly ownerId: stringpropertypayload readonly payload: OTEncodedValuepropertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: string - interfaceCollaborationSyncMessagesource ↗
-
interface CollaborationSyncMessageOrdered catch-up response sent when a transport joins a resource.
propertybatches readonly batches: readonly CollaborationAcceptedBatch[]propertyfromRevision readonly fromRevision: numberpropertykind readonly kind: "sync"propertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: stringpropertyserverRevision 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: 1Current 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
Typed command definitions and the editor-local command bus contract.
- enumDocTransactionRenderOperationTypesource ↗
-
enum DocTransactionRenderOperationTypeRender pipeline effect declared by a document command transaction.
- classDocTransactionsource ↗
-
class DocTransactionBuilder 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(): DocTransactionpropertymeta readonly meta: Record<string, unknown>Command metadata consumed by the document editor host.
propertyrenderOperationType readonly renderOperationType: DocTransactionRenderOperationTypeRender pipeline effect produced by this document transaction.
propertysteps readonly steps: DocStep[]Ordered steps produced by the command.
methodaddStep addStep(step: DocStep): thisAppends a prepared document step.
ReturnsThe current transaction for chaining.
step: DocStep- Step to run during transaction application.
methoddeleteNode deleteNode(path: number[], nodeSnapshot: NodeSchema): thisAppends 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): thisAppends 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 | undefinedReads command metadata by key.
ReturnsThe stored value when present.
key: string- Metadata key.
methodinsertNode insertNode(path: number[], node: NodeSchema): thisAppends 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): thisAppends 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): thisApplies one inline text-style property to the selected range using RichDoc OT operations.
doc: RichDocNode[]selection: DocSelectionproperty: stringvalue: unknownpatchAttrs: InlineTextRangeAttrsPatcher
methodsetMeta setMeta(key: string, value: unknown): thisStores command metadata.
ReturnsThe current transaction for chaining.
key: string- Metadata key.
value: unknown- Metadata value.
methodsetSelection setSelection(sel: DocSelection): thisAppends 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): thisAppends one attribute update operation and retains its previous value for inversion.
path: number[]key: stringvalue: unknownprev: unknown
- classReflowDocTransactionsource ↗
-
class ReflowDocTransaction extends DocTransactionDocument transaction whose RichDoc OT operations may change layout measurement.
constructorconstructor ReflowDocTransaction(): ReflowDocTransactionpropertymetainherited readonly meta: Record<string, unknown>Command metadata consumed by the document editor host.
propertyrenderOperationType readonly renderOperationType: ReflowRender pipeline effect produced by this document transaction.
propertystepsinherited readonly steps: DocStep[]Ordered steps produced by the command.
methodaddStepinherited addStep(step: DocStep): thisAppends a prepared document step.
ReturnsThe current transaction for chaining.
step: DocStep- Step to run during transaction application.
methoddeleteNodeinherited deleteNode(path: number[], nodeSnapshot: NodeSchema): thisAppends 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): thisAppends 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 | undefinedReads command metadata by key.
ReturnsThe stored value when present.
key: string- Metadata key.
methodinsertNodeinherited insertNode(path: number[], node: NodeSchema): thisAppends 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): thisAppends 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): thisApplies one inline text-style property to the selected range using RichDoc OT operations.
doc: RichDocNode[]selection: DocSelectionproperty: stringvalue: unknownpatchAttrs: InlineTextRangeAttrsPatcher
methodsetMetainherited setMeta(key: string, value: unknown): thisStores command metadata.
ReturnsThe current transaction for chaining.
key: string- Metadata key.
value: unknown- Metadata value.
methodsetSelectioninherited setSelection(sel: DocSelection): thisAppends 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): thisAppends one attribute update operation and retains its previous value for inversion.
path: number[]key: stringvalue: unknownprev: unknown
- classRepaintDocTransactionsource ↗
-
class RepaintDocTransaction extends DocTransactionDocument transaction whose RichDoc OT operations only require repainting existing layout.
constructorconstructor RepaintDocTransaction(): RepaintDocTransactionpropertymetainherited readonly meta: Record<string, unknown>Command metadata consumed by the document editor host.
propertyrenderOperationType readonly renderOperationType: RepaintRender pipeline effect produced by this document transaction.
propertystepsinherited readonly steps: DocStep[]Ordered steps produced by the command.
methodaddStepinherited addStep(step: DocStep): thisAppends a prepared document step.
ReturnsThe current transaction for chaining.
step: DocStep- Step to run during transaction application.
methoddeleteNodeinherited deleteNode(path: number[], nodeSnapshot: NodeSchema): thisAppends 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): thisAppends 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 | undefinedReads command metadata by key.
ReturnsThe stored value when present.
key: string- Metadata key.
methodinsertNodeinherited insertNode(path: number[], node: NodeSchema): thisAppends 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): thisAppends 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): thisApplies one inline text-style property to the selected range using RichDoc OT operations.
doc: RichDocNode[]selection: DocSelectionproperty: stringvalue: unknownpatchAttrs: InlineTextRangeAttrsPatcher
methodsetMetainherited setMeta(key: string, value: unknown): thisStores command metadata.
ReturnsThe current transaction for chaining.
key: string- Metadata key.
value: unknown- Metadata value.
methodsetSelectioninherited setSelection(sel: DocSelection): thisAppends 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): thisAppends one attribute update operation and retains its previous value for inversion.
path: number[]key: stringvalue: unknownprev: unknown
- interfaceDocCommandContextsource ↗
-
interface DocCommandContextRuntime state available while a rich-document command builds a transaction.
propertydocSelection docSelection: DocSelectionCurrent document selection before the command applies.
propertylastSnapshot lastSnapshot: LayoutSnapshot | nullLast 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 | nullPreferred horizontal position used by repeated vertical cursor navigation.
- interfaceDocStepsource ↗
-
interface DocStepOne 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[]): DocSelectionMaps 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): DocTransactionRich-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(): DocCommandCreates a command for Backspace behavior.
ReturnsCommand that deletes a selection, deletes the previous character, or merges with the previous paragraph.
- functioninputCommandsource ↗
-
inputCommand(text: string): DocCommandCreates 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): DocCommandCreates 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(): DocCommandCreates a command that selects the complete rich document.
ReturnsSelection-only command spanning the first text node to the last text node.
- functionsplitParagraphCommandsource ↗
-
splitParagraphCommand(): DocCommandCreates 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
The dependency-free JSON protocol shared by standalone and embedded rich documents.
- interfaceNodeSchemasource ↗
-
interface NodeSchemaPersisted 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?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text?: stringOptional text content for leaf text nodes.
propertytype type: stringDomain node type identifier.
- interfaceTextSchemasource ↗
-
interface TextSchema extends NodeSchemaPersisted 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?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text: stringOptional text content for leaf text nodes.
propertytypeinherited type: stringDomain node type identifier.
Package
@searsuite/sear-domain-doc
Rich-document nodes, selections, schema helpers, inline styles, and layout contracts.
- classDocNodeRegistrysource ↗
-
class DocNodeRegistryRegistry that maps persisted rich-document node types to constructors.
constructorconstructor DocNodeRegistry(): DocNodeRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the document node registry.
methodcreate create(schema: Schema): RichDocNodeInstance method: delegates to the static registry; used by DI-injected consumers.
schema: Schema
methodisBlockType isBlockType(type: string): booleanInstance method: returns whether the persisted type has been registered as a block container.
type: string
methodisTextType isTextType(type: string): booleanInstance method: returns whether the persisted type has been registered as text-like.
type: string
methodregister register(definition: DocNodeDefinition): voidRegisters a node factory on this registry instance.
definition: DocNodeDefinition
methodrequireDefaultBlockType requireDefaultBlockType(): stringInstance method: returns the registered default block type for generic text editing.
methodrequireDefaultTextType requireDefaultTextType(): stringInstance method: returns the registered default text type for generic text editing.
methodcreatestatic create(schema: Schema): RichDocNodeCreates a rich-document node from persisted schema.
schema: Schema
methodisBlockTypestatic isBlockType(type: string): booleanReturns whether the persisted type has been registered as a block container.
type: string
methodisTextTypestatic isTextType(type: string): booleanReturns whether the persisted type has been registered as text-like.
type: string
methodregisterstatic register(type: string, creator: (schema: Schema): RichDocNode): voidregister(definition: DocNodeDefinition): voidRegisters a node factory for a persisted node type.
type: stringcreator: (schema: Schema): RichDocNodedefinition: DocNodeDefinition
methodrequireDefaultBlockTypestatic requireDefaultBlockType(): stringReturns the registered default block type for generic text editing.
methodrequireDefaultTextTypestatic requireDefaultTextType(): stringReturns the registered default text type for generic text editing.
- classParagraphNodesource ↗
-
class ParagraphNode extends RichDocNodeBuilt-in paragraph node.
constructorconstructor ParagraphNode(schema: NodeSchema): ParagraphNodeCreates 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 | undefinedStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytypeinherited type: stringDomain node type identifier.
propertynodeTypestatic readonly nodeType: "paragraph"Persisted schema type owned by the paragraph document feature.
methodcreatestaticinherited create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
_schema: Schema
- classRichDocNodesource ↗
-
class RichDocNodeBase 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 | undefinedStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytype type: stringDomain node type identifier.
methodcreatestatic create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
_schema: Schema
- classRichTextBlockFlowRegistrysource ↗
-
class RichTextBlockFlowRegistryOrdered registry for plugin-owned top-level block flow resolution.
constructorconstructor RichTextBlockFlowRegistry(defaultSpacingAfter?: number): RichTextBlockFlowRegistrydefaultSpacingAfter: number
propertysymbolstatic readonly symbol: typeof symbolmethodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidassertWrite: (): void
methodregister register(contribution: RichTextBlockFlowContribution): (): voidcontribution: RichTextBlockFlowContribution
methodresolve resolve(input: { blockCount: number; index: number; node: RichDocNode }): numberinput: { blockCount: number; index: number; node: RichDocNode }
- classRichTextInlineStyleRegistrysource ↗
-
class RichTextInlineStyleRegistryOrdered registry for plugin-owned rich-text inline style readers and mutations.
constructorconstructor RichTextInlineStyleRegistry(): RichTextInlineStyleRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the inline style registry.
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidassertWrite: (): void
methodgetMutation getMutation(styleKey: string): RichTextInlineStyleMutation | undefinedResolves 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>> | undefinedReads all registered style slices from a text node.
node: TextNode
methodregister register(contribution: RichTextInlineStyleContribution): (): voidRegisters one plugin-owned inline style contribution.
contribution: RichTextInlineStyleContribution
methodrequireMutation requireMutation(styleKey: string): RichTextInlineStyleMutationResolves 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): booleanCompares two style bags using stable key/value serialization.
styleA: Readonly<Record<string, unknown>> | undefinedstyleB: Readonly<Record<string, unknown>> | undefined
- classRichTextLineBoxRegistrysource ↗
-
class RichTextLineBoxRegistryOrdered registry for plugin-owned rich-text line box resolution.
constructorconstructor RichTextLineBoxRegistry(): RichTextLineBoxRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the rich-text line box registry.
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidassertWrite: (): void
methodregister register(contribution: RichTextLineBoxContribution): (): voidRegisters one plugin-owned line box contribution.
contribution: RichTextLineBoxContribution
methodresolve resolve(input: { chars: readonly RichTextChar[]; lineSpacing?: RichTextLineSpacing }): RichTextLineBoxResolves the final line box for one measured line.
input: { chars: readonly RichTextChar[]; lineSpacing?: RichTextLineSpacing }
- classTableCellNodesource ↗
-
class TableCellNode extends RichDocNodeBuilt-in table cell node.
constructorconstructor TableCellNode(schema: NodeSchema): TableCellNodeCreates 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 | undefinedStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytypeinherited type: stringDomain node type identifier.
propertynodeTypestatic readonly nodeType: "tableCell"Persisted schema type owned by the table document feature.
methodcreatestaticinherited create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
_schema: Schema
- classTableNodesource ↗
-
class TableNode extends RichDocNodeBuilt-in table block node.
constructorconstructor TableNode(schema: NodeSchema): TableNodeCreates 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 | undefinedStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytypeinherited type: stringDomain node type identifier.
propertynodeTypestatic readonly nodeType: "table"Persisted schema type owned by the table document feature.
methodcreatestaticinherited create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
_schema: Schema
- classTableRowNodesource ↗
-
class TableRowNode extends RichDocNodeBuilt-in table row node.
constructorconstructor TableRowNode(schema: NodeSchema): TableRowNodeCreates 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 | undefinedStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytypeinherited type: stringDomain node type identifier.
propertynodeTypestatic readonly nodeType: "tableRow"Persisted schema type owned by the table document feature.
methodcreatestaticinherited create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
_schema: Schema
- classTextNodesource ↗
-
class TextNode extends RichDocNodeBuilt-in text leaf node.
constructorconstructor TextNode(schema: NodeSchema): TextNodeTextNode(schema: TextSchema): TextNodeCreates 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 | undefinedStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text?: stringText content carried by this leaf node.
propertytypeinherited type: stringDomain node type identifier.
propertynodeTypestatic readonly nodeType: "text"Persisted schema type owned by the text input document feature.
methodcreatestaticinherited create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
_schema: Schema
- interfaceDocCursorPossource ↗
-
interface DocCursorPosCursor position inside a RichDocNode tree.
pathis an array of integer indices that navigates from the implicit
document root (theRichDocNode[]array treated asroot.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 }.offsetis the character position within the leaf text node:
0 = before first character
n = after the nth character (= text.length means "end of node") - interfaceDocNodeDefinitionsource ↗
-
interface DocNodeDefinitionRegistration contract for one persisted rich-document node type.
propertycreate readonly create: (schema: Schema): RichDocNodeFactory that creates the runtime node instance for this persisted schema.
propertydefaultBlock readonly defaultBlock?: booleanWhether this block is the default container for plain text editing.
propertydefaultText readonly defaultText?: booleanWhether this text-like node is the default leaf for plain text editing.
propertyrole readonly role?: DocNodeRoleGeneric role consumed by core editing/layout helpers.
propertytype readonly type: stringPersisted schema type owned by a document feature plugin.
- interfaceDocSelectionsource ↗
-
interface DocSelectionAnchor + head selection model.
Collapsed selection (cursor only): anchor === head.headmoves freely;anchoris fixed until a non-Shift action resets it. - interfaceInlineTextRangePatchsource ↗
-
interface InlineTextRangePatchOne text-node replacement produced by an inline text range edit.
propertybeforeLength readonly beforeLength: numberpropertyblockIndex readonly blockIndex: numberpropertychildIndex readonly childIndex: numberpropertyendOffset readonly endOffset: numberpropertyoldNode readonly oldNode: TextNodepropertyreplacement readonly replacement: readonly RichDocNode[]propertyreplacementCount readonly replacementCount: numberpropertyselectedLength readonly selectedLength: numberpropertystartOffset readonly startOffset: numberpropertywholeNode readonly wholeNode: boolean - interfaceInlineTextRangePatchContextsource ↗
-
interface InlineTextRangePatchContextContext supplied when patching one selected text-node segment.
propertyblockIndex readonly blockIndex: numberpropertychildIndex readonly childIndex: numberpropertyendOffset readonly endOffset: numberpropertynode readonly node: TextNodepropertystartOffset readonly startOffset: number - interfaceRichNodeFactorysource ↗
-
interface RichNodeFactoryMinimal factory interface for creating document nodes.
Implemented byDocNodeRegistry(static or injected).methodcreate create(schema: { attrs?: Record<string, unknown>; content?: unknown[]; id?: string; text?: string; type: string }): RichDocNodeschema: { attrs?: Record<string, unknown>; content?: unknown[]; id?: string; text?: string; type: string }
- interfaceRichTextBlockFlowContributionsource ↗
-
interface RichTextBlockFlowContributionPlugin-owned contribution that can refine block flow metrics.
- interfaceRichTextBlockFlowResolveInputsource ↗
-
interface RichTextBlockFlowResolveInputInput used to resolve the flow spacing after one top-level document block.
propertyblockCount readonly blockCount: numberpropertyindex readonly index: numberpropertynode readonly node: RichDocNodepropertyspacingAfter readonly spacingAfter: number - interfaceRichTextBlockLayoutProvidersource ↗
-
interface RichTextBlockLayoutProviderDomain-side contract for services that provide measured rich-text block layout.
methodcalculateLayoutPerParagraph calculateLayoutPerParagraph(width: number): RichTextLine[][]width: number
methodsetBaseFont setBaseFont(font: string): voidUpdates the transient font used when measuring unstyled text.
font: string
- interfaceRichTextInlineStyleContributionsource ↗
-
interface RichTextInlineStyleContributionPlugin-owned contribution for one inline text style concern.
propertykey readonly key: stringStable 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>> | undefinedReads this contribution's style slice from a text node.
input: RichTextInlineStyleReadInput
- interfaceRichTextInlineStyleMutationsource ↗
-
interface RichTextInlineStyleMutationPlugin-owned mutation for one persisted inline text-style concern.
- interfaceRichTextInlineStyleMutationInputsource ↗
-
interface RichTextInlineStyleMutationInputInput supplied when an inline-style contribution mutates persisted text-node attrs.
- interfaceRichTextInlineStyleReadInputsource ↗
-
interface RichTextInlineStyleReadInputInput supplied when an inline-style contribution reads document attrs.
- interfaceRichTextLineBoxsource ↗
-
interface RichTextLineBoxFlow metrics for one rich-text line.
propertyascent readonly ascent: numberpropertycontentHeight readonly contentHeight: numberpropertydescent readonly descent: numberpropertyleadingBottom readonly leadingBottom: numberpropertyleadingTop readonly leadingTop: numberpropertylineGap readonly lineGap: numberpropertylineHeight readonly lineHeight: number - interfaceRichTextLineBoxContributionsource ↗
-
interface RichTextLineBoxContributionPlugin-owned contribution that can refine rich-text line flow metrics.
- interfaceRichTextLineBoxResolveInputsource ↗
-
interface RichTextLineBoxResolveInputInput used to resolve the flow box for one measured rich-text line.
propertychars readonly chars: readonly RichTextChar[]propertylineBox readonly lineBox: RichTextLineBoxpropertylineSpacing readonly lineSpacing?: RichTextLineSpacing - interfaceRichTextLineSpacingsource ↗
-
interface RichTextLineSpacingPersisted or default line-spacing policy resolved by paragraph layout.
- interfaceRichTextParagraphLayoutsource ↗
-
interface RichTextParagraphLayoutResolved paragraph layout values consumed by line and block flow.
propertylineSpacing readonly lineSpacing: RichTextLineSpacingpropertyspacingAfter readonly spacingAfter: number - interfaceRichTextParagraphLayoutDefaultssource ↗
-
interface RichTextParagraphLayoutDefaultsDefault paragraph layout values supplied by the owning document runtime.
propertylineSpacing readonly lineSpacing: RichTextLineSpacingpropertyspacingAfter readonly spacingAfter: number - interfaceTextAttributeRangesource ↗
-
interface TextAttributeRange<TAttributes>A generic text attribute range in document-relative character offsets.
- interfaceTextGraphemeRangesource ↗
-
interface TextGraphemeRangeOne grapheme range expressed in UTF-16 source offsets.
- interfaceTextSelectionsource ↗
-
interface TextSelectionPublic contract for TextSelection.
- 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 = unknownMeasured inline character/token used by rich-text line wrapping.
propertychar char: stringpropertyfontAscent fontAscent: numberpropertyfontDescent fontDescent?: numberpropertyfontLineGap fontLineGap?: numberpropertyheight height: numberpropertystyle style?: RichTextInlineStylepropertytextNodeIndex textNodeIndex?: numberDirect child index of the source text node within its paragraph.
propertytextNodeOffset textNodeOffset?: numberCharacter 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 = unknownOne laid-out rich-text line with aggregate dimensions.
propertychars chars: RichTextChar[]propertyfontAscent fontAscent: numberMax measured font ascent across all chars on this line; used for stable vertical centering.
propertyfontDescent fontDescent?: numberMax measured font descent across all chars on this line.
propertyheight height: numberpropertylineBox lineBox?: RichTextLineBoxPlugin-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: RichTextParagraphLayoutDefaultsNeutral 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: stringvalue: 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: DocSelectionpatchAttrs: 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 | 1Lexicographic comparison of two cursor positions.
Comparespathelement-by-element, thenoffset. Returns -1 | 0 | 1.a: DocCursorPosb: DocCursorPos
- functioncomputeFirstBaselineYsource ↗
-
computeFirstBaselineY(boxHeight: number, cellPadding: number, fontAscent: number, lineHeight: number, offsetY?: number): numberCompute 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
SincelineHeight = fontAscent + fontDescent, this simplifies to:
baseline = offsetY + cellPadding + (boxHeight - 2·cellPadding + 2·fontAscent - lineHeight) / 2boxHeight: 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(): RichTextBlockFlowContributionCreates the paragraph-owned default after-spacing contribution.
- functioncreateDefaultRichTextLineBoxContributionsource ↗
-
createDefaultRichTextLineBoxContribution(): RichTextLineBoxContributionCreates the default line box contribution used by document composition roots.
- functioncreateDocNodeIdsource ↗
-
createDocNodeId(value: string): DocNodeIdCreates a typed document node id from a non-empty string value.
value: string
- functioncreateDocNodeIdFromPathsource ↗
-
createDocNodeIdFromPath(path: readonly string | number[]): DocNodeIdCreates a fallback document node id from a rich-document path.
path: readonly string | number[]
- functioncreateEmptyParagraphsource ↗
-
createEmptyParagraph(): RichDocNodeCreate a single empty paragraph containing one empty text node.
- functioncreateInlineTextStyleAttrsPatchersource ↗
-
createInlineTextStyleAttrsPatcher(property: string, value: unknown): InlineTextRangeAttrsPatcherCreates the compatibility inline text-style attrs patcher for property/value callers.
property: stringvalue: unknown
- functioncreateRichTextLineSpacingContributionsource ↗
-
createRichTextLineSpacingContribution(): RichTextLineBoxContributionCreates the paragraph-owned line-spacing contribution.
- functiongetDocumentOffsetsource ↗
-
getDocumentOffset(doc: RichDocNode[], position: DocCursorPos): numberConverts 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[]): numberCharacter length of the text node at
path. Returns 0 for missing / non-text nodes.doc: RichDocNode[]path: number[]
- functionisCollapsedsource ↗
-
isCollapsed(sel: DocSelection): booleanRuns the is collapsed helper.
sel: DocSelection
- functionisDocSemanticallyEmptysource ↗
-
isDocSemanticallyEmpty(doc: RichDocNode[]): booleanReturns true if every paragraph in
doccontains no meaningful text.doc: RichDocNode[]
- functionisTextNodesource ↗
-
isTextNode(node: TextNode | RichDocNode): nodeReturns true when a rich-document node is a text leaf.
node: TextNode | RichDocNode
- functionmapInlineTextRangePatchCursorsource ↗
-
mapInlineTextRangePatchCursor(cursor: DocCursorPos, patches: readonly InlineTextRangePatch[]): DocCursorPosRepositions a cursor after an inline text range patch plan has been applied.
cursor: DocCursorPospatches: readonly InlineTextRangePatch[]
- functionnormalizeDocForEditsource ↗
-
normalizeDocForEdit(doc: RichDocNode[]): RichDocNode[]Ensure
dochas 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≤endregardless of direction.sel: DocSelection
- functionparaTextsource ↗
-
paraText(para: RichDocNode): stringExtract the concatenated plain text of a paragraph node.
para: RichDocNode
- functionparaTextLengthsource ↗
-
paraTextLength(para: RichDocNode): numberTotal plain-text length of a paragraph node (sums all direct text children).
para: RichDocNode
- functionparseRichTextLineSpacingsource ↗
-
parseRichTextLineSpacing(value: unknown): RichTextLineSpacing | nullParses a persisted line-spacing override, returning null when invalid.
value: unknown
- functionparseRichTextParagraphSpacingsource ↗
-
parseRichTextParagraphSpacing(value: unknown): number | nullParses 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): voidRegisters the paragraph node type owned by paragraph-oriented document features.
registry: DocNodeRegistrar
- functionregisterTableDocNodessource ↗
-
registerTableDocNodes(registry: DocNodeRegistrar): voidRegisters the table node types owned by table-oriented document features.
registry: DocNodeRegistrar
- functionregisterTextDocNodesource ↗
-
registerTextDocNode(registry: DocNodeRegistrar): voidRegisters 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: DocSelectionproperty: stringvalue: unknownpatchAttrs: InlineTextRangeAttrsPatcher
- functionresolveDocNodeIdsource ↗
-
resolveDocNodeId(node: { id?: string } | undefined, path: readonly string | number[]): DocNodeIdResolves a block-level document id, preferring persisted node identity over path fallback.
node: { id?: string } | undefinedpath: readonly string | number[]
- functionresolveNodesource ↗
-
resolveNode(doc: RichDocNode[], path: number[]): RichDocNode | undefinedResolve the text node at
pathinsidedoc(treated as the root content
array). Returnsundefinedif the path is invalid.doc: RichDocNode[]path: number[]
- functionresolveRichTextParagraphLayoutsource ↗
-
resolveRichTextParagraphLayout(node: RichDocNode | undefined, defaults?: RichTextParagraphLayoutDefaults): RichTextParagraphLayoutResolves paragraph-owned overrides over the runtime defaults.
node: RichDocNode | undefineddefaults: RichTextParagraphLayoutDefaults
- functionresolveTextContentsource ↗
-
resolveTextContent(doc: RichDocNode[], path: number[]): stringGet the plain-text string of the node at
path.
Convenience wrapper aroundresolveNode.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: unknownproperty: stringvalue: unknown
- interfaceNodeSchemasource ↗
-
interface NodeSchemaPersisted 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?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text?: stringOptional text content for leaf text nodes.
propertytype type: stringDomain node type identifier.
- interfaceTextSchemasource ↗
-
interface TextSchema extends NodeSchemaPersisted 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?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text: stringOptional text content for leaf text nodes.
propertytypeinherited type: stringDomain node type identifier.
Package
@searsuite/sear-domain-editor
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: TSnapshotitems: readonly TItem[]getKey: (item: TItem): TKeygetIndex: (item: TItem): number
propertyitemsinherited readonly items: readonly TItem[]Items in their canonical order.
propertysnapshotinherited readonly snapshot: TSnapshotmethodgetByIndex getByIndex(index: number): TItem | nullReturns one item by its numeric index.
index: number
methodgetByKey getByKey(key: TKey): TItem | nullReturns 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 DocBlockLayoutDiffCompares two block-layout snapshots and exposes render-neutral reuse facts.
constructorconstructor DocBlockLayoutDiff(entries: readonly DocBlockLayoutDiffEntry[]): DocBlockLayoutDiffentries: readonly DocBlockLayoutDiffEntry[]
propertyentries readonly entries: readonly DocBlockLayoutDiffEntry[]methodgetChangedEntries getChangedEntries(): readonly DocBlockLayoutDiffEntry[]methodgetEntry getEntry(id: DocNodeId): DocBlockLayoutDiffEntry | nullid: DocNodeId
methodgetReusableRasterCopies getReusableRasterCopies(): readonly DocBlockRasterReuse[]methodgetShiftedEntries getShiftedEntries(): readonly DocBlockLayoutDiffEntry[]methodhasChanges hasChanges(): booleanmethodcomparestatic compare(previous: DocLayoutCache | null, current: DocLayoutCache, options?: DocBlockLayoutDiffOptions): DocBlockLayoutDiffprevious: DocLayoutCache | nullcurrent: DocLayoutCacheoptions: DocBlockLayoutDiffOptions
- classDocLayoutCachesource ↗
-
class DocLayoutCacheImmutable snapshot of block-level document layout used by viewport and SceneGraph projection.
constructorconstructor DocLayoutCache(snapshot: LayoutSnapshot, blocksOrIndex: IndexedSnapshot<LayoutSnapshot, DocBlockLayout, DocNodeId> | readonly DocBlockLayout[]): DocLayoutCacheCreates 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: unknownmembersnapshot snapshot: unknownmethodgetBlockById getBlockById(id: DocNodeId): DocBlockLayout | nullReturns the cached layout record for a document block id.
id: DocNodeId
methodgetBlockByIndex getBlockByIndex(index: number): DocBlockLayout | nullReturns 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: numberbottom: 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 absoluterect.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): booleanReturns whether one block's height-sensitive flow layout changed.
previous: DocLayoutCacheblockId: DocNodeId
methodhasFlowHeightChanged hasFlowHeightChanged(previous: DocLayoutCache, blockId: DocNodeId): booleanReturns whether one block's flow height changed compared with another cache.
previous: DocLayoutCacheblockId: DocNodeId
methodfromSnapshotstatic fromSnapshot(document: readonly RichDocNode[], snapshot: LayoutSnapshot, previousCache?: DocLayoutCache | null): DocLayoutCacheBuilds a block layout cache from a rich document and its layout snapshot.
document: readonly RichDocNode[]snapshot: LayoutSnapshotpreviousCache: DocLayoutCache | null
- classDocLayoutEnginesource ↗
-
class DocLayoutEngineConverts 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): DocLayoutEngineblockFlowRegistry: RichTextBlockFlowRegistry
propertysymbolstatic readonly symbol: symbolDI token for resolving DocLayoutEngine.
methodbuildSnapshot buildSnapshot(doc: RichDocNode[], blockManager: RichTextBlockLayoutProvider, editorWidth: number, editorHeight: number, cellPadding?: number, verticalAlign?: DocVerticalAlign): LayoutSnapshotBuild a LayoutSnapshot from the current blockManager state.
Prerequisites: callers must add all document paragraphs toblockManager
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): BlockLayoutSnapshotBuilds 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: RichTextBlockLayoutProviderblockIndexes: readonly number[]blockTops: readonly number[]editorWidth: numbercellPadding: 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: DocCursorPossnapshot: LayoutSnapshot
methodfindLineIndex findLineIndex(pos: DocCursorPos, snapshot: LayoutSnapshot): numberReturns the index into
snapshot.linesfor the line containingpos.
Returns 0 if not found.pos: DocCursorPossnapshot: 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): DocCursorPosConvert a pixel position (relative to the editor box top-left) to the
nearest DocCursorPos.
Used for click-to-position-cursor and drag-selection.px: numberpy: numbersnapshot: LayoutSnapshot
- classDocPageMapsource ↗
-
class DocPageMapMaps document blocks to pages for viewport range queries and virtualization.
constructorconstructor DocPageMap(pageHeight: number, pageGap: number, pages: readonly DocPageLayout[]): DocPageMapCreates 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: numberGap between pages in document coordinates.
propertypageHeight readonly pageHeight: numberPage height used by this map.
propertypages readonly pages: readonly DocPageLayout[]Ordered page layout records.
methodgetPage getPage(index: number): DocPageLayout | nullReturns 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: numberbottom: number
methodfromLayoutCachestatic fromLayoutCache(cache: DocLayoutCache, pageHeight: number, pageGap?: number): DocPageMapBuilds a page map by intersecting cached block rectangles with fixed-height pages.
cache: DocLayoutCachepageHeight: numberpageGap: number
- classDocViewportWindowsource ↗
-
class DocViewportWindowVisible document window used to filter block and page layout ranges.
constructorconstructor DocViewportWindow(x: number, y: number, width: number, height: number): DocViewportWindowCreates 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: numberVisible height in document units.
propertywidth readonly width: numberVisible width in document units.
propertyx readonly x: numberLeft edge in document coordinates.
propertyy readonly y: numberTop edge in document coordinates.
memberbottom bottom: unknownmethodintersects intersects(rect: DocLayoutRect): booleanReturns whether this viewport intersects another document-space rectangle.
rect: DocLayoutRect
methodfromViewportstatic fromViewport(viewport: { contentRect: DocLayoutRect }, scroll?: { x: number; y: number }): DocViewportWindowCreates 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: TSnapshotmethodgetByIndex getByIndex(index: number): TItem | nullReturns one item by its numeric index.
index: number
methodgetByKey getByKey(key: TKey): TItem | nullReturns 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 SearEditorInjectable 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(): SearEditorConstructs the editor service.
propertysymbolstatic readonly symbol: symbolDI token for resolving the editor service.
methodinitialize initialize(): voidInitializes document-editor runtime state.
- interfaceBlockLayoutSnapshotsource ↗
-
interface BlockLayoutSnapshotMaterialized layout for a subset of top-level document blocks.
- interfaceDocBlockLayoutsource ↗
-
interface DocBlockLayoutCached layout metadata for one top-level document block.
propertyflowHeight readonly flowHeight: numberFlow height from this block top to the next block top, or visual height for the last block.
propertyid readonly id: DocNodeIdStable block identity used by retained render nodes.
propertyindex readonly index: numberZero-based top-level document block index.
propertylineEnd readonly lineEnd: numberExclusive index after the last layout line belonging to this block.
propertylineStart readonly lineStart: numberInclusive index of the first layout line belonging to this block.
propertyrect readonly rect: DocLayoutRectDocument-space rectangle occupied by this block.
- interfaceDocBlockLayoutDiffEntrysource ↗
-
interface DocBlockLayoutDiffEntry - interfaceDocBlockLayoutDiffOptionssource ↗
-
interface DocBlockLayoutDiffOptionspropertyreflowBlockIds 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 DocBlockRasterReusepropertydestination readonly destination: DocLayoutRectpropertyid readonly id: DocNodeIdpropertyindex readonly index: numberpropertysource readonly source: DocLayoutRect - interfaceDocBlockRenderDebugCopysource ↗
-
interface DocBlockRenderDebugCopypropertydestination readonly destination: DocBlockRenderDebugRectpropertysource readonly source: DocBlockRenderDebugRect - interfaceDocBlockRenderDebugRectsource ↗
-
interface DocBlockRenderDebugRect - interfaceDocBlockRenderDebugSnapshotsource ↗
-
interface DocBlockRenderDebugSnapshotpropertychangedBlocks readonly changedBlocks: readonly DocBlockRenderDebugRect[]propertycopiedPixelArea readonly copiedPixelArea: numberpropertyframeMode readonly frameMode: DocBlockRenderFrameModepropertyincrementalRenderAccepted readonly incrementalRenderAccepted: booleanpropertyincrementalRenderCandidate readonly incrementalRenderCandidate?: DocBlockRenderPolicyCandidateDebugMetricspropertyincrementalRenderReason readonly incrementalRenderReason: stringpropertyinvalidRedrawRects readonly invalidRedrawRects: readonly DocBlockRenderDebugRect[]propertyrasterCopies readonly rasterCopies: readonly DocBlockRenderDebugCopy[]propertyredrawnBlockCount readonly redrawnBlockCount: numberpropertyreusedBlocks readonly reusedBlocks: readonly DocBlockRenderDebugRect[]propertyshiftedBlocks readonly shiftedBlocks: readonly DocBlockRenderDebugRect[]propertyskippedBlockCount readonly skippedBlockCount: number - interfaceDocBlockRenderPolicyCandidateDebugMetricssource ↗
-
interface DocBlockRenderPolicyCandidateDebugMetricspropertycopiedAreaRatio readonly copiedAreaRatio: numberpropertycopiedPixelArea readonly copiedPixelArea: numberpropertycopyCount readonly copyCount: numberpropertyinvalidAreaRatio readonly invalidAreaRatio: numberpropertyinvalidPixelArea readonly invalidPixelArea: numberpropertyinvalidRectCount readonly invalidRectCount: number - interfaceDocLayoutRectsource ↗
-
interface DocLayoutRectRectangle contract used by document layout planning without binding to a render target.
- interfaceDocPageLayoutsource ↗
-
interface DocPageLayoutLayout metadata for one document page.
- interfaceDocViewportRangesource ↗
-
interface DocViewportRangeInclusive visible block/page range within the current document viewport.
propertyendBlock readonly endBlock: numberLast top-level document block index included in the buffered viewport.
propertyendPage readonly endPage: numberLast page index included in the buffered viewport.
propertystartBlock readonly startBlock: numberFirst top-level document block index included in the buffered viewport.
propertystartPage readonly startPage: numberFirst page index included in the buffered viewport.
- interfaceDocViewportScrollSourcesource ↗
-
interface DocViewportScrollSourceMinimal scroll/viewport contract needed to compute a document viewport range.
- interfaceLayoutLinesource ↗
-
interface LayoutLineA 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: numberChar 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: numberFont ascent: distance from baseline to top of tallest glyph on this line.
propertyheight height: numberLine 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 mirrorsDocCursorPos.pathsemantics: a cursor at{ path: textNodePath, offset }lives on this line whencharStartOffset <= offset <= charStartOffset + chars.length.propertyx x: numberLeft edge of text, relative to editor box top-left (includes cellPadding).
propertyy y: numberY 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 LayoutSnapshotPre-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 }): DocViewportRangeComputes 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: DocViewportScrollSourcelayoutCache: DocLayoutCachepageMap: DocPageMapoffset: { x: number; y: number }
- functionlockLayoutSnapshotsource ↗
-
lockLayoutSnapshot(snapshot: LayoutSnapshot): LayoutSnapshotLocks a completed layout so readers cannot change cursor or render geometry.
snapshot: LayoutSnapshot
Package
@searsuite/sear-domain-format
Portable cell-format values and formatting contracts.
- interfaceExcelDatePartssource ↗
-
interface ExcelDatePartspropertyday readonly day: numberpropertymonth readonly month: numberpropertyphantomLeapDay readonly phantomLeapDay?: booleanpropertyyear readonly year: number - interfaceSpreadsheetErrorValuesource ↗
-
interface SpreadsheetErrorValue - interfaceSpreadsheetFormatDisplaysource ↗
-
interface SpreadsheetFormatDisplayDisplay metadata selected from one Excel number-format section.
propertycolor readonly color?: stringpropertyfillCharacter readonly fillCharacter?: stringpropertytext readonly text: string - interfaceSpreadsheetFormatLocalesource ↗
-
interface SpreadsheetFormatLocalepropertydatePattern readonly datePattern: stringpropertydateTimePattern readonly dateTimePattern: stringpropertydecimalSeparator readonly decimalSeparator?: stringpropertygroupSeparator readonly groupSeparator?: stringpropertylocale readonly locale: stringpropertytimePattern readonly timePattern: string - interfaceSpreadsheetTextValuesource ↗
-
interface SpreadsheetTextValue - typeSpreadsheetFormatValuesource ↗
-
type SpreadsheetFormatValue = string | number | boolean | null | undefined | SpreadsheetTextValue | SpreadsheetErrorValue | readonly SpreadsheetFormatValue[] | readonly readonly SpreadsheetFormatValue[][] - variableDefaultSpreadsheetFormatLocalesource ↗
-
DefaultSpreadsheetFormatLocale: SpreadsheetFormatLocale - functionexcelDatePartsFromSerialsource ↗
-
excelDatePartsFromSerial(serial: number): ExcelDateParts | nullserial: number
- functionformatDollarsource ↗
-
formatDollar(number: number, decimals: number, currencySymbol?: string): stringnumber: numberdecimals: numbercurrencySymbol: string
- functionformatExcelDateTimesource ↗
-
formatExcelDateTime(serial: number, pattern?: string, locale?: SpreadsheetFormatLocale): stringFormats an Excel date/time serial with date, clock, and elapsed-time tokens.
serial: numberpattern: stringlocale: SpreadsheetFormatLocale
- functionformatExcelDisplaysource ↗
-
formatExcelDisplay(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): SpreadsheetFormatDisplay | SpreadsheetErrorValue | nullFormats a scalar value and preserves section-level visual metadata.
value: SpreadsheetFormatValueformatText: stringlocale: SpreadsheetFormatLocale
- functionformatExcelTextsource ↗
-
formatExcelText(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): string | SpreadsheetErrorValue | nullvalue: SpreadsheetFormatValueformatText: stringlocale: SpreadsheetFormatLocale
- functionformatFixedsource ↗
-
formatFixed(number: number, decimals: number, noCommas: boolean): stringnumber: numberdecimals: numbernoCommas: boolean
- functionformatSpreadsheetNumbersource ↗
-
formatSpreadsheetNumber(value: number, code: string, locale?: SpreadsheetFormatLocale): string | nullvalue: numbercode: stringlocale: SpreadsheetFormatLocale
- functionparseNumberValuesource ↗
-
parseNumberValue(source: string, decimalSeparator?: string, groupSeparator?: string): number | nullsource: stringdecimalSeparator: stringgroupSeparator: string
Package
@searsuite/sear-domain-formula-engine-ts
The TypeScript formula parser, evaluator, dependency graph, and built-in function runtime.
- classAggregationCachesource ↗
-
class AggregationCache extends IAggregationCacheCaches incremental aggregate results for large formula ranges.
constructorconstructor AggregationCache(): AggregationCachepropertysymbolstatic readonly symbol: typeof symbolmethodclear clear(): voidClears all caches.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds cache writes to the owning editor command dispatch after initialization.
isCommandExecuting: (): boolean
methodgetCount getCount(startRow: number, startCol: number, endRow: number, endCol: number): numberGets the COUNT for a range, meaning the number of numeric cells.
Uses the same cache and incremental strategy as getSum.startRow: numberstartCol: numberendRow: numberendCol: number
methodgetSum getSum(startRow: number, startCol: number, endRow: number, endCol: number): numberGets 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): voidNotifies 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(): voidNotifies 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): voidStores a successfully calculated COUNT for a rectangular range.
startRow: numberstartCol: numberendRow: numberendCol: numbercount: number
methodsetSum setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): voidStores a successfully calculated SUM for a rectangular range.
startRow: numberstartCol: numberendRow: numberendCol: numbersum: 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(): voidDrops values and ignores results from requests started before this boundary.
methoddestroy destroy(): voidmethodload 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): (): voidlistener: (): void
- classDependencyGraphsource ↗
-
class DependencyGraph extends IDependencyGraphTracks formula dependencies, dirty propagation, evaluation readiness, and cycles.
constructorconstructor DependencyGraph(): DependencyGraphpropertysymbolstatic readonly symbol: typeof symbolDI token for resolving DependencyGraph.
memberpendingCount pendingCount: unknownNumber of dirty formulas still waiting for evaluation.
membersize size: unknownTotal number of formula cells currently in the graph.
methodclear clear(): voidClears all data.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds 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): booleanReports whether one formula cell is currently dirty.
key: number
methodmarkClean markClean(key: number): voidMarks one formula clean.
Unlocks downstream dependencies by decrementing dirtyDepCount for every
dirty formula that depends on key.key: number
methodmarkDirty markDirty(changedKeys: number[]): voidMarks 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[]): voidNotifies 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): voidRemoves one formula cell.
formulaKey: number
methodupdateCell updateCell(formulaKey: number, depsList: Dependency[]): voidRegisters or updates dependencies for one formula cell.
formulaKey: numberdepsList: Dependency[]
- classFormulaCubeCachesource ↗
-
class FormulaCubeCache extends FormulaCubeServiceHost-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): FormulaCubeCacheloader: (query: FormulaCubeQuery): Promise<FormulaCubeResult>warn: (message: string, error: unknown): void
methodclear clear(): voidmethoddestroy destroy(): voidmethodload load(query: FormulaCubeQuery): Promise<void>query: FormulaCubeQuery
methodread read(query: FormulaCubeQuery): FormulaServiceCacheResult<FormulaCubeResult>query: FormulaCubeQuery
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
- classFormulaEvaluatorsource ↗
-
class FormulaEvaluator extends IFormulaEvaluatorEvaluates parsed formulas against an explicit host-provided context.
constructorconstructor FormulaEvaluator(registry: IFunctionRegistry, aggCache: IAggregationCache): FormulaEvaluatorCreates a FormulaEvaluator instance.
registry: IFunctionRegistryaggCache: IAggregationCache
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FormulaEvaluator.
methodevaluate evaluate(ast: FormulaAST, context: EvalContext): FormulaValueEvaluates one AST.
Recursively traverses each AST node and executes the matching operation.ast: FormulaASTcontext: 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): voidRegisters a custom function.
fn: FormulaFunction
- classFormulaExecutionBudgetsource ↗
-
class FormulaExecutionBudget extends FormulaEvaluationBudgetMutable, deterministic guard against unbounded formula work.
constructorconstructor FormulaExecutionBudget(maxSteps?: number): FormulaExecutionBudgetmaxSteps: number
propertymaxSteps readonly maxSteps: numbermethodconsumeStep consumeStep(): boolean - classFormulaExternalServiceRegistrysource ↗
-
class FormulaExternalServiceRegistry extends IFormulaExternalServiceProviderTokenized editor-local external-service registry with isolated listener failures.
constructorconstructor FormulaExternalServiceRegistry(warn?: (message: string, error: unknown): void): FormulaExternalServiceRegistrywarn: (message: string, error: unknown): void
methoddestroy destroy(ownerToken?: object): voidownerToken: object
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidisCommandExecuting: (): booleandispatchRemoval: (id: number): void
methodenforceTeardownBoundary enforceTeardownBoundary(ownerToken: object): voidReserves cleanup of an assembled registry for its owning editor.
ownerToken: object
methodget get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefineddefinition: FormulaExternalServiceDefinition<T>
methodinvalidate invalidate<T>(definition: FormulaExternalServiceDefinition<T>): voiddefinition: FormulaExternalServiceDefinition<T>
methodregister register<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): voiddefinition: FormulaExternalServiceDefinition<T>service: T
methodsubscribeInvalidation subscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): voidlistener: (serviceIds: readonly string[]): void
methodunregisterRegistration unregisterRegistration(id: number): voidid: number
- classFormulaFormattersource ↗
-
class FormulaFormatterFormats the shared FormulaAST back to formula source text.
constructorconstructor FormulaFormatter(): FormulaFormattermethodformat format(ast: FormulaAST, options?: WorkbookFormulaFormatOptions): stringast: FormulaASToptions: WorkbookFormulaFormatOptions
- classFormulaGoogleServiceCachesource ↗
-
class FormulaGoogleServiceCache extends FormulaGoogleServiceHost-driven cache for AI, import, finance, and translation formulas.
constructorconstructor FormulaGoogleServiceCache(loader: (request: FormulaGoogleRequest): Promise<FormulaValue>, warn?: (message: string, error: unknown): void): FormulaGoogleServiceCacheloader: (request: FormulaGoogleRequest): Promise<FormulaValue>warn: (message: string, error: unknown): void
methodclear clear(): voidmethoddestroy destroy(): voidmethodload load(request: FormulaGoogleRequest): Promise<void>request: FormulaGoogleRequest
methodread read(request: FormulaGoogleRequest): FormulaServiceCacheResult<FormulaValue>request: FormulaGoogleRequest
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
- classFormulaLexicalScopesource ↗
-
class FormulaLexicalScope extends FormulaEvaluationScopeCase-insensitive lexical scope for LET bindings.
constructorconstructor FormulaLexicalScope(parent?: FormulaEvaluationScope): FormulaLexicalScopeparent: FormulaEvaluationScope
propertyparent readonly parent?: FormulaEvaluationScopemethodget get(name: string): FormulaValue | undefinedname: string
methodset set(name: string, value: FormulaValue): voidname: stringvalue: FormulaValue
- classFormulaParsersource ↗
-
class FormulaParser extends IFormulaParserParses formula source and rewrites structural references.
constructorconstructor FormulaParser(): FormulaParserpropertysymbolstatic readonly symbol: typeof symbolDI 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): FormulaASTParses 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[]): FormulaASTShifts 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: FormulaASTchanges: StructureChange[]
- classFormulaStockHistoryCachesource ↗
-
class FormulaStockHistoryCache extends FormulaStockHistoryServiceHost-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): FormulaStockHistoryCacheloader: (request: FormulaStockHistoryRequest): Promise<FormulaError | FormulaValue[][]>warn: (message: string, error: unknown): void
methodclear clear(): voidmethoddestroy destroy(): voidmethodload load(request: FormulaStockHistoryRequest): Promise<void>request: FormulaStockHistoryRequest
methodread read(request: FormulaStockHistoryRequest): FormulaServiceCacheResult<FormulaError | FormulaValue[][]>request: FormulaStockHistoryRequest
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
- classFormulaTextServiceRegistrysource ↗
-
class FormulaTextServiceRegistry extends IFormulaTextServiceProviderDefault tokenized editor-local registry for metadata and cached external formula services.
constructorconstructor FormulaTextServiceRegistry(): FormulaTextServiceRegistrymethodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidisCommandExecuting: (): booleandispatchRemoval: (id: number): void
methodgetLanguageService getLanguageService(): FormulaLanguageService | undefinedmethodgetPhoneticReader getPhoneticReader(): FormulaPhoneticReader | undefinedmethodregisterLanguageService registerLanguageService(service: FormulaLanguageService): (): voidservice: FormulaLanguageService
methodregisterPhoneticReader registerPhoneticReader(reader: FormulaPhoneticReader): (): voidreader: FormulaPhoneticReader
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
methodunregisterRegistration unregisterRegistration(id: number): voidid: number
- classFormulaWebServiceCachesource ↗
-
class FormulaWebServiceCache extends AsyncFormulaServiceCache<string, string | FormulaError>, FormulaWebServiceHost-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): FormulaWebServiceCacheloader: (url: string): Promise<string>warn: (message: string, error: unknown): void
methodclearinherited clear(): voidDrops values and ignores results from requests started before this boundary.
methoddestroyinherited destroy(): voidmethodloadinherited 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): (): voidlistener: (): void
- classFunctionRegistrysource ↗
-
class FunctionRegistry extends IFunctionRegistryPublic contract for IFunctionRegistry.
constructorconstructor FunctionRegistry(options?: FunctionRegistryOptions): FunctionRegistryCreates a FunctionRegistry instance.
options: FunctionRegistryOptions
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FunctionRegistry.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidRequires post-initialization writes to occur during the owning editor's command dispatch.
isCommandExecuting: (): booleandispatchRemoval: (id: number): void
methodget get(name: string): FormulaFunction | undefinedReturns the value.
name: string
methodhas has(name: string): booleanReturns whether the requested entry exists.
name: string
methodlist list(): string[]Returns all registered entries.
methodregister register(fn: FormulaFunction): (): voidRegisters a formula function under its canonical and compatible names.
fn: FormulaFunction
methodregisterMany registerMany(functions: readonly FormulaFunction[]): (): voidRegisters multiple functions while publishing one combined invalidation.
functions: readonly FormulaFunction[]
methodsubscribe subscribe(listener: (functionNames: readonly string[]): void): (): voidSubscribes to registrations and removals that can change formula results.
listener: (functionNames: readonly string[]): void
methodunregisterRegistration unregisterRegistration(id: number): voidRemoves one tokenized registration; disposal may dispatch an owner command.
id: number
- classWebFormulaAddInServicesource ↗
-
class WebFormulaAddInService extends FormulaAddInServiceWeb host adapter: browsers cannot resolve or invoke native add-in procedures.
constructorconstructor WebFormulaAddInService(): WebFormulaAddInServicemethodcall call(_request: FormulaAddInCall): FormulaServiceCacheResult<FormulaValue>_request: FormulaAddInCall
methodresolveRegistration resolveRegistration(_request: FormulaAddInRegistrationRequest): FormulaServiceCacheResult<number>_request: FormulaAddInRegistrationRequest
- interfaceCouponSchedulesource ↗
-
interface CouponScheduleCoupon schedule resolved around a bond settlement date.
propertybasis readonly basis: FinancialDayCountBasispropertycouponsRemaining readonly couponsRemaining: numberpropertydaysFromPrevious readonly daysFromPrevious: numberpropertydaysInPeriod readonly daysInPeriod: numberpropertydaysToNext readonly daysToNext: numberpropertyfrequency readonly frequency: 1 | 2 | 4propertynextCoupon readonly nextCoupon: numberpropertypreviousCoupon readonly previousCoupon: number - interfaceExcelDatePartssource ↗
-
interface ExcelDatePartspropertyday readonly day: numberpropertymonth readonly month: numberpropertyphantomLeapDay readonly phantomLeapDay?: booleanpropertyyear readonly year: number - interfaceExcelDateTimeParseOptionssource ↗
-
interface ExcelDateTimeParseOptions extends FormulaDateTimeParseOptionsOptions passed to locale-aware formula date/time parsers.
propertycurrentDateTimeinherited readonly currentDateTime?: numberpropertylocale readonly locale?: FormulaDateTimeLocale - interfaceFinancialRootOptionssource ↗
-
interface FinancialRootOptionspropertyinitialGuess readonly initialGuess?: numberpropertylowerBound readonly lowerBound?: numberpropertymaxIterations readonly maxIterations?: numberpropertytolerance readonly tolerance?: numberpropertyupperBound readonly upperBound?: number - interfaceFunctionRegistryOptionssource ↗
-
interface FunctionRegistryOptionsFunctionRegistry public API.
propertyexcludedBuiltinNames readonly excludedBuiltinNames?: readonly string[]Built-ins omitted from the initial catalog; hosts may register them later.
propertyincludeGoogleFunctions readonly includeGoogleFunctions?: booleanGoogle-specific functions require an explicit host contribution when disabled.
- interfaceParsedCellRefsource ↗
-
interface ParsedCellRefParsed A1 cell reference.
- interfaceParsedExcelDateTimesource ↗
-
interface ParsedExcelDateTime - interfaceWorkbookFormulaFormatOptionssource ↗
-
interface WorkbookFormulaFormatOptionsWorkbook name resolution used while formatting formula source.
propertymissingSheetName readonly missingSheetName?: stringpropertyresolveSheetName 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 | 4Excel financial day-count conventions.
- typeFinancialNumberResultsource ↗
-
type FinancialNumberResult = number | FormulaError - typeFinancialRootResultsource ↗
-
type FinancialRootResult = number | FormulaError - variableABSsource ↗
-
ABS: FormulaFunctionABS: Returns the absolute value of a number.
Example=ABS(-2) returns 2. - variableACCRINTsource ↗
-
ACCRINT: FormulaFunctionACCRINT: accrued interest for a periodically paying security.
- variableACCRINTMsource ↗
-
ACCRINTM: FormulaFunctionACCRINTM: accrued interest for a security paying interest at maturity.
- variableACOSsource ↗
-
ACOS: FormulaFunctionACOS: Returns the arccosine of a number in radians.
Example=ACOS(1) returns 0. - variableACOSHsource ↗
-
ACOSH: FormulaFunctionACOSH: Returns the inverse hyperbolic cosine of a number.
Example=ACOSH(2) returns approximately 1.316957897. - variableACOTsource ↗
-
ACOT: FormulaFunctionACOT: Returns the arccotangent of a number in radians.
Example=ACOT(1) returns pi/4. - variableACOTHsource ↗
-
ACOTH: FormulaFunctionACOTH: Returns the inverse hyperbolic cotangent of a number.
Example=ACOTH(2) returns approximately 0.549306144. - variableADDsource ↗
-
ADD: FormulaFunctionADD returns the sum of two values. Example: =ADD(2,3) returns 5.
- variableaddInFunctionssource ↗
-
addInFunctions: readonly FormulaFunction[] - variableADDRESSsource ↗
-
ADDRESS: FormulaFunctionADDRESS returns an A1 or R1C1 address. Example: =ADDRESS(2,3) returns $C$2.
- variableAGGREGATEsource ↗
-
AGGREGATE: FormulaFunctionAGGREGATE: Applies an aggregate operation while honoring options for hidden rows and errors.
Example=AGGREGATE(4,6,{1,2,3}) returns 3. - variableAIsource ↗
-
AI: FormulaFunctionAI reads a Gemini result from a host-managed cache. Example: =AI("Summarize",A1) returns cached generated text.
- variableAMORDEGRCsource ↗
-
AMORDEGRC: FormulaFunctionAMORDEGRC: declining-balance depreciation with a French accounting coefficient.
- variableAMORLINCsource ↗
-
AMORLINC: FormulaFunctionAMORLINC: straight-line depreciation prorated over the first period.
- variableANDsource ↗
-
AND: FormulaFunctionAND: Returns TRUE when every supplied logical value is TRUE.
Example=AND(TRUE,1) - variableARABICsource ↗
-
ARABIC: FormulaFunctionARABIC: Converts a Roman numeral text value to an Arabic number.
Example=ARABIC("MCMXCIX") returns 1999. - variableAREASsource ↗
-
AREAS: FormulaFunctionAREAS counts areas in a reference. Example: =AREAS(A1:B2) returns 1.
- variableARRAY_CONSTRAINsource ↗
-
ARRAY_CONSTRAIN: FormulaFunctionARRAY_CONSTRAIN limits an array to a row and column count. Example: =ARRAY_CONSTRAIN(A1:C3,2,1).
- variableARRAYFORMULAsource ↗
-
ARRAYFORMULA: FormulaFunctionARRAYFORMULA exposes an expression's array result. Example: =ARRAYFORMULA({1,2}*2) returns {2,4}.
- variableARRAYTOTEXTsource ↗
-
ARRAYTOTEXT: FormulaFunctionConverts an array to concise or strict text. Example: ARRAYTOTEXT({1,"A"},1) returns "{1,\"A\"}".
- variableASCsource ↗
-
ASC: FormulaFunctionConverts full-width DBCS characters to half-width characters. Example: ASC("ABC") returns "ABC".
- variableASINsource ↗
-
ASIN: FormulaFunctionASIN: Returns the arcsine of a number in radians.
Example=ASIN(0) returns 0. - variableASINHsource ↗
-
ASINH: FormulaFunctionASINH: Returns the inverse hyperbolic sine of a number.
Example=ASINH(0) returns 0. - variableATANsource ↗
-
ATAN: FormulaFunctionATAN: Returns the arctangent of a number in radians.
Example=ATAN(0) returns 0. - variableATAN2source ↗
-
ATAN2: FormulaFunctionATAN2: Returns the angle from an X and Y coordinate pair in radians.
Example=ATAN2(1,0) returns 0. - variableATANHsource ↗
-
ATANH: FormulaFunctionATANH: Returns the inverse hyperbolic tangent of a number.
Example=ATANH(0) returns 0. - variableAVEDEVsource ↗
-
AVEDEV: FormulaFunctionAVEDEV formula.
Evaluates the Excel-compatible AVEDEV statistical function.
Example: =AVEDEV(1,2,3). - variableAVERAGEsource ↗
-
AVERAGE: FormulaFunctionAVERAGE: Returns the arithmetic mean of numeric values.
Example=AVERAGE(10,20,30) returns 20. - variableAVERAGE_WEIGHTEDsource ↗
-
AVERAGE_WEIGHTED: FormulaFunctionAVERAGE_WEIGHTED formula. Computes a weighted arithmetic mean. Example: =AVERAGE_WEIGHTED({10,20},{1,3}) returns 17.5.
- variableAVERAGE_WEIGHTED_DOTTEDsource ↗
-
AVERAGE_WEIGHTED_DOTTED: FormulaFunctionAVERAGE.WEIGHTED is the dotted Google Sheets alias. Example: =AVERAGE.WEIGHTED({10,20},{1,3}) returns 17.5.
- variableAVERAGEAsource ↗
-
AVERAGEA: FormulaFunctionAVERAGEA formula.
Evaluates the Excel-compatible AVERAGEA statistical function.
Example: =AVERAGEA(1,2,3). - variableAVERAGEIFsource ↗
-
AVERAGEIF: FormulaFunctionAVERAGEIF formula.
Evaluates the Excel-compatible AVERAGEIF statistical function.
Example: =AVERAGEIF(1,2,3). - variableAVERAGEIFSsource ↗
-
AVERAGEIFS: FormulaFunctionAVERAGEIFS formula.
Evaluates the Excel-compatible AVERAGEIFS statistical function.
Example: =AVERAGEIFS(1,2,3). - variableBAHTTEXTsource ↗
-
BAHTTEXT: FormulaFunctionSpells a number as Thai baht and satang. Example: BAHTTEXT(1234) returns Thai amount text.
- variableBASEsource ↗
-
BASE: FormulaFunctionBASE: Converts a nonnegative integer to text in a selected radix.
Example=BASE(31,16) returns "1F". - variableBETA_DISTsource ↗
-
BETA_DIST: FormulaFunctionBETA.DIST formula.
Evaluates the Excel-compatible BETA.DIST statistical function.
Example: =BETA.DIST(1,1,TRUE). - variableBETA_INVsource ↗
-
BETA_INV: FormulaFunctionBETA.INV formula.
Evaluates the Excel-compatible BETA.INV statistical function.
Example: =BETA.INV(0.5,1,1). - variableBETADISTsource ↗
-
BETADIST: FormulaFunctionBETADIST compatibility formula: Returns the cumulative beta distribution using the legacy signature.
Example=BETADIST(2,8,10,1,3) - variableBETAINVsource ↗
-
BETAINV: FormulaFunctionBETAINV compatibility formula: Returns the inverse cumulative beta distribution.
Example=BETAINV(0.685470581,8,10,1,3) - variableBINOM_DISTsource ↗
-
BINOM_DIST: FormulaFunctionBINOM.DIST formula.
Evaluates the Excel-compatible BINOM.DIST statistical function.
Example: =BINOM.DIST(1,1,TRUE). - variableBINOM_DIST_RANGEsource ↗
-
BINOM_DIST_RANGE: FormulaFunctionBINOM.DIST.RANGE formula.
Evaluates the Excel-compatible BINOM.DIST.RANGE statistical function.
Example: =BINOM.DIST.RANGE(1,1,TRUE). - variableBINOM_INVsource ↗
-
BINOM_INV: FormulaFunctionBINOM.INV formula.
Evaluates the Excel-compatible BINOM.INV statistical function.
Example: =BINOM.INV(0.5,1,1). - variableBINOMDISTsource ↗
-
BINOMDIST: FormulaFunctionBINOMDIST 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: FormulaFunctionCalls a host-authorized add-in procedure by registration id or module signature.
Example:=CALL("example","entry","JJ",1)invokesentrywith the argument1. - variableCEILINGsource ↗
-
CEILING: FormulaFunctionCEILING compatibility formula: Rounds a number up to a legacy significance multiple.
Example=CEILING(2.5,1) - variableCEILING_MATHsource ↗
-
CEILING_MATH: FormulaFunctionCEILING.MATH: Rounds a number up to the nearest multiple.
Example=CEILING.MATH(24.3,5) returns 25. - variableCEILING_PRECISEsource ↗
-
CEILING_PRECISE: FormulaFunctionCEILING.PRECISE: Rounds a number up to the nearest multiple, using an absolute direction.
Example=CEILING.PRECISE(-4.3,2) returns -4. - variableCELLsource ↗
-
CELL: FormulaFunctionCELL: Returns information about a referenced cell.
Example=CELL("row",B3) - variableCHARsource ↗
-
CHAR: FormulaFunctionReturns the character for a code-page number. Example: CHAR(65) returns "A".
- variableCHIDISTsource ↗
-
CHIDIST: FormulaFunctionCHIDIST compatibility formula: Returns the right-tailed chi-square probability.
Example=CHIDIST(18.307,10) - variableCHIINVsource ↗
-
CHIINV: FormulaFunctionCHIINV compatibility formula: Returns the inverse right-tailed chi-square value.
Example=CHIINV(0.05,10) - variableChineseExcelDateTimeLocalesource ↗
-
ChineseExcelDateTimeLocale: FormulaDateTimeLocaleChinese Excel-style date/time text parser and formatter.
- variableChineseExcelDateTimeSymbolssource ↗
-
ChineseExcelDateTimeSymbols: FormulaDateTimeSymbolsChinese symbols consumed by the shared Excel-compatible date/time parser.
- variableCHISQ_DISTsource ↗
-
CHISQ_DIST: FormulaFunctionCHISQ.DIST formula.
Evaluates the Excel-compatible CHISQ.DIST statistical function.
Example: =CHISQ.DIST(1,1,TRUE). - variableCHISQ_DIST_RTsource ↗
-
CHISQ_DIST_RT: FormulaFunctionCHISQ.DIST.RT formula.
Evaluates the Excel-compatible CHISQ.DIST.RT statistical function.
Example: =CHISQ.DIST.RT(1,1,TRUE). - variableCHISQ_INVsource ↗
-
CHISQ_INV: FormulaFunctionCHISQ.INV formula.
Evaluates the Excel-compatible CHISQ.INV statistical function.
Example: =CHISQ.INV(0.5,1,1). - variableCHISQ_INV_RTsource ↗
-
CHISQ_INV_RT: FormulaFunctionCHISQ.INV.RT formula.
Evaluates the Excel-compatible CHISQ.INV.RT statistical function.
Example: =CHISQ.INV.RT(0.5,1,1). - variableCHISQ_TESTsource ↗
-
CHISQ_TEST: FormulaFunctionCHISQ.TEST formula.
Evaluates the Excel-compatible CHISQ.TEST statistical function.
Example: =CHISQ.TEST(1,2,3). - variableCHITESTsource ↗
-
CHITEST: FormulaFunctionCHITEST compatibility formula: Returns the chi-square independence test probability.
Example=CHITEST({58,35;11,25},{45,48;24,22}) - variableCHOOSEsource ↗
-
CHOOSE: FormulaFunctionCHOOSE selects a value by index. Example: =CHOOSE(2,"A","B") returns B.
- variableCHOOSECOLSsource ↗
-
CHOOSECOLS: FormulaFunctionCHOOSECOLS selects columns from an array. Example: =CHOOSECOLS(A1:C2,1,3).
- variableCHOOSEROWSsource ↗
-
CHOOSEROWS: FormulaFunctionCHOOSEROWS selects rows from an array. Example: =CHOOSEROWS(A1:C3,1,3).
- variableCjkFormulaTextLocalesource ↗
-
CjkFormulaTextLocale: FormulaTextLocaleExcel-compatible CJK text locale where wide CJK code points count as two bytes.
- variableCLEANsource ↗
-
CLEAN: FormulaFunctionRemoves ASCII control characters 0 through 31. Example: CLEAN(CHAR(9)&"A") returns "A".
- variableCODEsource ↗
-
CODE: FormulaFunctionReturns the code of the first character. Example: CODE("A") returns 65.
- variableCOLUMNsource ↗
-
COLUMN: FormulaFunctionCOLUMN returns a reference's first column number. Example: =COLUMN(C5) returns 3.
- variableCOLUMNSsource ↗
-
COLUMNS: FormulaFunctionCOLUMNS returns the number of columns in a reference. Example: =COLUMNS(A1:C2) returns 3.
- variableCOMBINsource ↗
-
COMBIN: FormulaFunctionCOMBIN: Returns the number of combinations for choosing items without repetition.
Example=COMBIN(8,2) returns 28. - variableCOMBINAsource ↗
-
COMBINA: FormulaFunctionCOMBINA: Returns the number of combinations for choosing items with repetition.
Example=COMBINA(4,3) returns 20. - variablecompatibilityFunctionssource ↗
-
compatibilityFunctions: readonly FormulaFunction[] - variableCompatibleExcelDateTimeLocalesource ↗
-
CompatibleExcelDateTimeLocale: FormulaDateTimeLocaleLegacy alias for the default parser, which now falls back to English symbols.
- variableCONCATsource ↗
-
CONCAT: FormulaFunctionJoins text and ranges without a delimiter. Example: CONCAT("A",1) returns "A1".
- variableCONCATENATEsource ↗
-
CONCATENATE: FormulaFunctionLegacy text concatenation. Example: CONCATENATE("Hello"," World") returns "Hello World".
- variableCONFIDENCEsource ↗
-
CONFIDENCE: FormulaFunctionCONFIDENCE compatibility formula: Returns a normal-distribution confidence interval.
Example=CONFIDENCE(0.05,2.5,50) - variableCONFIDENCE_NORMsource ↗
-
CONFIDENCE_NORM: FormulaFunctionCONFIDENCE.NORM formula.
Evaluates the Excel-compatible CONFIDENCE.NORM statistical function.
Example: =CONFIDENCE.NORM(1,2,3). - variableCONFIDENCE_Tsource ↗
-
CONFIDENCE_T: FormulaFunctionCONFIDENCE.T formula.
Evaluates the Excel-compatible CONFIDENCE.T statistical function.
Example: =CONFIDENCE.T(1,2,3). - variableCORRELsource ↗
-
CORREL: FormulaFunctionCORREL formula.
Evaluates the Excel-compatible CORREL statistical function.
Example: =CORREL(1,2,3). - variableCOSsource ↗
-
COS: FormulaFunctionCOS: Returns the cosine of an angle in radians.
Example=COS(0) returns 1. - variableCOSHsource ↗
-
COSH: FormulaFunctionCOSH: Returns the hyperbolic cosine of a number.
Example=COSH(0) returns 1. - variableCOTsource ↗
-
COT: FormulaFunctionCOT: Returns the cotangent of an angle in radians.
Example=COT(RADIANS(45)) returns 1. - variableCOTHsource ↗
-
COTH: FormulaFunctionCOTH: Returns the hyperbolic cotangent of a number.
Example=COTH(1) returns approximately 1.313035285. - variableCOUNTAsource ↗
-
COUNTA: FormulaFunctionCOUNTA formula.
Evaluates the Excel-compatible COUNTA statistical function.
Example: =COUNTA(1,2,3). - variableCOUNTBLANKsource ↗
-
COUNTBLANK: FormulaFunctionCOUNTBLANK formula.
Evaluates the Excel-compatible COUNTBLANK statistical function.
Example: =COUNTBLANK(1,2,3). - variableCOUNTIFsource ↗
-
COUNTIF: FormulaFunctionCOUNTIF formula.
Evaluates the Excel-compatible COUNTIF statistical function.
Example: =COUNTIF(1,2,3). - variableCOUNTIFSsource ↗
-
COUNTIFS: FormulaFunctionCOUNTIFS formula.
Evaluates the Excel-compatible COUNTIFS statistical function.
Example: =COUNTIFS(1,2,3). - variableCOUNTUNIQUEsource ↗
-
COUNTUNIQUE: FormulaFunctionCOUNTUNIQUE counts distinct values. Example: =COUNTUNIQUE(1,1,2) returns 2.
- variableCOUPDAYBSsource ↗
-
COUPDAYBS: FormulaFunctionCOUPDAYBS: days from the beginning of a coupon period to settlement.
- variableCOUPDAYSsource ↗
-
COUPDAYS: FormulaFunctionCOUPDAYS: number of days in the coupon period containing settlement.
- variableCOUPDAYSNCsource ↗
-
COUPDAYSNC: FormulaFunctionCOUPDAYSNC: days from settlement to the next coupon.
- variableCOUPNUMsource ↗
-
COUPNUM: FormulaFunctionCOUPNUM: number of coupons remaining after settlement.
- variableCOVARsource ↗
-
COVAR: FormulaFunctionCOVAR compatibility formula: Returns population covariance for two data sets.
Example=COVAR({2,4,8},{5,11,12}) - variableCOVARIANCE_Psource ↗
-
COVARIANCE_P: FormulaFunctionCOVARIANCE.P formula.
Evaluates the Excel-compatible COVARIANCE.P statistical function.
Example: =COVARIANCE.P(1,2,3). - variableCOVARIANCE_Ssource ↗
-
COVARIANCE_S: FormulaFunctionCOVARIANCE.S formula.
Evaluates the Excel-compatible COVARIANCE.S statistical function.
Example: =COVARIANCE.S(1,2,3). - variableCRITBINOMsource ↗
-
CRITBINOM: FormulaFunctionCRITBINOM compatibility formula: Returns the smallest binomial value meeting a cumulative probability.
Example=CRITBINOM(6,0.5,0.75) - variableCSCsource ↗
-
CSC: FormulaFunctionCSC: Returns the cosecant of an angle in radians.
Example=CSC(PI()/2) returns 1. - variableCSCHsource ↗
-
CSCH: FormulaFunctionCSCH: 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: FormulaFunctionReturns a typed KPI property member. Example: CUBEKPIMEMBER("Sales","Revenue KPI",KPIGoal).
- variableCUBEMEMBERsource ↗
-
CUBEMEMBER: FormulaFunctionReturns a typed cube member or tuple. Example: CUBEMEMBER("Sales","[Time].[Fiscal].[2004]").
- variableCUBEMEMBERPROPERTYsource ↗
-
CUBEMEMBERPROPERTY: FormulaFunctionReturns one property of a cube member. Example: CUBEMEMBERPROPERTY("Sales","[Time].[2004]","Name").
- variableCUBERANKEDMEMBERsource ↗
-
CUBERANKEDMEMBER: FormulaFunctionReturns the member at a one-based set rank. Example: CUBERANKEDMEMBER("Sales",A1,1).
- variableCUBESETsource ↗
-
CUBESET: FormulaFunctionReturns a typed OLAP set. Example: CUBESET("Sales","[Product].Members","Products").
- variableCUBESETCOUNTsource ↗
-
CUBESETCOUNT: FormulaFunctionReturns the item count of a CUBESET result. Example: CUBESETCOUNT(A1).
- variableCUBEVALUEsource ↗
-
CUBEVALUE: FormulaFunctionReturns an aggregated cube value. Example: CUBEVALUE("Sales","[Measures].[Profit]").
- variableCUMIPMTsource ↗
-
CUMIPMT: FormulaFunctionCUMIPMT: cumulative interest paid between two periods.
- variableCUMPRINCsource ↗
-
CUMPRINC: FormulaFunctionCUMPRINC: cumulative principal paid between two periods.
- variabledatabaseFunctionssource ↗
-
databaseFunctions: readonly FormulaFunction[] - variableDATEsource ↗
-
DATE: FormulaFunctionDATE: Creates an Excel date serial from year, month, and day parts.
Example: =DATE(2024,2,29) returns 45351. - variableDATEDIFsource ↗
-
DATEDIF: FormulaFunctionDATEDIF: 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: FormulaFunctionDATEVALUE: Converts date text into an Excel date serial.
Example: =DATEVALUE("22-MAY-2011") returns 40685. - variableDAVERAGEsource ↗
-
DAVERAGE: FormulaFunctionDAVERAGE: Returns the average of matching numeric database records.
Example=DAVERAGE(A1:C5,"Sales",E1:F2) - variableDAYsource ↗
-
DAY: FormulaFunctionDAY: Returns the day of month for a date serial.
Example: =DAY("2011-4-15") returns 15. - variableDAYSsource ↗
-
DAYS: FormulaFunctionDAYS: 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: FormulaFunctionDAYS360: Returns the day difference using a 360-day accounting year.
Example: =DAYS360("2011-1-1","2011-12-31") returns 360. - variableDBCSsource ↗
-
DBCS: FormulaFunctionConverts half-width characters to full-width DBCS characters. Example: DBCS("ABC") returns "ABC".
- variableDCOUNTsource ↗
-
DCOUNT: FormulaFunctionDCOUNT: Counts matching database records containing numbers.
Example=DCOUNT(A1:C5,"Sales",E1:F2) - variableDCOUNTAsource ↗
-
DCOUNTA: FormulaFunctionDCOUNTA: Counts matching nonblank database records.
Example=DCOUNTA(A1:C5,"Name",E1:F2) - variableDECIMALsource ↗
-
DECIMAL: FormulaFunctionDECIMAL: Converts text in a selected radix to a decimal number.
Example=DECIMAL("1010",2) returns 10. - variableDEGREESsource ↗
-
DEGREES: FormulaFunctionDEGREES: Converts an angle from radians to degrees.
Example=DEGREES(PI()) returns 180. - variableDETECTLANGUAGEsource ↗
-
DETECTLANGUAGE: FormulaFunctionReads language detection from the host cache. Example: DETECTLANGUAGE("hello") commonly returns "en".
- variableDEVSQsource ↗
-
DEVSQ: FormulaFunctionDEVSQ formula.
Evaluates the Excel-compatible DEVSQ statistical function.
Example: =DEVSQ(1,2,3). - variableDGETsource ↗
-
DGET: FormulaFunctionDGET: Returns the single field value from exactly one matching record.
Example=DGET(A1:C5,"Sales",E1:F2) - variableDISCsource ↗
-
DISC: FormulaFunctionDISC: annualized discount rate for a discounted security.
- variableDIVIDEsource ↗
-
DIVIDE: FormulaFunctionDIVIDE divides one value by another. Example: =DIVIDE(6,2) returns 3.
- variableDMAXsource ↗
-
DMAX: FormulaFunctionDMAX: Returns the largest matching numeric database value.
Example=DMAX(A1:C5,"Sales",E1:F2) - variableDMINsource ↗
-
DMIN: FormulaFunctionDMIN: Returns the smallest matching numeric database value.
Example=DMIN(A1:C5,"Sales",E1:F2) - variableDOLLARsource ↗
-
DOLLAR: FormulaFunctionFormats a number as currency text. Example: DOLLAR(1234.5,2) returns "$1,234.50".
- variableDOLLARDEsource ↗
-
DOLLARDE: FormulaFunctionDOLLARDE: converts a fractional dollar price to a decimal price.
- variableDOLLARFRsource ↗
-
DOLLARFR: FormulaFunctionDOLLARFR: converts a decimal dollar price to a fractional price.
- variableDPRODUCTsource ↗
-
DPRODUCT: FormulaFunctionDPRODUCT: Multiplies matching numeric database values.
Example=DPRODUCT(A1:C5,"Sales",E1:F2) - variableDROPsource ↗
-
DROP: FormulaFunctionDROP removes rows and columns. Example: =DROP(A1:C3,1) removes the first row.
- variableDSTDEVsource ↗
-
DSTDEV: FormulaFunctionDSTDEV: Returns the sample standard deviation of matching records.
Example=DSTDEV(A1:C5,"Sales",E1:F2) - variableDSTDEVPsource ↗
-
DSTDEVP: FormulaFunctionDSTDEVP: Returns the population standard deviation of matching records.
Example=DSTDEVP(A1:C5,"Sales",E1:F2) - variableDSUMsource ↗
-
DSUM: FormulaFunctionDSUM: Sums matching numeric database values.
Example=DSUM(A1:C5,"Sales",E1:F2) - variableDURATIONsource ↗
-
DURATION: FormulaFunctionDURATION: Macaulay duration of a coupon security.
- variableDVARsource ↗
-
DVAR: FormulaFunctionDVAR: Returns the sample variance of matching records.
Example=DVAR(A1:C5,"Sales",E1:F2) - variableDVARPsource ↗
-
DVARP: FormulaFunctionDVARP: Returns the population variance of matching records.
Example=DVARP(A1:C5,"Sales",E1:F2) - variableEDATEsource ↗
-
EDATE: FormulaFunctionEDATE: Returns the date serial offset by a whole number of months.
Example: =EDATE("2011-1-15",2) returns 40617. - variableENCODEURLsource ↗
-
ENCODEURL: FormulaFunctionEncodes text as an RFC 3986 UTF-8 URL component. Example: ENCODEURL("a b") returns "a%20b".
- variableEnglishExcelDateTimeLocalesource ↗
-
EnglishExcelDateTimeLocale: FormulaDateTimeLocaleEnglish Excel-style date/time text parser and formatter.
- variableEnglishExcelDateTimeSymbolssource ↗
-
EnglishExcelDateTimeSymbols: FormulaDateTimeSymbolsEnglish symbols consumed by the shared Excel-compatible date/time parser.
- variableEOMONTHsource ↗
-
EOMONTH: FormulaFunctionEOMONTH: Returns the last day of the month offset from a start date.
Example: =EOMONTH("2011-1-1",1) returns 40602. - variableEPOCHTODATEsource ↗
-
EPOCHTODATE: FormulaFunctionEPOCHTODATE converts a Unix timestamp to an Excel UTC date-time serial. Example: =EPOCHTODATE(0) returns 25569.
- variableEQsource ↗
-
EQ: FormulaFunctionEQ tests two values for equality. Example: =EQ(2,2) returns TRUE.
- variableERROR_TYPEsource ↗
-
ERROR_TYPE: FormulaFunctionERROR.TYPE: Returns the numeric code for an error value.
Example=ERROR.TYPE(NA()) - variableEUROCONVERTsource ↗
-
EUROCONVERT: FormulaFunctionConverts between the euro and legacy euro-member currencies using fixed EU rates.
Example:=EUROCONVERT(1.2,"DEM","EUR")returns0.61. - variableEVENsource ↗
-
EVEN: FormulaFunctionEVEN: Rounds a number away from zero to the nearest even integer.
Example=EVEN(1.5) returns 2. - variableEXACTsource ↗
-
EXACT: FormulaFunctionCompares two strings with case sensitivity. Example: EXACT("A","a") returns FALSE.
- variableEXCEL_1904_SERIAL_OFFSETsource ↗
-
EXCEL_1904_SERIAL_OFFSET: 1462 - variableEXPsource ↗
-
EXP: FormulaFunctionEXP: Returns e raised to the specified power.
Example=EXP(0) returns 1. - variableEXPON_DISTsource ↗
-
EXPON_DIST: FormulaFunctionEXPON.DIST formula.
Evaluates the Excel-compatible EXPON.DIST statistical function.
Example: =EXPON.DIST(1,1,TRUE). - variableEXPONDISTsource ↗
-
EXPONDIST: FormulaFunctionEXPONDIST compatibility formula: Returns an exponential distribution value.
Example=EXPONDIST(0.2,10,TRUE) - variableF_DISTsource ↗
-
F_DIST: FormulaFunctionF.DIST formula.
Evaluates the Excel-compatible F.DIST statistical function.
Example: =F.DIST(1,1,TRUE). - variableF_DIST_RTsource ↗
-
F_DIST_RT: FormulaFunctionF.DIST.RT formula.
Evaluates the Excel-compatible F.DIST.RT statistical function.
Example: =F.DIST.RT(1,1,TRUE). - variableF_INVsource ↗
-
F_INV: FormulaFunctionF.INV formula.
Evaluates the Excel-compatible F.INV statistical function.
Example: =F.INV(0.5,1,1). - variableF_INV_RTsource ↗
-
F_INV_RT: FormulaFunctionF.INV.RT formula.
Evaluates the Excel-compatible F.INV.RT statistical function.
Example: =F.INV.RT(0.5,1,1). - variableF_TESTsource ↗
-
F_TEST: FormulaFunctionF.TEST formula.
Evaluates the Excel-compatible F.TEST statistical function.
Example: =F.TEST(1,2,3). - variableFACTsource ↗
-
FACT: FormulaFunctionFACT: Returns the factorial of a nonnegative integer.
Example=FACT(5) returns 120. - variableFACTDOUBLEsource ↗
-
FACTDOUBLE: FormulaFunctionFACTDOUBLE: Returns the double factorial of a nonnegative integer.
Example=FACTDOUBLE(7) returns 105. - variableFALSEsource ↗
-
FALSE: FormulaFunctionFALSE: Returns the logical value FALSE.
Example=FALSE() - variableFDISTsource ↗
-
FDIST: FormulaFunctionFDIST compatibility formula: Returns the right-tailed F distribution probability.
Example=FDIST(15.2069,6,4) - variableFILTERsource ↗
-
FILTER: FormulaFunctionFILTER returns rows matching a Boolean include array. Example: =FILTER(A1:B3,{TRUE;FALSE;TRUE}).
- variableFILTERXMLsource ↗
-
FILTERXML: FormulaFunctionExtracts 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: FormulaFunctionFinds case-sensitive text and returns a one-based position. Example: FIND("b","abc") returns 2.
- variableFINDBsource ↗
-
FINDB: FormulaFunctionFinds case-sensitive text using locale-defined DBCS byte positions. Example: FINDB("b", "abc") returns 2.
- variableFINVsource ↗
-
FINV: FormulaFunctionFINV compatibility formula: Returns the inverse right-tailed F distribution.
Example=FINV(0.01,6,4) - variableFISHERsource ↗
-
FISHER: FormulaFunctionFISHER formula.
Evaluates the Excel-compatible FISHER statistical function.
Example: =FISHER(1,2,3). - variableFISHERINVsource ↗
-
FISHERINV: FormulaFunctionFISHERINV formula.
Evaluates the Excel-compatible FISHERINV statistical function.
Example: =FISHERINV(0.5,1,1). - variableFIXEDsource ↗
-
FIXED: FormulaFunctionFormats rounded fixed-decimal text. Example: FIXED(1234.567,1) returns "1,234.6".
- variableFLATTENsource ↗
-
FLATTEN: FormulaFunctionFLATTEN combines one or more arrays into a single column. Example: =FLATTEN(A1:B2,C1:C2).
- variableFLOORsource ↗
-
FLOOR: FormulaFunctionFLOOR compatibility formula: Rounds a number down to a legacy significance multiple.
Example=FLOOR(2.5,1) - variableFLOOR_MATHsource ↗
-
FLOOR_MATH: FormulaFunctionFLOOR.MATH: Rounds a number down to the nearest multiple.
Example=FLOOR.MATH(-8.1,2) returns -10. - variableFLOOR_PRECISEsource ↗
-
FLOOR_PRECISE: FormulaFunctionFLOOR.PRECISE: Rounds a number down to the nearest multiple using an absolute direction.
Example=FLOOR.PRECISE(-3.2,1) returns -4. - variableFORECASTsource ↗
-
FORECAST: FormulaFunctionFORECAST formula.
Evaluates the Excel-compatible FORECAST statistical function.
Example: =FORECAST(1,2,3). - variableFORECAST_ETSsource ↗
-
FORECAST_ETS: FormulaFunctionFORECAST.ETS formula.
Evaluates the Excel-compatible FORECAST.ETS statistical function.
Example: =FORECAST.ETS(1,2,3). - variableFORECAST_ETS_CONFINTsource ↗
-
FORECAST_ETS_CONFINT: FormulaFunctionFORECAST.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: FormulaFunctionFORECAST.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: FormulaFunctionFORECAST.ETS.STAT formula.
Evaluates the Excel-compatible FORECAST.ETS.STAT statistical function.
Example: =FORECAST.ETS.STAT(1,2,3). - variableFORECAST_LINEARsource ↗
-
FORECAST_LINEAR: FormulaFunctionFORECAST.LINEAR formula.
Evaluates the Excel-compatible FORECAST.LINEAR statistical function.
Example: =FORECAST.LINEAR(1,2,3). - variableFORMULATEXTsource ↗
-
FORMULATEXT: FormulaFunctionFORMULATEXT returns source text for a formula cell. Example: =FORMULATEXT(A1).
- variableFREQUENCYsource ↗
-
FREQUENCY: FormulaFunctionFREQUENCY formula.
Evaluates the Excel-compatible FREQUENCY statistical function.
Example: =FREQUENCY(1,2,3). - variableFTESTsource ↗
-
FTEST: FormulaFunctionFTEST compatibility formula: Returns the two-tailed F-test probability.
Example=FTEST({1,2,3},{1,2,4}) - variableFVSCHEDULEsource ↗
-
FVSCHEDULE: FormulaFunctionFVSCHEDULE: future value using a series of variable rates.
- variableGAMMAsource ↗
-
GAMMA: FormulaFunctionGAMMA formula.
Evaluates the Excel-compatible GAMMA statistical function.
Example: =GAMMA(1,2,3). - variableGAMMA_DISTsource ↗
-
GAMMA_DIST: FormulaFunctionGAMMA.DIST formula.
Evaluates the Excel-compatible GAMMA.DIST statistical function.
Example: =GAMMA.DIST(1,1,TRUE). - variableGAMMA_INVsource ↗
-
GAMMA_INV: FormulaFunctionGAMMA.INV formula.
Evaluates the Excel-compatible GAMMA.INV statistical function.
Example: =GAMMA.INV(0.5,1,1). - variableGAMMADISTsource ↗
-
GAMMADIST: FormulaFunctionGAMMADIST compatibility formula: Returns a gamma distribution value.
Example=GAMMADIST(10,9,2,TRUE) - variableGAMMAINVsource ↗
-
GAMMAINV: FormulaFunctionGAMMAINV compatibility formula: Returns an inverse gamma distribution value.
Example=GAMMAINV(0.068094,9,2) - variableGAMMALNsource ↗
-
GAMMALN: FormulaFunctionGAMMALN formula.
Evaluates the Excel-compatible GAMMALN statistical function.
Example: =GAMMALN(1,2,3). - variableGAMMALN_PRECISEsource ↗
-
GAMMALN_PRECISE: FormulaFunctionGAMMALN.PRECISE formula.
Evaluates the Excel-compatible GAMMALN.PRECISE statistical function.
Example: =GAMMALN.PRECISE(1,2,3). - variableGAUSSsource ↗
-
GAUSS: FormulaFunctionGAUSS formula.
Evaluates the Excel-compatible GAUSS statistical function.
Example: =GAUSS(1,2,3). - variableGCDsource ↗
-
GCD: FormulaFunctionGCD: Returns the greatest common divisor of numeric values.
Example=GCD(24,36) returns 12. - variableGEOMEANsource ↗
-
GEOMEAN: FormulaFunctionGEOMEAN formula.
Evaluates the Excel-compatible GEOMEAN statistical function.
Example: =GEOMEAN(1,2,3). - variableGETPIVOTDATAsource ↗
-
GETPIVOTDATA: FormulaFunctionGETPIVOTDATA reads a host pivot data service. Example: =GETPIVOTDATA("Sales",A1).
- variableGOOGLEFINANCEsource ↗
-
GOOGLEFINANCE: FormulaFunctionGOOGLEFINANCE reads market data from a host-managed cache. Example: =GOOGLEFINANCE("NASDAQ:GOOG","price") returns cached price data.
- variablegoogleFunctionssource ↗
-
googleFunctions: readonly FormulaFunction[] - variableGOOGLETRANSLATEsource ↗
-
GOOGLETRANSLATE: FormulaFunctionGOOGLETRANSLATE reads a translation from a host-managed cache. Example: =GOOGLETRANSLATE("hello","en","zh-CN") returns cached text.
- variableGROUPBYsource ↗
-
GROUPBY: FormulaFunctionGROUPBY groups rows by a key and aggregates values by sum. Example: =GROUPBY(A2:A5,B2:B5,SUM).
- variableGROWTHsource ↗
-
GROWTH: FormulaFunctionGROWTH formula.
Evaluates the Excel-compatible GROWTH statistical function.
Example: =GROWTH(1,2,3). - variableGTsource ↗
-
GT: FormulaFunctionGT tests whether the first value is greater. Example: =GT(3,2) returns TRUE.
- variableGTEsource ↗
-
GTE: FormulaFunctionGTE tests whether the first value is at least the second. Example: =GTE(2,2) returns TRUE.
- variableHARMEANsource ↗
-
HARMEAN: FormulaFunctionHARMEAN formula.
Evaluates the Excel-compatible HARMEAN statistical function.
Example: =HARMEAN(1,2,3). - variableHLOOKUPsource ↗
-
HLOOKUP: FormulaFunctionHLOOKUP searches a table's first row. Example: =HLOOKUP("B",A1:C2,2,FALSE).
- variableHOURsource ↗
-
HOUR: FormulaFunctionHOUR: Returns the hour component from a time or date-time value.
Example: =HOUR("2011-7-18 7:45") returns 7. - variableHSTACKsource ↗
-
HSTACK: FormulaFunctionHSTACK joins arrays horizontally. Example: =HSTACK({1;2},{3;4}).
- variableHYPERLINKsource ↗
-
HYPERLINK: FormulaFunctionHYPERLINK returns display text for a host-rendered link. Example: =HYPERLINK("https://example.com","Open").
- variableHYPGEOM_DISTsource ↗
-
HYPGEOM_DIST: FormulaFunctionHYPGEOM.DIST formula.
Evaluates the Excel-compatible HYPGEOM.DIST statistical function.
Example: =HYPGEOM.DIST(1,1,TRUE). - variableHYPGEOMDISTsource ↗
-
HYPGEOMDIST: FormulaFunctionHYPGEOMDIST compatibility formula: Returns the non-cumulative hypergeometric probability.
Example=HYPGEOMDIST(1,4,8,20) - variableIFsource ↗
-
IF: FormulaFunctionReturns one value when a condition is true and another when it is false.
- variableIFERRORsource ↗
-
IFERROR: FormulaFunctionIFERROR: Replaces a formula error with a fallback value.
Example=IFERROR(1/0,0) returns 0. - variableIFNAsource ↗
-
IFNA: FormulaFunctionIFNA: Returns a fallback only when the input is #N/A.
Example=IFNA(NA(),0) - variableIFSsource ↗
-
IFS: FormulaFunctionIFS: Returns the value paired with the first TRUE condition.
Example=IFS(A1>90,"A",A1>80,"B",TRUE,"C") - variableIMAGEsource ↗
-
IMAGE: FormulaFunctionIMAGE reads a host-managed image cache. Example: =IMAGE("https://example.com/logo.png").
- variableIMPORTDATAsource ↗
-
IMPORTDATA: FormulaFunctionIMPORTDATA reads CSV or TSV data from a host-managed cache. Example: =IMPORTDATA("https://example.com/data.csv") returns cached rows.
- variableIMPORTFEEDsource ↗
-
IMPORTFEED: FormulaFunctionIMPORTFEED reads RSS or Atom data from a host-managed cache. Example: =IMPORTFEED("https://example.com/feed.xml") returns cached feed rows.
- variableIMPORTHTMLsource ↗
-
IMPORTHTML: FormulaFunctionIMPORTHTML reads an HTML table or list from a host-managed cache. Example: =IMPORTHTML("https://example.com","table",1) returns cached rows.
- variableIMPORTRANGEsource ↗
-
IMPORTRANGE: FormulaFunctionIMPORTRANGE reads another spreadsheet through a host-managed cache. Example: =IMPORTRANGE("sheet-id","A1:B2") returns cached cells.
- variableIMPORTXMLsource ↗
-
IMPORTXML: FormulaFunctionIMPORTXML reads XPath-selected data from a host-managed cache. Example: =IMPORTXML("https://example.com","//title") returns cached nodes.
- variableINDEXsource ↗
-
INDEX: FormulaFunctionINDEX returns a value or subarray by row and column. Example: =INDEX(A1:C3,2,3).
- variableINDIRECTsource ↗
-
INDIRECT: FormulaFunctionINDIRECT resolves text to a reference. Example: =INDIRECT("A1") returns A1.
- variableINFOsource ↗
-
INFO: FormulaFunctionINFO: Returns host or workbook environment information.
Example=INFO("numfile") - variableinformationFunctionssource ↗
-
informationFunctions: readonly FormulaFunction[] - variableINTsource ↗
-
INT: FormulaFunctionINT: Rounds a number down to the nearest integer.
Example=INT(-0.1) returns -1. - variableINTERCEPTsource ↗
-
INTERCEPT: FormulaFunctionINTERCEPT formula.
Evaluates the Excel-compatible INTERCEPT statistical function.
Example: =INTERCEPT(1,2,3). - variableINTRATEsource ↗
-
INTRATE: FormulaFunctionINTRATE: annualized interest rate of a fully invested security.
- variableISBETWEENsource ↗
-
ISBETWEEN: FormulaFunctionISBETWEEN tests whether a value lies between bounds. Example: =ISBETWEEN(5,1,10) returns TRUE.
- variableISBLANKsource ↗
-
ISBLANK: FormulaFunctionISBLANK: Returns TRUE only for a genuinely empty referenced cell.
Example=ISBLANK(A1) - variableISDATEsource ↗
-
ISDATE: FormulaFunctionISDATE reports whether a value is a valid date or date serial. Example: =ISDATE("2024-02-29") returns TRUE.
- variableISEMAILsource ↗
-
ISEMAIL: FormulaFunctionISEMAIL checks common email-address syntax without contacting a server. Example: =ISEMAIL("a@example.com") returns TRUE.
- variableISERRsource ↗
-
ISERR: FormulaFunctionISERR: Returns TRUE for errors other than #N/A.
Example=ISERR(1/0) - variableISERRORsource ↗
-
ISERROR: FormulaFunctionISERROR: Returns TRUE for any formula error.
Example=ISERROR(1/0) - variableISEVENsource ↗
-
ISEVEN: FormulaFunctionISEVEN: Returns TRUE when a number is even.
Example=ISEVEN(4) - variableISFORMULAsource ↗
-
ISFORMULA: FormulaFunctionISFORMULA: Returns TRUE when a referenced cell contains a formula.
Example=ISFORMULA(A1) - variableISLOGICALsource ↗
-
ISLOGICAL: FormulaFunctionISLOGICAL: Returns TRUE for logical values.
Example=ISLOGICAL(TRUE) - variableISNONTEXTsource ↗
-
ISNONTEXT: FormulaFunctionISNONTEXT: Returns TRUE for non-text values.
Example=ISNONTEXT(42) - variableISNUMBERsource ↗
-
ISNUMBER: FormulaFunctionISNUMBER: Returns TRUE for numeric values.
Example=ISNUMBER(42) - variableISO_CEILINGsource ↗
-
ISO_CEILING: FormulaFunctionISO.CEILING: Rounds a number up to the nearest multiple.
Example=ISO.CEILING(-4.3,2) returns -4. - variableISODDsource ↗
-
ISODD: FormulaFunctionISODD: Returns TRUE when a number is odd.
Example=ISODD(3) - variableISOWEEKNUMsource ↗
-
ISOWEEKNUM: FormulaFunctionISOWEEKNUM: Returns the ISO 8601 week number for a date.
Example: =ISOWEEKNUM("2012-3-9") returns 10. - variableISPMTsource ↗
-
ISPMT: FormulaFunctionISPMT: interest paid during a specific period of an investment.
- variableISREFsource ↗
-
ISREF: FormulaFunctionISREF: Returns TRUE when its argument preserves reference identity.
Example=ISREF(A1) - variableISTEXTsource ↗
-
ISTEXT: FormulaFunctionISTEXT: Returns TRUE for text values.
Example=ISTEXT("text") - variableISURLsource ↗
-
ISURL: FormulaFunctionISURL checks whether text is an absolute URL. Example: =ISURL("https://example.com") returns TRUE.
- variableJISsource ↗
-
JIS: FormulaFunctionConverts half-width text to Japanese full-width text. Example: JIS("ABC カ") returns "ABC カ".
- variableJOINsource ↗
-
JOIN: FormulaFunctionJOIN concatenates values with a delimiter. Example: =JOIN("-",{1,2,3}) returns "1-2-3".
- variableKURTsource ↗
-
KURT: FormulaFunctionKURT formula.
Evaluates the Excel-compatible KURT statistical function.
Example: =KURT(1,2,3). - variableLARGEsource ↗
-
LARGE: FormulaFunctionLARGE formula.
Evaluates the Excel-compatible LARGE statistical function.
Example: =LARGE(1,2,3). - variableLAST_EXCEL_DATE_SERIALsource ↗
-
LAST_EXCEL_DATE_SERIAL: 2958465 - variableLCMsource ↗
-
LCM: FormulaFunctionLCM: Returns the least common multiple of numeric values.
Example=LCM(4,6) returns 12. - variableLEFTsource ↗
-
LEFT: FormulaFunctionReturns characters from the start of text. Example: LEFT("Sale",2) returns "Sa".
- variableLEFTBsource ↗
-
LEFTB: FormulaFunctionReturns leading text limited by a locale-defined DBCS byte count. Example: LEFTB("abc", 2) returns "ab".
- variableLENsource ↗
-
LEN: FormulaFunctionReturns the UTF-16 character count used by Excel compatibility mode. Example: LEN("Excel") returns 5.
- variableLENBsource ↗
-
LENB: FormulaFunctionReturns text length measured in locale-defined DBCS bytes. Example: LENB("abc") returns 3.
- variableLETsource ↗
-
LET: FormulaFunctionLET: Evaluates sequential name/value bindings in a child lexical scope.
Example=LET(rate,2,amount,5,rate*amount) returns 10. - variableLINESTsource ↗
-
LINEST: FormulaFunctionLINEST formula.
Evaluates the Excel-compatible LINEST statistical function.
Example: =LINEST(1,2,3). - variableLNsource ↗
-
LN: FormulaFunctionLN: Returns the natural logarithm of a positive number.
Example=LN(1) returns 0. - variableLOGsource ↗
-
LOG: FormulaFunctionLOG: Returns the logarithm of a number for a specified base.
Example=LOG(8,2) returns 3. - variableLOG10source ↗
-
LOG10: FormulaFunctionLOG10: Returns the base-10 logarithm of a positive number.
Example=LOG10(100) returns 2. - variableLOGESTsource ↗
-
LOGEST: FormulaFunctionLOGEST formula.
Evaluates the Excel-compatible LOGEST statistical function.
Example: =LOGEST(1,2,3). - variablelogicalFunctionssource ↗
-
logicalFunctions: readonly FormulaFunction[] - variableLOGINVsource ↗
-
LOGINV: FormulaFunctionLOGINV compatibility formula: Returns the inverse lognormal distribution.
Example=LOGINV(0.039084,3.5,1.2) - variableLOGNORM_DISTsource ↗
-
LOGNORM_DIST: FormulaFunctionLOGNORM.DIST formula.
Evaluates the Excel-compatible LOGNORM.DIST statistical function.
Example: =LOGNORM.DIST(1,1,TRUE). - variableLOGNORM_INVsource ↗
-
LOGNORM_INV: FormulaFunctionLOGNORM.INV formula.
Evaluates the Excel-compatible LOGNORM.INV statistical function.
Example: =LOGNORM.INV(0.5,1,1). - variableLOGNORMDISTsource ↗
-
LOGNORMDIST: FormulaFunctionLOGNORMDIST compatibility formula: Returns the cumulative lognormal distribution.
Example=LOGNORMDIST(4,3.5,1.2) - variableLOOKUPsource ↗
-
LOOKUP: FormulaFunctionLOOKUP 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: FormulaFunctionConverts letters to lowercase. Example: LOWER("Excel") returns "excel".
- variableLTsource ↗
-
LT: FormulaFunctionLT tests whether the first value is smaller. Example: =LT(2,3) returns TRUE.
- variableLTEsource ↗
-
LTE: FormulaFunctionLTE tests whether the first value is no greater than the second. Example: =LTE(2,2) returns TRUE.
- variableMARGINOFERRORsource ↗
-
MARGINOFERROR: FormulaFunctionMARGINOFERROR formula. Estimates the normal confidence margin for a sample. Example: =MARGINOFERROR(0.95,A1:A10).
- variableMATCHsource ↗
-
MATCH: FormulaFunctionMATCH returns the position of a lookup value. Example: =MATCH("B",{"A";"B"},0) returns 2.
- variableMAXsource ↗
-
MAX: FormulaFunctionMAX formula.
Evaluates the Excel-compatible MAX statistical function.
Example: =MAX(1,2,3). - variableMAXAsource ↗
-
MAXA: FormulaFunctionMAXA formula.
Evaluates the Excel-compatible MAXA statistical function.
Example: =MAXA(1,2,3). - variableMAXIFSsource ↗
-
MAXIFS: FormulaFunctionMAXIFS formula.
Evaluates the Excel-compatible MAXIFS statistical function.
Example: =MAXIFS(1,2,3). - variableMDETERMsource ↗
-
MDETERM: FormulaFunctionMDETERM: Returns the determinant of a square matrix.
Example=MDETERM({1,2;3,4}) returns -2. - variableMDURATIONsource ↗
-
MDURATION: FormulaFunctionMDURATION: modified duration of a coupon security.
- variableMEDIANsource ↗
-
MEDIAN: FormulaFunctionMEDIAN formula.
Evaluates the Excel-compatible MEDIAN statistical function.
Example: =MEDIAN(1,2,3). - variableMIDsource ↗
-
MID: FormulaFunctionReturns a substring by one-based start and length. Example: MID("Fluid Flow",7,4) returns "Flow".
- variableMIDBsource ↗
-
MIDB: FormulaFunctionReturns text from a locale-defined DBCS byte position. Example: MIDB("abc", 2, 1) returns "b".
- variableMINsource ↗
-
MIN: FormulaFunctionMIN formula.
Evaluates the Excel-compatible MIN statistical function.
Example: =MIN(1,2,3). - variableMINAsource ↗
-
MINA: FormulaFunctionMINA formula.
Evaluates the Excel-compatible MINA statistical function.
Example: =MINA(1,2,3). - variableMINIFSsource ↗
-
MINIFS: FormulaFunctionMINIFS formula.
Evaluates the Excel-compatible MINIFS statistical function.
Example: =MINIFS(1,2,3). - variableMINUSsource ↗
-
MINUS: FormulaFunctionMINUS subtracts the second value from the first. Example: =MINUS(5,2) returns 3.
- variableMINUTEsource ↗
-
MINUTE: FormulaFunctionMINUTE: Returns the minute component from a time or date-time value.
Example: =MINUTE("12:45 PM") returns 45. - variableMINVERSEsource ↗
-
MINVERSE: FormulaFunctionMINVERSE: Returns the inverse matrix for a square, nonsingular matrix.
Example=MINVERSE({1,2;3,4}) returns {-2,1;1.5,-0.5}. - variableMMULTsource ↗
-
MMULT: FormulaFunctionMMULT: Returns the matrix product of two compatible arrays.
Example=MMULT({1,2},{3;4}) returns 11. - variableMODsource ↗
-
MOD: FormulaFunctionMOD: Returns the remainder after division.
Example=MOD(-3,2) returns 1. - variableMODEsource ↗
-
MODE: FormulaFunctionMODE compatibility formula: Returns the most frequent numeric value.
Example=MODE(1,1,2,3) - variableMODE_MULTsource ↗
-
MODE_MULT: FormulaFunctionMODE.MULT formula.
Evaluates the Excel-compatible MODE.MULT statistical function.
Example: =MODE.MULT(1,2,3). - variableMODE_SNGLsource ↗
-
MODE_SNGL: FormulaFunctionMODE.SNGL formula.
Evaluates the Excel-compatible MODE.SNGL statistical function.
Example: =MODE.SNGL(1,2,3). - variableMONTHsource ↗
-
MONTH: FormulaFunctionMONTH: Returns the month number for a date serial.
Example: =MONTH("2011-4-15") returns 4. - variableMROUNDsource ↗
-
MROUND: FormulaFunctionMROUND: Rounds a number to the nearest specified multiple.
Example=MROUND(10,3) returns 9. - variableMULTINOMIALsource ↗
-
MULTINOMIAL: FormulaFunctionMULTINOMIAL: Returns the multinomial coefficient for a set of numbers.
Example=MULTINOMIAL(1,1,1) returns 6. - variableMULTIPLYsource ↗
-
MULTIPLY: FormulaFunctionMULTIPLY multiplies two values. Example: =MULTIPLY(3,4) returns 12.
- variableMUNITsource ↗
-
MUNIT: FormulaFunctionMUNIT: Returns an identity matrix of the requested size.
Example=MUNIT(2) returns {1,0;0,1}. - variableNsource ↗
-
N: FormulaFunctionN: Converts numbers, booleans, and other values to a numeric projection.
Example=N(TRUE) - variableNEsource ↗
-
NE: FormulaFunctionNE tests two values for inequality. Example: =NE(2,3) returns TRUE.
- variableNEGBINOM_DISTsource ↗
-
NEGBINOM_DIST: FormulaFunctionNEGBINOM.DIST formula.
Evaluates the Excel-compatible NEGBINOM.DIST statistical function.
Example: =NEGBINOM.DIST(1,1,TRUE). - variableNEGBINOMDISTsource ↗
-
NEGBINOMDIST: FormulaFunctionNEGBINOMDIST compatibility formula: Returns the non-cumulative negative-binomial probability.
Example=NEGBINOMDIST(10,5,0.25) - variableNETWORKDAYSsource ↗
-
NETWORKDAYS: FormulaFunctionNETWORKDAYS: 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: FormulaFunctionNETWORKDAYS.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. - variableNORM_DISTsource ↗
-
NORM_DIST: FormulaFunctionNORM.DIST formula.
Evaluates the Excel-compatible NORM.DIST statistical function.
Example: =NORM.DIST(1,1,TRUE). - variableNORM_INVsource ↗
-
NORM_INV: FormulaFunctionNORM.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: FormulaFunctionNORM.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: FormulaFunctionNORM.S.INV formula.
Evaluates the Excel-compatible NORM.S.INV statistical function.
Example: =NORM.S.INV(0.5,1,1). - variableNORMDISTsource ↗
-
NORMDIST: FormulaFunctionNORMDIST compatibility formula: Returns a normal distribution value.
Example=NORMDIST(42,40,1.5,TRUE) - variableNORMINVsource ↗
-
NORMINV: FormulaFunctionNORMINV formula.
Evaluates the Excel-compatible NORMINV statistical function.
Example: =NORMINV(0.5,1,1). - variableNORMSDISTsource ↗
-
NORMSDIST: FormulaFunctionNORMSDIST compatibility formula: Returns the cumulative standard normal distribution.
Example=NORMSDIST(1.333333) - variableNORMSINVsource ↗
-
NORMSINV: FormulaFunctionNORMSINV compatibility formula: Returns the inverse standard normal distribution.
Example=NORMSINV(0.908789) - variableNOTsource ↗
-
NOT: FormulaFunctionNOT: Returns the inverse of a logical value.
Example=NOT(TRUE) - variableNOWsource ↗
-
NOW: FormulaFunctionNOW: 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. - variableNUMBERSTRINGsource ↗
-
NUMBERSTRING: FormulaFunctionConverts a nonnegative number to one of the supported Chinese numeral styles.
- variableNUMBERVALUEsource ↗
-
NUMBERVALUE: FormulaFunctionParses numeric text with explicit separators. Example: NUMBERVALUE("2.500,27",",",".") returns 2500.27.
- variableODDsource ↗
-
ODD: FormulaFunctionODD: Rounds a number away from zero to the nearest odd integer.
Example=ODD(0) returns 1. - variableODDFPRICEsource ↗
-
ODDFPRICE: FormulaFunctionODDFPRICE: clean price for a security with an odd first coupon period.
- variableODDFYIELDsource ↗
-
ODDFYIELD: FormulaFunctionODDFYIELD: yield for a security with an odd first coupon period.
- variableODDLPRICEsource ↗
-
ODDLPRICE: FormulaFunctionODDLPRICE: clean price for a security with an odd last coupon period.
- variableODDLYIELDsource ↗
-
ODDLYIELD: FormulaFunctionODDLYIELD: yield for a security with an odd last coupon period.
- variableOFFSETsource ↗
-
OFFSET: FormulaFunctionOFFSET returns a shifted reference. Example: =OFFSET(A1,1,1) returns B2.
- variableORsource ↗
-
OR: FormulaFunctionOR: Returns TRUE when any supplied logical value is TRUE.
Example=OR(FALSE,TRUE) - variablePDURATIONsource ↗
-
PDURATION: FormulaFunctionPDURATION: periods required for an investment to reach a target value.
- variablePEARSONsource ↗
-
PEARSON: FormulaFunctionPEARSON formula.
Evaluates the Excel-compatible PEARSON statistical function.
Example: =PEARSON(1,2,3). - variablePERCENTILEsource ↗
-
PERCENTILE: FormulaFunctionPERCENTILE compatibility formula: Returns an inclusive percentile.
Example=PERCENTILE({1,2,3,4},0.5) - variablePERCENTILE_EXCsource ↗
-
PERCENTILE_EXC: FormulaFunctionPERCENTILE.EXC formula.
Evaluates the Excel-compatible PERCENTILE.EXC statistical function.
Example: =PERCENTILE.EXC(1,2,3). - variablePERCENTILE_INCsource ↗
-
PERCENTILE_INC: FormulaFunctionPERCENTILE.INC formula.
Evaluates the Excel-compatible PERCENTILE.INC statistical function.
Example: =PERCENTILE.INC(1,2,3). - variablePERCENTOFsource ↗
-
PERCENTOF: FormulaFunctionPERCENTOF: Returns the proportion represented by one value or array within another.
Example=PERCENTOF({25},{100}) returns 0.25. - variablePERCENTRANKsource ↗
-
PERCENTRANK: FormulaFunctionPERCENTRANK compatibility formula: Returns an inclusive percentage rank.
Example=PERCENTRANK({1,2,3,4},3) - variablePERCENTRANK_EXCsource ↗
-
PERCENTRANK_EXC: FormulaFunctionPERCENTRANK.EXC formula.
Evaluates the Excel-compatible PERCENTRANK.EXC statistical function.
Example: =PERCENTRANK.EXC(1,2,3). - variablePERCENTRANK_INCsource ↗
-
PERCENTRANK_INC: FormulaFunctionPERCENTRANK.INC formula.
Evaluates the Excel-compatible PERCENTRANK.INC statistical function.
Example: =PERCENTRANK.INC(1,2,3). - variablePERMUTsource ↗
-
PERMUT: FormulaFunctionPERMUT formula.
Evaluates the Excel-compatible PERMUT statistical function.
Example: =PERMUT(1,2,3). - variablePERMUTATIONAsource ↗
-
PERMUTATIONA: FormulaFunctionPERMUTATIONA formula.
Evaluates the Excel-compatible PERMUTATIONA statistical function.
Example: =PERMUTATIONA(1,2,3). - variablePHIsource ↗
-
PHI: FormulaFunctionPHI formula.
Evaluates the Excel-compatible PHI statistical function.
Example: =PHI(1,2,3). - variablePHONETICsource ↗
-
PHONETIC: FormulaFunctionReturns stored phonetic metadata for a cell. Example: PHONETIC(A1) returns its furigana when available.
- variablePIsource ↗
-
PI: FormulaFunctionPI: Returns the mathematical constant pi.
Example=PI()*0 returns 0. - variablePIVOTBYsource ↗
-
PIVOTBY: FormulaFunctionPIVOTBY creates a two-key summary by sum. Example: =PIVOTBY(A2:A5,B2:B5,C2:C5).
- variablePOISSONsource ↗
-
POISSON: FormulaFunctionPOISSON compatibility formula: Returns a Poisson distribution value.
Example=POISSON(2,5,TRUE) - variablePOISSON_DISTsource ↗
-
POISSON_DIST: FormulaFunctionPOISSON.DIST formula.
Evaluates the Excel-compatible POISSON.DIST statistical function.
Example: =POISSON.DIST(1,1,TRUE). - variablePOWsource ↗
-
POW: FormulaFunctionPOW raises a base to an exponent. Example: =POW(2,3) returns 8.
- variablePOWERsource ↗
-
POWER: FormulaFunctionPOWER: Raises a number to a specified power.
Example=POWER(2,0) returns 1. - variablePRICEMATsource ↗
-
PRICEMAT: FormulaFunctionPRICEMAT: price of a security paying interest at maturity.
- variablePROBsource ↗
-
PROB: FormulaFunctionPROB formula.
Evaluates the Excel-compatible PROB statistical function.
Example: =PROB(1,2,3). - variablePRODUCTsource ↗
-
PRODUCT: FormulaFunctionPRODUCT: Multiplies all numeric values in the supplied arguments.
Example=PRODUCT(1,2,3) returns 6. - variablePROPERsource ↗
-
PROPER: FormulaFunctionCapitalizes each word and lowercases remaining letters. Example: PROPER("this is A TITLE") returns "This Is A Title".
- variableQUARTILEsource ↗
-
QUARTILE: FormulaFunctionQUARTILE compatibility formula: Returns an inclusive quartile.
Example=QUARTILE({1,2,3,4,5},1) - variableQUARTILE_EXCsource ↗
-
QUARTILE_EXC: FormulaFunctionQUARTILE.EXC formula.
Evaluates the Excel-compatible QUARTILE.EXC statistical function.
Example: =QUARTILE.EXC(1,2,3). - variableQUARTILE_INCsource ↗
-
QUARTILE_INC: FormulaFunctionQUARTILE.INC formula.
Evaluates the Excel-compatible QUARTILE.INC statistical function.
Example: =QUARTILE.INC(1,2,3). - variableQUERYsource ↗
-
QUERY: FormulaFunctionQUERY 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: FormulaFunctionQUOTIENT: Returns the integer portion of a division.
Example=QUOTIENT(-10,3) returns -3. - variableRADIANSsource ↗
-
RADIANS: FormulaFunctionRADIANS: Converts an angle from degrees to radians.
Example=RADIANS(180) returns pi. - variableRANDsource ↗
-
RAND: FormulaFunctionRAND: 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: FormulaFunctionRANDARRAY: 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: FormulaFunctionRANDBETWEEN: Returns a random integer between two inclusive bounds.
Example=RANDBETWEEN(7,7) returns 7. - variableRANKsource ↗
-
RANK: FormulaFunctionRANK compatibility formula: Returns the rank of a number in a list.
Example=RANK(3,{1,2,3,4},0) - variableRANK_AVGsource ↗
-
RANK_AVG: FormulaFunctionRANK.AVG formula.
Evaluates the Excel-compatible RANK.AVG statistical function.
Example: =RANK.AVG(1,2,3). - variableRANK_EQsource ↗
-
RANK_EQ: FormulaFunctionRANK.EQ formula.
Evaluates the Excel-compatible RANK.EQ statistical function.
Example: =RANK.EQ(1,2,3). - variableRECEIVEDsource ↗
-
RECEIVED: FormulaFunctionRECEIVED: amount received at maturity for a discounted security.
- variableREGEXEXTRACTsource ↗
-
REGEXEXTRACT: FormulaFunctionExtracts regex matches or capture groups. Example: REGEXEXTRACT("A12","[0-9]+") returns "12".
- variableREGEXMATCHsource ↗
-
REGEXMATCH: FormulaFunctionREGEXMATCH tests whether text matches a regular expression. Example: =REGEXMATCH("A12","[0-9]+") returns TRUE.
- variableREGEXREPLACEsource ↗
-
REGEXREPLACE: FormulaFunctionReplaces all or one regex match. Example: REGEXREPLACE("A12","[0-9]+","#") returns "A#".
- variableREGEXTESTsource ↗
-
REGEXTEST: FormulaFunctionTests whether text matches a regular expression. Example: REGEXTEST("A12","[0-9]+") returns TRUE.
- variableREGISTER_IDsource ↗
-
REGISTER_ID: FormulaFunctionResolves a host-authorized add-in procedure to a stable numeric registration id.
Example:=REGISTER.ID("example","entry","JJ")returns the host's handle forentry. - variableREPLACEsource ↗
-
REPLACE: FormulaFunctionReplaces characters at a one-based position. Example: REPLACE("abc",2,1,"X") returns "aXc".
- variableREPLACEBsource ↗
-
REPLACEB: FormulaFunctionReplaces text at a locale-defined DBCS byte position. Example: REPLACEB("abc", 2, 1, "x") returns "axc".
- variableREPTsource ↗
-
REPT: FormulaFunctionRepeats text a specified number of times. Example: REPT("*-",3) returns "*-*-*-".
- variableRIGHTsource ↗
-
RIGHT: FormulaFunctionReturns characters from the end of text. Example: RIGHT("Sale",2) returns "le".
- variableRIGHTBsource ↗
-
RIGHTB: FormulaFunctionReturns trailing text limited by a locale-defined DBCS byte count. Example: RIGHTB("abc", 2) returns "bc".
- variableROMANsource ↗
-
ROMAN: FormulaFunctionROMAN: Converts an Arabic number to Roman numeral text.
Example=ROMAN(2024) returns "MMXXIV". - variableROUNDsource ↗
-
ROUND: FormulaFunctionROUND: Rounds a number to a specified number of digits.
Example=ROUND(-1.475,2) returns -1.48. - variableROUNDDOWNsource ↗
-
ROUNDDOWN: FormulaFunctionROUNDDOWN: Rounds a number toward zero to a specified number of digits.
Example=ROUNDDOWN(-3.9,0) returns -3. - variableROUNDUPsource ↗
-
ROUNDUP: FormulaFunctionROUNDUP: Rounds a number away from zero to a specified number of digits.
Example=ROUNDUP(-3.1,0) returns -4. - variableROWsource ↗
-
ROW: FormulaFunctionROW returns a reference's first row number. Example: =ROW(C5) returns 5.
- variableROWSsource ↗
-
ROWS: FormulaFunctionROWS returns the number of rows in a reference. Example: =ROWS(A1:C2) returns 2.
- variableRSQsource ↗
-
RSQ: FormulaFunctionRSQ formula.
Evaluates the Excel-compatible RSQ statistical function.
Example: =RSQ(1,2,3). - variableRTDsource ↗
-
RTD: FormulaFunctionRTD reads a host-managed real-time data cache. Example: =RTD("provider",,"price","MSFT").
- variableSEARCHsource ↗
-
SEARCH: FormulaFunctionFinds text case-insensitively with Excel wildcards. Example: SEARCH("b*","abc") returns 2.
- variableSEARCHBsource ↗
-
SEARCHB: FormulaFunctionFinds case-insensitive text using locale-defined DBCS byte positions. Example: SEARCHB("B", "abc") returns 2.
- variableSECsource ↗
-
SEC: FormulaFunctionSEC: Returns the secant of an angle in radians.
Example=SEC(0) returns 1. - variableSECHsource ↗
-
SECH: FormulaFunctionSECH: Returns the hyperbolic secant of a number.
Example=SECH(0) returns 1. - variableSECONDsource ↗
-
SECOND: FormulaFunctionSECOND: Returns the second component from a time or date-time value.
Example: =SECOND("4:48:18 PM") returns 18. - variableSEQUENCEsource ↗
-
SEQUENCE: FormulaFunctionSEQUENCE: 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: FormulaFunctionSERIESSUM: Evaluates a power series from an initial value, step, and coefficients.
Example=SERIESSUM(2,0,1,{1,2,3}) returns 17. - variableSHEETsource ↗
-
SHEET: FormulaFunctionSHEET: Returns the one-based index of a sheet.
Example=SHEET() - variableSHEETSsource ↗
-
SHEETS: FormulaFunctionSHEETS: Returns the number of sheets in the workbook.
Example=SHEETS() - variableSIGNsource ↗
-
SIGN: FormulaFunctionSIGN: Returns -1, 0, or 1 according to the sign of a number.
Example=SIGN(0) returns 0. - variableSINsource ↗
-
SIN: FormulaFunctionSIN: Returns the sine of an angle in radians.
Example=SIN(0) returns 0. - variableSingleByteFormulaTextLocalesource ↗
-
SingleByteFormulaTextLocale: FormulaTextLocaleExcel-compatible text locale where every Unicode code point counts as one byte.
- variableSINHsource ↗
-
SINH: FormulaFunctionSINH: Returns the hyperbolic sine of a number.
Example=SINH(0) returns 0. - variableSKEWsource ↗
-
SKEW: FormulaFunctionSKEW formula.
Evaluates the Excel-compatible SKEW statistical function.
Example: =SKEW(1,2,3). - variableSKEW_Psource ↗
-
SKEW_P: FormulaFunctionSKEW.P formula.
Evaluates the Excel-compatible SKEW.P statistical function.
Example: =SKEW.P(1,2,3). - variableSLOPEsource ↗
-
SLOPE: FormulaFunctionSLOPE formula.
Evaluates the Excel-compatible SLOPE statistical function.
Example: =SLOPE(1,2,3). - variableSMALLsource ↗
-
SMALL: FormulaFunctionSMALL formula.
Evaluates the Excel-compatible SMALL statistical function.
Example: =SMALL(1,2,3). - variableSORTsource ↗
-
SORT: FormulaFunctionSORT orders rows by one column. Example: =SORT(A1:B3,1,1).
- variableSORTBYsource ↗
-
SORTBY: FormulaFunctionSORTBY orders rows using one or more key arrays. Example: =SORTBY(A1:B3,B1:B3,1).
- variableSORTNsource ↗
-
SORTN: FormulaFunctionSORTN returns the first ranked rows after sorting. Example: =SORTN({3;1;2},2) returns {1;2}.
- variableSPARKLINEsource ↗
-
SPARKLINE: FormulaFunctionSPARKLINE renders numeric data as a compact text sparkline. Example: =SPARKLINE({1,3,2}) returns a three-glyph trend.
- variableSPLITsource ↗
-
SPLIT: FormulaFunctionSPLIT divides text into a spilling row. Example: =SPLIT("a,b,c",",") returns {"a","b","c"}.
- variableSQRTsource ↗
-
SQRT: FormulaFunctionSQRT: Returns the positive square root of a number.
Example=SQRT(0) returns 0. - variableSQRTPIsource ↗
-
SQRTPI: FormulaFunctionSQRTPI: Returns the square root of a number multiplied by pi.
Example=SQRTPI(0) returns 0. - variableSTANDARDIZEsource ↗
-
STANDARDIZE: FormulaFunctionSTANDARDIZE formula.
Evaluates the Excel-compatible STANDARDIZE statistical function.
Example: =STANDARDIZE(1,2,3). - variableSTDEVsource ↗
-
STDEV: FormulaFunctionSTDEV compatibility formula: Returns the sample standard deviation.
Example=STDEV(1,2,3) - variableSTDEV_Psource ↗
-
STDEV_P: FormulaFunctionSTDEV.P formula.
Evaluates the Excel-compatible STDEV.P statistical function.
Example: =STDEV.P(1,2,3). - variableSTDEV_Ssource ↗
-
STDEV_S: FormulaFunctionSTDEV.S formula.
Evaluates the Excel-compatible STDEV.S statistical function.
Example: =STDEV.S(1,2,3). - variableSTDEVAsource ↗
-
STDEVA: FormulaFunctionSTDEVA formula.
Evaluates the Excel-compatible STDEVA statistical function.
Example: =STDEVA(1,2,3). - variableSTDEVPsource ↗
-
STDEVP: FormulaFunctionSTDEVP compatibility formula: Returns the population standard deviation.
Example=STDEVP(1,2,3) - variableSTDEVPAsource ↗
-
STDEVPA: FormulaFunctionSTDEVPA formula.
Evaluates the Excel-compatible STDEVPA statistical function.
Example: =STDEVPA(1,2,3). - variableSTEYXsource ↗
-
STEYX: FormulaFunctionSTEYX formula.
Evaluates the Excel-compatible STEYX statistical function.
Example: =STEYX(1,2,3). - variableSTOCKHISTORYsource ↗
-
STOCKHISTORY: FormulaFunctionSTOCKHISTORY: Returns historical market data from a host-managed synchronous cache.
Example=STOCKHISTORY("MSFT",DATE(2024,1,1)) - variableSUBSTITUTEsource ↗
-
SUBSTITUTE: FormulaFunctionReplaces matching text, optionally only one occurrence. Example: SUBSTITUTE("a-b","-","/") returns "a/b".
- variableSUBTOTALsource ↗
-
SUBTOTAL: FormulaFunctionSUBTOTAL: Calculates a subtotal for a range using a selected aggregation code.
Example=SUBTOTAL(9,A1:A3) returns the sum of A1:A3. - variableSUMIFsource ↗
-
SUMIF: FormulaFunctionSUMIF: Adds values that satisfy one condition.
Example=SUMIF({1,2,3},">1",{10,20,30}) returns 50. - variableSUMIFSsource ↗
-
SUMIFS: FormulaFunctionSums values whose corresponding ranges satisfy every criterion.
- variableSUMPRODUCTsource ↗
-
SUMPRODUCT: FormulaFunctionSUMPRODUCT: Multiplies corresponding array elements and adds the products.
Example=SUMPRODUCT({2,3,4},{10,20,30}) returns 200. - variableSUMSQsource ↗
-
SUMSQ: FormulaFunctionSUMSQ: Returns the sum of the squares of numeric values.
Example=SUMSQ(0,3) returns 9. - variableSUMX2MY2source ↗
-
SUMX2MY2: FormulaFunctionSUMX2MY2: Returns the sum of the differences between corresponding squares.
Example=SUMX2MY2({1,2},{3,4}) returns -20. - variableSUMX2PY2source ↗
-
SUMX2PY2: FormulaFunctionSUMX2PY2: Returns the sum of the sums of corresponding squares.
Example=SUMX2PY2({1,2},{3,4}) returns 30. - variableSUMXMY2source ↗
-
SUMXMY2: FormulaFunctionSUMXMY2: Returns the sum of the squares of corresponding differences.
Example=SUMXMY2({1,2},{3,4}) returns 8. - variableSWITCHsource ↗
-
SWITCH: FormulaFunctionSWITCH: Matches one expression and returns its paired result.
Example=SWITCH(2,1,"one",2,"two","other") - variableTsource ↗
-
T: FormulaFunctionReturns text values and an empty string for non-text values. Example: T("Excel") returns "Excel".
- variableT_DISTsource ↗
-
T_DIST: FormulaFunctionT.DIST formula.
Evaluates the Excel-compatible T.DIST statistical function.
Example: =T.DIST(1,1,TRUE). - variableT_DIST_2Tsource ↗
-
T_DIST_2T: FormulaFunctionT.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: FormulaFunctionT.DIST.RT formula.
Evaluates the Excel-compatible T.DIST.RT statistical function.
Example: =T.DIST.RT(1,1,TRUE). - variableT_INVsource ↗
-
T_INV: FormulaFunctionT.INV formula.
Evaluates the Excel-compatible T.INV statistical function.
Example: =T.INV(0.5,1,1). - variableT_INV_2Tsource ↗
-
T_INV_2T: FormulaFunctionT.INV.2T formula.
Evaluates the Excel-compatible T.INV.2T statistical function.
Example: =T.INV.2T(0.5,1,1). - variableT_TESTsource ↗
-
T_TEST: FormulaFunctionT.TEST formula.
Evaluates the Excel-compatible T.TEST statistical function.
Example: =T.TEST(1,2,3). - variableTAKEsource ↗
-
TAKE: FormulaFunctionTAKE keeps rows and columns. Example: =TAKE(A1:C3,2) keeps the first two rows.
- variableTANsource ↗
-
TAN: FormulaFunctionTAN: Returns the tangent of an angle in radians.
Example=TAN(0) returns 0. - variableTANHsource ↗
-
TANH: FormulaFunctionTANH: Returns the hyperbolic tangent of a number.
Example=TANH(0) returns 0. - variableTBILLEQsource ↗
-
TBILLEQ: FormulaFunctionTBILLEQ: bond-equivalent yield for a Treasury bill.
- variableTBILLPRICEsource ↗
-
TBILLPRICE: FormulaFunctionTBILLPRICE: price per 100 for a Treasury bill.
- variableTBILLYIELDsource ↗
-
TBILLYIELD: FormulaFunctionTBILLYIELD: discount yield for a Treasury bill price.
- variableTDISTsource ↗
-
TDIST: FormulaFunctionTDIST compatibility formula: Returns a one- or two-tailed Student t probability.
Example=TDIST(1.96,60,2) - variableTEXTsource ↗
-
TEXT: FormulaFunctionFormats a value with an Excel format code. Example: TEXT(1234.5,"#,##0.00") returns "1,234.50".
- variableTEXTAFTERsource ↗
-
TEXTAFTER: FormulaFunctionReturns text after a delimiter occurrence. Example: TEXTAFTER("red-blue","-") returns "blue".
- variableTEXTBEFOREsource ↗
-
TEXTBEFORE: FormulaFunctionReturns text before a delimiter occurrence. Example: TEXTBEFORE("red-blue","-") returns "red".
- variabletextFunctionssource ↗
-
textFunctions: readonly FormulaFunction[] - variableTEXTJOINsource ↗
-
TEXTJOIN: FormulaFunctionJoins values with a delimiter and optional empty-value filtering. Example: TEXTJOIN(",",TRUE,"A","B") returns "A,B".
- variableTEXTSPLITsource ↗
-
TEXTSPLIT: FormulaFunctionSplits text into a spill matrix. Example: TEXTSPLIT("A,B",",") returns {"A","B"}.
- variableTIMEsource ↗
-
TIME: FormulaFunctionTIME: Converts hour, minute, and second parts into a fraction of one day.
Example: =TIME(12,0,0) returns 0.5. - variableTIMEVALUEsource ↗
-
TIMEVALUE: FormulaFunctionTIMEVALUE: Converts time text into the fractional part of one day.
Example: =TIMEVALUE("2:24 AM") returns 0.1. - variableTINVsource ↗
-
TINV: FormulaFunctionTINV compatibility formula: Returns the inverse two-tailed Student t value.
Example=TINV(0.05,10) - variableTO_DATEsource ↗
-
TO_DATE: FormulaFunctionTO_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: FormulaFunctionTO_DOLLARS converts a value to a dollar amount. Example: =TO_DOLLARS(12.5) returns 12.5.
- variableTO_PERCENTsource ↗
-
TO_PERCENT: FormulaFunctionTO_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: FormulaFunctionTO_PURE_NUMBER strips display formatting and returns a number. Example: =TO_PURE_NUMBER("42") returns 42.
- variableTO_TEXTsource ↗
-
TO_TEXT: FormulaFunctionTO_TEXT converts a scalar to text. Example: =TO_TEXT(42) returns "42".
- variableTOCOLsource ↗
-
TOCOL: FormulaFunctionTOCOL flattens an array into one column. Example: =TOCOL(A1:B2).
- variableTODAYsource ↗
-
TODAY: FormulaFunctionTODAY: 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: FormulaFunctionTOROW flattens an array into one row. Example: =TOROW(A1:B2).
- variableTRANSLATEsource ↗
-
TRANSLATE: FormulaFunctionReads a previously loaded translation from the host cache. Example: TRANSLATE("hello", "en", "es") reads the cached result.
- variableTRANSPOSEsource ↗
-
TRANSPOSE: FormulaFunctionTRANSPOSE swaps array rows and columns. Example: =TRANSPOSE(A1:B2).
- variableTRENDsource ↗
-
TREND: FormulaFunctionTREND formula.
Evaluates the Excel-compatible TREND statistical function.
Example: =TREND(1,2,3). - variableTRIMsource ↗
-
TRIM: FormulaFunctionRemoves outer ASCII spaces and collapses internal runs. Example: TRIM(" a b ") returns "a b".
- variableTRIMMEANsource ↗
-
TRIMMEAN: FormulaFunctionTRIMMEAN formula.
Evaluates the Excel-compatible TRIMMEAN statistical function.
Example: =TRIMMEAN(1,2,3). - variableTRIMRANGEsource ↗
-
TRIMRANGE: FormulaFunctionTRIMRANGE removes fully blank outer rows and columns. Example: =TRIMRANGE(A1:D5).
- variableTRUNCsource ↗
-
TRUNC: FormulaFunctionTRUNC: Truncates a number toward zero to a specified number of digits.
Example=TRUNC(-3.9) returns -3. - variableTTESTsource ↗
-
TTEST: FormulaFunctionTTEST compatibility formula: Returns a Student t-test probability.
Example=TTEST({1,2,3},{1,2,4},2,1) - variableTYPEsource ↗
-
TYPE: FormulaFunctionTYPE: Returns the numeric type code for a formula value.
Example=TYPE(42) - variableUMINUSsource ↗
-
UMINUS: FormulaFunctionUMINUS reverses a number's sign. Example: =UMINUS(3) returns -3.
- variableUNARY_PERCENTsource ↗
-
UNARY_PERCENT: FormulaFunctionUNARY_PERCENT converts a percentage value to its decimal. Example: =UNARY_PERCENT(25) returns 0.25.
- variableUNICHARsource ↗
-
UNICHAR: FormulaFunctionReturns the Unicode character for a code point. Example: UNICHAR(9733) returns "★".
- variableUNICODEsource ↗
-
UNICODE: FormulaFunctionReturns the Unicode code point of the first character. Example: UNICODE("★") returns 9733.
- variableUNIQUEsource ↗
-
UNIQUE: FormulaFunctionUNIQUE returns distinct rows. Example: =UNIQUE({1;1;2}) returns 1 and 2.
- variableUPLUSsource ↗
-
UPLUS: FormulaFunctionUPLUS returns the numeric value unchanged. Example: =UPLUS("3") returns 3.
- variableUPPERsource ↗
-
UPPER: FormulaFunctionConverts letters to uppercase. Example: UPPER("Excel") returns "EXCEL".
- variableVALUEsource ↗
-
VALUE: FormulaFunctionConverts common numeric text to a number. Example: VALUE("$1,234.50") returns 1234.5.
- variableVALUETOTEXTsource ↗
-
VALUETOTEXT: FormulaFunctionConverts one value to concise or strict text. Example: VALUETOTEXT("A",1) returns "\"A\"".
- variableVARsource ↗
-
VAR: FormulaFunctionVAR formula.
Estimates sample variance for compatibility with legacy Excel workbooks.
Example: =VAR(1,2,3). - variableVAR_Psource ↗
-
VAR_P: FormulaFunctionVAR.P formula.
Evaluates the Excel-compatible VAR.P statistical function.
Example: =VAR.P(1,2,3). - variableVAR_Ssource ↗
-
VAR_S: FormulaFunctionVAR.S formula.
Evaluates the Excel-compatible VAR.S statistical function.
Example: =VAR.S(1,2,3). - variableVARAsource ↗
-
VARA: FormulaFunctionVARA formula.
Evaluates the Excel-compatible VARA statistical function.
Example: =VARA(1,2,3). - variableVARPsource ↗
-
VARP: FormulaFunctionVARP compatibility formula: Returns the population variance.
Example=VARP(1,2,3) - variableVARPAsource ↗
-
VARPA: FormulaFunctionVARPA formula.
Evaluates the Excel-compatible VARPA statistical function.
Example: =VARPA(1,2,3). - variableVLOOKUPsource ↗
-
VLOOKUP: FormulaFunctionVLOOKUP: 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: FormulaFunctionVSTACK joins arrays vertically. Example: =VSTACK({1,2},{3,4}).
- variablewebFunctionssource ↗
-
webFunctions: readonly FormulaFunction[] - variableWEBSERVICEsource ↗
-
WEBSERVICE: FormulaFunctionReads response text from a host-loaded HTTP cache. Example: WEBSERVICE("https://example.com/data.xml") returns cached XML.
- variableWEEKDAYsource ↗
-
WEEKDAY: FormulaFunctionWEEKDAY: Returns the day of week using the requested Excel return type.
Example: =WEEKDAY("2008-2-14",2) returns 4. - variableWEEKNUMsource ↗
-
WEEKNUM: FormulaFunctionWEEKNUM: Returns the week number of a date using Excel week-numbering rules.
Example: =WEEKNUM("2012-3-9",2) returns 11. - variableWEIBULLsource ↗
-
WEIBULL: FormulaFunctionWEIBULL compatibility formula: Returns a Weibull distribution value.
Example=WEIBULL(105,20,100,TRUE) - variableWEIBULL_DISTsource ↗
-
WEIBULL_DIST: FormulaFunctionWEIBULL.DIST formula.
Evaluates the Excel-compatible WEIBULL.DIST statistical function.
Example: =WEIBULL.DIST(1,1,TRUE). - variableWORKDAYsource ↗
-
WORKDAY: FormulaFunctionWORKDAY: 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: FormulaFunctionWORKDAY.INTL: Returns a workday-offset date serial with custom weekend rules.
Example: =WORKDAY.INTL(DATE(2012,1,1),30,17) returns 40944. - variableWRAPCOLSsource ↗
-
WRAPCOLS: FormulaFunctionWRAPCOLS wraps a vector by columns. Example: =WRAPCOLS({1,2,3},2,0).
- variableWRAPROWSsource ↗
-
WRAPROWS: FormulaFunctionWRAPROWS wraps a vector by rows. Example: =WRAPROWS({1,2,3},2,0).
- variableXIRRsource ↗
-
XIRR: FormulaFunctionXIRR: internal rate of return for irregular cash-flow dates.
- variableXLOOKUPsource ↗
-
XLOOKUP: FormulaFunctionXLOOKUP searches a vector and returns a corresponding value. Example: =XLOOKUP(2,{1,2},{"A","B"}).
- variableXMATCHsource ↗
-
XMATCH: FormulaFunctionXMATCH returns a position with modern MATCH modes. Example: =XMATCH("B",{"A";"B"}).
- variableXORsource ↗
-
XOR: FormulaFunctionXOR: Returns TRUE when an odd number of values are TRUE.
Example=XOR(TRUE,FALSE) - variableYEARsource ↗
-
YEAR: FormulaFunctionYEAR: Returns the year for a date serial.
Example: =YEAR("7/5/2025") returns 2025. - variableYEARFRACsource ↗
-
YEARFRAC: FormulaFunctionYEARFRAC: Returns the fraction of a year represented by two dates.
Example: =YEARFRAC("1/1/2012","7/30/2012",1) returns 0.5765027322404371. - variableYIELDMATsource ↗
-
YIELDMAT: FormulaFunctionYIELDMAT: yield of a security paying interest at maturity.
- variableZ_TESTsource ↗
-
Z_TEST: FormulaFunctionZ.TEST formula.
Evaluates the Excel-compatible Z.TEST statistical function.
Example: =Z.TEST(1,2,3). - variableZTESTsource ↗
-
ZTEST: FormulaFunctionZTEST 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): BondResultComputes Macaulay duration from a clean bond price.
settlement: numbermaturity: numberannualRate: numberannualYield: numberredemption: numberfrequencyValue: numberbasisValue: number
- functionbondPricesource ↗
-
bondPrice(settlement: number, maturity: number, annualRate: number, annualYield: number, redemption?: number, frequencyValue?: number, basisValue?: number): BondResultPrices a coupon bond per 100 face value using a clean price.
settlement: numbermaturity: numberannualRate: numberannualYield: numberredemption: numberfrequencyValue: numberbasisValue: number
- functioncellKeysource ↗
-
cellKey(row: number, col: number): numberEncodes zero-based coordinates as one numeric cell key.
row: numbercol: number
- functioncollectFinancialCashFlowssource ↗
-
collectFinancialCashFlows(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaErrorCollects a scalar, array, or range argument into finite numeric cash flows.
arg: FormulaArg | undefinedcontext: EvalContextacceptFormattedText: boolean
- functioncollectFinancialDateSerialssource ↗
-
collectFinancialDateSerials(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaErrorDate arguments use whole serial days and reject boolean values.
arg: FormulaArg | undefinedcontext: EvalContextacceptFormattedText: boolean
- functioncollectFinancialScheduleRatessource ↗
-
collectFinancialScheduleRates(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaErrorMulti-cell schedules reject stored text rates even when the text is numeric.
arg: FormulaArg | undefinedcontext: EvalContext
- functioncollectNpvCashFlowssource ↗
-
collectNpvCashFlows(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaErrorNPV ignores nonnumeric cells in references without consuming a period.
arg: FormulaArg | undefinedcontext: EvalContext
- functioncouponAmountsource ↗
-
couponAmount(faceValue: number, annualRate: number, frequency: 1 | 2 | 4): number | FormulaErrorReturns the coupon amount for a face value and annual coupon rate.
faceValue: numberannualRate: numberfrequency: 1 | 2 | 4
- functioncreateDefaultFormulaLocaleProvidersource ↗
-
createDefaultFormulaLocaleProvider(): IFormulaLocaleProviderCreates the default formula locale provider used when no i18n plugin is installed.
- functioncreateExcelDateTimeLocalesource ↗
-
createExcelDateTimeLocale(input: BuiltInExcelDateTimeLocaleId | { locale: string; symbols?: FormulaDateTimeSymbols }): FormulaDateTimeLocaleCreates 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; … }): FormulaTextLocaleCreates 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): numbercontext: EvalContext
- functiondecliningBalanceDepreciationsource ↗
-
decliningBalanceDepreciation(cost: number, salvage: number, life: number, period: number, factor?: number): DepreciationResultDeclining-balance depreciation for a one-based period.
cost: numbersalvage: numberlife: numberperiod: numberfactor: number
- functionexcelDatePartsFromSerialsource ↗
-
excelDatePartsFromSerial(serial: number): ExcelDateParts | nullserial: number
- functionexcelSerialFromDatePartssource ↗
-
excelSerialFromDateParts(year: number, month: number, day: number): number | nullyear: numbermonth: numberday: number
- functionexcelSerialToUnixMillissource ↗
-
excelSerialToUnixMillis(serial: number): numberserial: number
- functionexcelTimeFractionsource ↗
-
excelTimeFraction(hour: number, minute: number, second: number): number | nullhour: numberminute: numbersecond: number
- functionfinancialDayCountDayssource ↗
-
financialDayCountDays(start: number, end: number, basis: FinancialDayCountBasis): DayCountResultReturns the number of days between two Excel serial dates for a basis.
start: numberend: numberbasis: FinancialDayCountBasis
- functionfinancialDivisionErrorsource ↗
-
financialDivisionError(): FormulaErrorReturns a standard #DIV/0! result for an undefined periodic payment.
- functionfinancialNumberErrorsource ↗
-
financialNumberError(): FormulaErrorReturns a standard #NUM! result for an invalid basis or date interval.
- functionfinancialValueErrorsource ↗
-
financialValueError(): FormulaErrorReturns a standard #VALUE! result for malformed financial inputs.
- functionfinancialYearFractionsource ↗
-
financialYearFraction(start: number, end: number, basis: FinancialDayCountBasis): DayCountResultReturns the Excel year fraction for a financial basis.
start: numberend: numberbasis: FinancialDayCountBasis
- functionforEachFinancialCashFlowsource ↗
-
forEachFinancialCashFlow(arg: FormulaArg, context: EvalContext, callback: (value: number, index: number): boolean | void): FormulaError | undefinedStreams numeric values from a range without allocating an intermediate matrix.
arg: FormulaArgcontext: EvalContextcallback: (value: number, index: number): boolean | void
- functionformatBahtTextsource ↗
-
formatBahtText(value: number): string | undefinedConverts a finite number to Excel-style Thai baht and satang text.
value: number
- functionformatExcelDateTimesource ↗
-
formatExcelDateTime(serial: number, pattern?: string): stringserial: numberpattern: 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): FinancialNumberResultComputes the future value of a periodic annuity.
rate: numberperiods: numberpayment: numberpresentValue: numbertype: number
- functionisFinancialMonthEndsource ↗
-
isFinancialMonthEnd(serial: number): booleanReturns whether an Excel serial date is the last calendar day of its month.
serial: number
- functionisTextualFinancialReferencesource ↗
-
isTextualFinancialReference(arg: FormulaArg | undefined, context: EvalContext): booleanarg: FormulaArg | undefinedcontext: EvalContext
- functionnormalizeCouponFrequencysource ↗
-
normalizeCouponFrequency(value: number): 1 | 2 | 4 | FormulaErrorValidates a bond frequency used by Excel financial functions.
value: number
- functionnormalizeFinancialBasissource ↗
-
normalizeFinancialBasis(value: number | undefined): FormulaError | FinancialDayCountBasisChecks and normalizes the five Excel day-count basis values.
value: number | undefined
- functionnumericDateTextsource ↗
-
numericDateText(value: FormulaValue, context: EvalContext): number | undefinedvalue: FormulaValuecontext: EvalContext
- functionoddLastRegularPeriodDayssource ↗
-
oddLastRegularPeriodDays(lastCoupon: number, frequency: 1 | 2 | 4, basis: FinancialDayCountBasis): number | FormulaErrorReturns the basis-dependent length of a regular period after the final coupon date.
lastCoupon: numberfrequency: 1 | 2 | 4basis: FinancialDayCountBasis
- functionparseCellRefsource ↗
-
parseCellRef(ref: string): ParsedCellRefParses an A1-notation cell reference.
ref: string
- functionparseExcelDatesource ↗
-
parseExcelDate(value: unknown, options?: ExcelDateTimeParseOptions): number | nullvalue: unknownoptions: ExcelDateTimeParseOptions
- functionparseExcelDateTimesource ↗
-
parseExcelDateTime(value: unknown, options?: ExcelDateTimeParseOptions): ParsedExcelDateTime | nullvalue: unknownoptions: ExcelDateTimeParseOptions
- functionparseExcelTimesource ↗
-
parseExcelTime(value: unknown, options?: ExcelDateTimeParseOptions): number | nullvalue: unknownoptions: ExcelDateTimeParseOptions
- functionpaymentsource ↗
-
payment(rate: number, periods: number, presentValue: number, future?: number, type?: number): FinancialNumberResultComputes a periodic payment for an annuity.
rate: numberperiods: numberpresentValue: numberfuture: numbertype: number
- functionperiodicNpvsource ↗
-
periodicNpv(rate: number, cashFlows: readonly number[]): FinancialNumberResultComputes periodic NPV. The first value is discounted by one period.
rate: numbercashFlows: readonly number[]
- functionreadFinancialNumbersource ↗
-
readFinancialNumber(arg: FormulaArg | undefined, context: EvalContext, options?: { acceptLocalizedCurrency?: boolean }): FinancialNumberResultReads a scalar financial input, preserving formula errors.
arg: FormulaArg | undefinedcontext: EvalContextoptions: { acceptLocalizedCurrency?: boolean }
- functionresolveCouponSchedulesource ↗
-
resolveCouponSchedule(settlement: number, maturity: number, frequencyValue: number, basisValue?: number): FormulaError | CouponScheduleResolves the previous/next coupon dates and basis-dependent day counts.
settlement: numbermaturity: numberfrequencyValue: numberbasisValue: number
- functionresolveOddFirstCouponSchedulesource ↗
-
resolveOddFirstCouponSchedule(settlement: number, maturity: number, firstCoupon: number, frequencyValue: number, basisValue?: number): FormulaError | CouponScheduleResolves an odd first coupon schedule anchored at its first payment date.
settlement: numbermaturity: numberfirstCoupon: numberfrequencyValue: numberbasisValue: number
- functionsolveFinancialRootsource ↗
-
solveFinancialRoot(functionValue: (value: number): number, derivative: (value: number): number | undefined, options?: FinancialRootOptions): FinancialRootResultSolves 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): numberderivative: (value: number): number | undefinedoptions: FinancialRootOptions
- functionstraightLineDepreciationsource ↗
-
straightLineDepreciation(cost: number, salvage: number, life: number): DepreciationResultStraight-line depreciation for one period.
cost: numbersalvage: numberlife: number
- functionsumOfYearsDepreciationsource ↗
-
sumOfYearsDepreciation(cost: number, salvage: number, life: number, period: number): DepreciationResultSum-of-years-digits depreciation for a one-based period.
cost: numbersalvage: numberlife: numberperiod: number
- functiontoCellRefsource ↗
-
toCellRef(row: number, col: number, absRow?: boolean, absCol?: boolean): stringConverts zero-based coordinates to A1 notation.
row: numbercol: numberabsRow: booleanabsCol: boolean
- functionunixMillisToExcelSerialsource ↗
-
unixMillisToExcelSerial(epochMs: number): numberepochMs: number
- functionvariableDecliningBalancesource ↗
-
variableDecliningBalance(cost: number, salvage: number, life: number, startPeriod: number, endPeriod: number, factor?: number, noSwitch?: boolean): DepreciationResultVariable declining-balance depreciation, with Excel's straight-line switch.
cost: numbersalvage: numberlife: numberstartPeriod: numberendPeriod: numberfactor: numbernoSwitch: boolean
Package
@searsuite/sear-domain-formula-engine
Host-neutral formula values, evaluation contracts, registries, references, and external-service boundaries.
- namespaceIAggregationCachesource ↗
-
IAggregationCache: unknownvariablesymbol symbol: typeof symbol - namespaceIDependencyGraphsource ↗
-
IDependencyGraph: unknownvariablesymbol symbol: typeof symbol - namespaceIFormulaCalculationTraceProvidersource ↗
-
IFormulaCalculationTraceProvider: unknownvariablesymbol symbol: typeof symbolDI token for resolving IFormulaCalculationTraceProvider.
- namespaceIFormulaDateSystemProvidersource ↗
-
IFormulaDateSystemProvider: unknownvariablesymbol symbol: typeof symbol - namespaceIFormulaEvaluatorsource ↗
-
IFormulaEvaluator: unknownvariablesymbol symbol: typeof symbol - namespaceIFormulaExternalServiceProvidersource ↗
-
IFormulaExternalServiceProvider: unknownvariablesymbol symbol: symbol - namespaceIFormulaIterationSettingsProvidersource ↗
-
IFormulaIterationSettingsProvider: unknownvariablesymbol symbol: typeof symbol - namespaceIFormulaLocaleProvidersource ↗
-
IFormulaLocaleProvider: unknownvariablesymbol symbol: typeof symbolDI token for resolving IFormulaLocaleProvider.
- namespaceIFormulaParsersource ↗
-
IFormulaParser: unknownvariablesymbol symbol: typeof symbol - namespaceIFormulaResultProvidersource ↗
-
IFormulaResultProvider: unknownvariablesymbol symbol: typeof symbolDI token for resolving IFormulaResultProvider.
- namespaceIFormulaRichResultProvidersource ↗
-
IFormulaRichResultProvider: unknownvariablesymbol symbol: typeof symbol - namespaceIFormulaSourceProvidersource ↗
-
IFormulaSourceProvider: unknownvariablesymbol symbol: typeof symbolDI token for resolving IFormulaSourceProvider.
- namespaceIFormulaStatusProvidersource ↗
-
IFormulaStatusProvider: unknownvariablesymbol symbol: typeof symbolDI token for resolving IFormulaStatusProvider.
- namespaceIFormulaTextServiceProvidersource ↗
-
IFormulaTextServiceProvider: unknownvariablesymbol symbol: typeof symbolDI token for host adapters that supply text-formula services.
- namespaceIFunctionRegistrysource ↗
-
IFunctionRegistry: unknownvariablesymbol symbol: typeof symbol - classFormulaFunctionArgumentssource ↗
-
class FormulaFunctionArgumentsPublic coercion and argument-reading SDK for built-in and third-party formula functions.
constructorconstructor FormulaFunctionArguments(args: readonly FormulaArg[], context: EvalContext): FormulaFunctionArgumentsargs: readonly FormulaArg[]context: EvalContext
methodboolean boolean(index: number, fallback?: boolean): boolean | FormulaErrorReads a boolean argument from booleans, numbers, or TRUE/FALSE text.
index: numberfallback: boolean
methodinteger integer(index: number, fallback?: number): number | FormulaErrorReads a truncated integer argument.
index: numberfallback: number
methodisMissing isMissing(index: number): booleanReturns whether an argument was omitted.
index: number
methodnumber number(index: number, fallback?: number): number | FormulaErrorReads and coerces one argument to a finite number.
index: numberfallback: number
methodreference reference(index: number): FormulaError | ResolvedFormulaRangeReads a reference argument without materializing it.
index: number
methodtext text(index: number, fallback?: string): string | FormulaErrorReads and coerces one argument to text using spreadsheet-compatible scalar rules.
index: numberfallback: string
methodvalue value(index: number): FormulaValueReads one scalar argument while preserving formula errors.
index: number
- interfaceCellChangesource ↗
-
interface CellChangeValue transition for one formula-visible cell.
- interfaceEvalContextsource ↗
-
interface EvalContextHost-provided services and data readers used during formula evaluation.
propertyaggregationCache aggregationCache?: IAggregationCachepropertyarrayFormulaMode arrayFormulaMode?: "dynamic" | "legacy"propertybudget budget?: FormulaEvaluationBudgetpropertycurrentCell currentCell?: FormulaCellPositionpropertydateSystem dateSystem?: FormulaDateSystempropertydateTimeLocale dateTimeLocale?: FormulaDateTimeLocalepropertyexternalServices externalServices?: FormulaExternalServiceReaderpropertyformulaSource formulaSource?: IFormulaSourceProviderpropertylanguageService languageService?: FormulaLanguageServicepropertymetadata metadata?: FormulaMetadataReaderpropertyphoneticReader phoneticReader?: FormulaPhoneticReaderpropertyreferenceResolver referenceResolver?: FormulaReferenceResolverpropertyregisterDynamicDependency registerDynamicDependency?: FormulaDynamicDependencyRegistrarpropertyscope scope?: FormulaEvaluationScopepropertytextLocale textLocale?: FormulaTextLocalepropertyxmlXPath xmlXPath?: XmlXPathEvaluatormethodcurrentDateTime currentDateTime(): numbermethodevaluateArrayFormula evaluateArrayFormula(ast: FormulaAST, scope?: FormulaEvaluationScope): FormulaValueast: FormulaASTscope: FormulaEvaluationScope
methodevaluateFormula evaluateFormula(ast: FormulaAST, scope?: FormulaEvaluationScope): FormulaValueast: FormulaASTscope: FormulaEvaluationScope
methodforFormulaCell forFormulaCell(cell: FormulaCellPosition): EvalContextcell: FormulaCellPosition
methodgetCellValue getCellValue(row: number, col: number): FormulaValuerow: numbercol: number
methodgetSheetShape getSheetShape(): [rowCount: number, colCount: number]methodgetWorkbookCellValue getWorkbookCellValue(sheetName: string, row: number, col: number): FormulaValuesheetName: stringrow: numbercol: number
methodisCellInBounds isCellInBounds(row: number, col: number): booleanrow: numbercol: number
methodisCellOccupied isCellOccupied(row: number, col: number): booleanrow: numbercol: number
methoditerateRange iterateRange(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>startRow: numberstartCol: numberendRow: numberendCol: number
methoditerateRangeCells iterateRangeCells(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>startRow: numberstartCol: numberendRow: numberendCol: number
methoditerateWorkbookRange iterateWorkbookRange(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>sheetName: stringstartRow: numberstartCol: numberendRow: numberendCol: number
methoditerateWorkbookRangeCells iterateWorkbookRangeCells(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>sheetName: stringstartRow: numberstartCol: numberendRow: numberendCol: number
methodrandom random(): numbermethodreadReference readReference(reference: ResolvedFormulaRange): FormulaValuereference: ResolvedFormulaRange
- interfaceEvalResultsource ↗
-
interface EvalResultOne result produced during formula batch evaluation.
- interfaceFormulaAddInRegistrationRequestsource ↗
-
interface FormulaAddInRegistrationRequestIdentifies one procedure exposed by a host-managed add-in.
- interfaceFormulaAddInServicesource ↗
-
interface FormulaAddInServiceHost-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 FormulaCalculationTraceEventBaseEvent emitted when one batch of derived results is flushed.
propertygeneration readonly generation: numberpropertypendingCount readonly pendingCount: numberpropertyresults readonly results: readonly FormulaFlushedCellResult[]propertysequenceinherited readonly sequence: numberpropertytype readonly type: "formula.batchFlushed" - interfaceFormulaCalculationTraceEventBasesource ↗
-
interface FormulaCalculationTraceEventBaseShared metadata attached to every calculation trace event.
propertysequence readonly sequence: number - interfaceFormulaCellMetadatasource ↗
-
interface FormulaCellMetadataRead-only cell facts consumed by information formulas.
propertyformula readonly formula?: stringpropertylocked readonly locked?: booleanpropertynumberFormat readonly numberFormat?: stringpropertyreference readonly reference: FormulaMetadataCellReferencepropertysource readonly source: FormulaCellSourcepropertyvalue readonly value: FormulaValuepropertywidth readonly width?: number - interfaceFormulaCellPositionsource ↗
-
interface FormulaCellPositionPosition of the formula currently being evaluated.
- interfaceFormulaCellStatussource ↗
-
interface FormulaCellStatusRead-only formula status snapshot for one sheet cell.
propertycol readonly col: numberpropertydependencies readonly dependencies: readonly Dependency[]propertydependents readonly dependents: readonly number[]propertydirty readonly dirty: booleanpropertyerrorCode readonly errorCode: FormulaErrorCode | undefinedpropertyformula readonly formula: string | undefinedpropertyisFormulaCell readonly isFormulaCell: booleanpropertyresult readonly result: FormulaValue | undefinedpropertyrow readonly row: number - interfaceFormulaCubeMemberValuesource ↗
-
interface FormulaCubeMemberValueCUBE member or tuple identity with its display caption.
propertycaption readonly caption: stringpropertyconnection readonly connection: stringpropertyexpression readonly expression: stringpropertykind readonly kind: "cube-member" - interfaceFormulaCubeServicesource ↗
-
interface FormulaCubeServiceHost-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): (): voidlistener: (): void
- interfaceFormulaCubeSetValuesource ↗
-
interface FormulaCubeSetValueCUBE set identity with its display caption.
propertycaption readonly caption: stringpropertyconnection readonly connection: stringpropertycount readonly count?: numberpropertyexpression readonly expression: stringpropertykind readonly kind: "cube-set" - interfaceFormulaDateTimeLocalesource ↗
-
interface FormulaDateTimeLocaleLocale-specific date/time parsing and formatting used by formulas.
propertylocale readonly locale: stringpropertysymbols readonly symbols?: FormulaDateTimeSymbolsmethodformatDateTime formatDateTime(serial: number, pattern?: string): stringserial: numberpattern: string
methodparseDateTime parseDateTime(value: unknown, options?: FormulaDateTimeParseOptions): FormulaDateTimeParseResult | nullvalue: unknownoptions: FormulaDateTimeParseOptions
- interfaceFormulaDateTimeMeridiemSymbolsource ↗
-
interface FormulaDateTimeMeridiemSymbolLocale-specific AM/PM token.
- interfaceFormulaDateTimeMonthSymbolsource ↗
-
interface FormulaDateTimeMonthSymbolLocale-specific month-name token.
- interfaceFormulaDateTimeParseOptionssource ↗
-
interface FormulaDateTimeParseOptionsOptions passed to locale-aware formula date/time parsers.
propertycurrentDateTime readonly currentDateTime?: number - interfaceFormulaDateTimeParseResultsource ↗
-
interface FormulaDateTimeParseResultParsed Excel-compatible date/time serial and source components.
- interfaceFormulaDateTimeSymbolssource ↗
-
interface FormulaDateTimeSymbolsLocale-specific symbols consumed by the shared date/time parser.
- interfaceFormulaDateTimeUnitSymbolssource ↗
-
interface FormulaDateTimeUnitSymbolsLocale-specific date-unit tokens.
- interfaceFormulaDependenciesChangedEventsource ↗
-
interface FormulaDependenciesChangedEvent extends FormulaCalculationTraceEventBaseEvent emitted when one formula cell's dependency edges change.
propertycol readonly col: numberpropertydependencies readonly dependencies: readonly Dependency[]propertykey readonly key: numberpropertypreviousDependencies readonly previousDependencies: readonly Dependency[]propertyrow readonly row: numberpropertysequenceinherited readonly sequence: numberpropertytype readonly type: "formula.dependenciesChanged" - interfaceFormulaDirectAddInCallsource ↗
-
interface FormulaDirectAddInCall extends FormulaAddInRegistrationRequestInvokes a host-authorized procedure by module signature.
- interfaceFormulaEnvironmentMetadatasource ↗
-
interface FormulaEnvironmentMetadataOptional host facts exposed without leaking platform-native APIs.
propertycalculationMode readonly calculationMode?: "Automatic" | "Manual"propertydirectory readonly directory?: stringpropertyoperatingSystem readonly operatingSystem?: stringpropertysystem readonly system?: stringpropertyversion readonly version?: string - interfaceFormulaErrorsource ↗
-
interface FormulaErrorSerializable formula error value.
- interfaceFormulaErrorChangedEventsource ↗
-
interface FormulaErrorChangedEvent extends FormulaCalculationTraceEventBaseEvent emitted when one formula cell's error code changes.
propertycol readonly col: numberpropertyerrorCode readonly errorCode: FormulaErrorCode | undefinedpropertygeneration readonly generation: numberpropertykey readonly key: numberpropertypreviousErrorCode readonly previousErrorCode: FormulaErrorCode | undefinedpropertyrow readonly row: numberpropertysequenceinherited readonly sequence: numberpropertytype readonly type: "formula.errorChanged" - interfaceFormulaEvaluationBudgetsource ↗
-
interface FormulaEvaluationBudgetHost-neutral execution budget for formula evaluation.
propertymaxSteps readonly maxSteps: numbermethodconsumeStep consumeStep(): boolean - interfaceFormulaEvaluationScopesource ↗
-
interface FormulaEvaluationScopeLexical scope for formula-local names.
- interfaceFormulaExternalServiceDefinitionsource ↗
-
interface FormulaExternalServiceDefinition<T>Typed identity for one synchronous service view consumed by formulas.
propertyid readonly id: stringpropertysubscribeInvalidation readonly subscribeInvalidation?: (service: T, listener: (): void): (): voidpropertytype readonly type?: T - interfaceFormulaExternalServiceReadersource ↗
-
interface FormulaExternalServiceReaderRead-only external-service view exposed during formula evaluation.
methodget get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefineddefinition: FormulaExternalServiceDefinition<T>
- interfaceFormulaFlushedCellResultsource ↗
-
interface FormulaFlushedCellResultOne cell result written during a formula batch flush.
- interfaceFormulaFunctionsource ↗
-
interface FormulaFunctionRuntime contract implemented by built-in and third-party formula functions.
propertyallowReferencesOutsideHostShape allowReferencesOutsideHostShape?: booleanPass reference coordinates to the function even when outside the host's materialized sheet shape.
propertydescriptor descriptor?: FormulaFunctionDescriptorpropertylazy lazy?: booleanpropertyname name: stringpropertynamedConstants namedConstants?: Readonly<Record<string, FormulaValue>>propertyvolatile volatile?: booleanmethodevaluate evaluate(args: FormulaArg[], context: EvalContext): FormulaValueargs: FormulaArg[]context: EvalContext
methodincrementalUpdate incrementalUpdate(prevResult: FormulaValue, changedCells: CellChange[], args: FormulaAST[], context: EvalContext): FormulaValueprevResult: FormulaValuechangedCells: CellChange[]args: FormulaAST[]context: EvalContext
- interfaceFormulaFunctionDescriptorsource ↗
-
interface FormulaFunctionDescriptorVersioned presentation-neutral formula function metadata.
propertycategory readonly category: stringpropertyexample readonly example: stringpropertyexternalServices readonly externalServices?: readonly string[]propertymaxArguments readonly maxArguments?: numberAuthoritative upper argument bound. Omit for variadic or illustrative signatures.
propertyminArguments readonly minArguments?: numberAuthoritative 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: stringpropertyversion readonly version: 1 - interfaceFormulaFunctionParameterDescriptorsource ↗
-
interface FormulaFunctionParameterDescriptorOne function parameter exposed to formula-authoring tools.
propertyaccepts readonly accepts?: readonly FormulaFunctionArgumentKind[]propertydescription readonly description: stringpropertyname readonly name: stringpropertyoptional readonly optional?: booleanpropertyrepeating readonly repeating?: boolean - interfaceFormulaGoogleRequestsource ↗
-
interface FormulaGoogleRequestSerializable request used by host-backed Google-compatible formulas.
propertyarguments readonly arguments: readonly FormulaValue[]propertyfunctionName readonly functionName: string - interfaceFormulaGoogleServicesource ↗
-
interface FormulaGoogleServiceSynchronous cache view. Hosts load values outside formula evaluation.
methodread read(request: FormulaGoogleRequest): FormulaServiceCacheResult<FormulaValue>request: FormulaGoogleRequest
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
- interfaceFormulaHyperlinkResultsource ↗
-
interface FormulaHyperlinkResultHost-neutral hyperlink result projected by a formula renderer.
- interfaceFormulaHyperlinkServicesource ↗
-
interface FormulaHyperlinkServiceHost policy for validating and normalizing hyperlink targets.
methodnormalizeTarget normalizeTarget(target: string): string | undefinedtarget: string
- interfaceFormulaImageResourcesource ↗
-
interface FormulaImageResourceHost-neutral image resource returned by an image loader.
propertyassetId readonly assetId: stringpropertyintrinsicHeight readonly intrinsicHeight?: numberpropertyintrinsicWidth readonly intrinsicWidth?: numberpropertysource readonly source: string - interfaceFormulaImageResultsource ↗
-
interface FormulaImageResultHost-neutral image result projected by a formula renderer.
- interfaceFormulaImageServicesource ↗
-
interface FormulaImageServiceHost-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): (): voidlistener: (): void
- interfaceFormulaIterationSettingssource ↗
-
interface FormulaIterationSettingsPer-editor calculation policy for circular formula dependencies.
propertyenabled enabled: booleanpropertymaxChange maxChange: numberpropertymaxIterations maxIterations: number - interfaceFormulaLanguageServicesource ↗
-
interface FormulaLanguageServiceSynchronous cache view for host-managed language services.
propertydefaultTargetLanguage readonly defaultTargetLanguage?: stringmethoddetectLanguage detectLanguage(text: string): FormulaLanguageServiceResulttext: string
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
methodtranslate translate(text: string, sourceLanguage: string | undefined, targetLanguage: string): FormulaLanguageServiceResulttext: stringsourceLanguage: string | undefinedtargetLanguage: string
- interfaceFormulaMetadataCellReferencesource ↗
-
interface FormulaMetadataCellReferencePlatform-neutral identity of one cell visible to formula evaluation.
- interfaceFormulaMetadataReadersource ↗
-
interface FormulaMetadataReaderHost-owned, synchronous metadata projection consumed during formula evaluation.
methodreadCell readCell(reference: FormulaMetadataCellReference): FormulaCellMetadata | undefinedreference: FormulaMetadataCellReference
methodreadEnvironment readEnvironment(): FormulaEnvironmentMetadata | undefinedmethodreadWorkbook readWorkbook(): FormulaWorkbookMetadata | undefined - interfaceFormulaPhoneticReadersource ↗
-
interface FormulaPhoneticReaderReads persisted phonetic text without coupling formulas to a cell schema.
methodgetCellPhonetic getCellPhonetic(row: number, col: number): string | undefinedrow: numbercol: number
methodgetWorkbookCellPhonetic getWorkbookCellPhonetic(sheetName: string, row: number, col: number): string | undefinedsheetName: stringrow: numbercol: number
- interfaceFormulaPivotDataQuerysource ↗
-
interface FormulaPivotDataQueryQuery passed to a host-owned pivot data provider.
propertydataField readonly dataField: stringpropertyfilters readonly filters: readonly { field: string; item: string }[]propertypivotReference readonly pivotReference: string - interfaceFormulaPivotDataServicesource ↗
-
interface FormulaPivotDataServiceHost service used by GETPIVOTDATA.
methodgetData getData(query: FormulaPivotDataQuery): FormulaValuequery: FormulaPivotDataQuery
- interfaceFormulaRangeCellsource ↗
-
interface FormulaRangeCellOne range cell with optional visibility and source metadata.
- interfaceFormulaRangeMovesource ↗
-
interface FormulaRangeMoveInclusive source bounds and displacement for reference-preserving cell movement.
propertycolumnOffset readonly columnOffset: numberpropertyend readonly end: readonly [number, number]propertyincludeUnqualified readonly includeUnqualified?: booleanFalse when inspecting qualified references from a different sheet.
propertyrowOffset readonly rowOffset: numberpropertysheetName readonly sheetName?: stringWhen supplied, qualified references to this sheet also follow the move.
propertystart readonly start: readonly [number, number] - interfaceFormulaRecalculationCompletedEventsource ↗
-
interface FormulaRecalculationCompletedEvent extends FormulaCalculationTraceEventBaseEvent emitted when one recalculation generation completes.
propertybatchCount readonly batchCount: numberpropertyflushedCellCount readonly flushedCellCount: numberpropertygeneration readonly generation: numberpropertypendingCount readonly pendingCount: 0propertysequenceinherited readonly sequence: numberpropertytype readonly type: "formula.recalculationCompleted" - interfaceFormulaReferenceArgumentsource ↗
-
interface FormulaReferenceArgumentA function argument that intentionally retains reference identity.
- interfaceFormulaReferenceResolutionOptionssource ↗
-
interface FormulaReferenceResolutionOptionsOptions used when resolving text, names, or dynamic references.
propertycurrentCell readonly currentCell?: FormulaCellPositionpropertystyle readonly style?: FormulaReferenceStyle - interfaceFormulaReferenceResolversource ↗
-
interface FormulaReferenceResolverHost-owned resolver for names and text references.
methodresolve resolve(referenceText: string, options?: FormulaReferenceResolutionOptions): FormulaError | ResolvedFormulaRangereferenceText: stringoptions: FormulaReferenceResolutionOptions
- interfaceFormulaReferenceValuesource ↗
-
interface FormulaReferenceValueReference identity returned by reference-preserving functions.
- interfaceFormulaRegisteredAddInCallsource ↗
-
interface FormulaRegisteredAddInCallInvokes a procedure previously resolved by REGISTER.ID.
propertyarguments readonly arguments: readonly FormulaValue[]propertykind readonly kind: "registered"propertyregistrationId readonly registrationId: number - interfaceFormulaRtdKeysource ↗
-
interface FormulaRtdKeyStable key used to read one RTD subscription.
- interfaceFormulaRtdServicesource ↗
-
interface FormulaRtdServiceHost-owned RTD service.
methodload load(key: FormulaRtdKey): Promise<void>key: FormulaRtdKey
methodread read(key: FormulaRtdKey): FormulaServiceCacheResult<FormulaValue>key: FormulaRtdKey
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
- interfaceFormulaSheetMetadatasource ↗
-
interface FormulaSheetMetadataStable workbook sheet identity and one-based display position.
- interfaceFormulaStockHistoryRequestsource ↗
-
interface FormulaStockHistoryRequestNormalized request key for a historical market-data lookup.
- interfaceFormulaStockHistoryServicesource ↗
-
interface FormulaStockHistoryServiceSynchronous view over historical market data loaded outside formula evaluation.
methodread read(request: FormulaStockHistoryRequest): FormulaServiceCacheResult<FormulaError | FormulaValue[][]>request: FormulaStockHistoryRequest
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
- interfaceFormulaStructureMoveOptionssource ↗
-
interface FormulaStructureMoveOptionsSelects the reference namespace rewritten by a structure permutation.
propertyincludeUnqualified readonly includeUnqualified?: booleanpropertysheetName readonly sheetName?: string - interfaceFormulaTextsource ↗
-
interface FormulaTextText value carrying an explicit numeric coercion policy.
propertykind kind: "text"propertynumericCoercion numericCoercion: "allow" | "deny"propertyvalue value: string - interfaceFormulaTextLocalesource ↗
-
interface FormulaTextLocaleLocale-specific byte and width transforms for legacy text functions.
propertycurrencySymbol readonly currencySymbol?: stringpropertylocale readonly locale: stringmethodbyteLength byteLength(text: string): numbertext: string
methodcalculationModeLabel calculationModeLabel(mode: "Automatic" | "Manual"): stringmode: "Automatic" | "Manual"
methodcharacterCode characterCode(text: string): numbertext: string
methodcharacterFromCode characterFromCode(code: number): string | undefinedcode: number
methodcompareText compareText(left: string, right: string): numberleft: stringright: string
methodfindByBytes findByBytes(text: string, search: string, startByte: number, caseSensitive: boolean): numbertext: stringsearch: stringstartByte: numbercaseSensitive: boolean
methodformatCurrency formatCurrency(number: number, decimals: number): stringnumber: numberdecimals: number
methodreplaceByBytes replaceByBytes(text: string, startByte: number, byteLength: number, replacement: string): stringtext: stringstartByte: numberbyteLength: numberreplacement: string
methodsliceByBytes sliceByBytes(text: string, startByte: number, byteLength: number): stringtext: stringstartByte: numberbyteLength: number
methodtoFullWidth toFullWidth(text: string): stringtext: string
methodtoHalfWidth toHalfWidth(text: string): stringtext: string
methodtoJis toJis(text: string): stringtext: string
- interfaceFormulaTupleValuesource ↗
-
interface FormulaTupleValueTuple expression preserving the identity of its items.
- interfaceFormulaWebServicesource ↗
-
interface FormulaWebServiceSynchronous view of HTTP response text loaded explicitly by the host.
methodread read(url: string): FormulaServiceCacheResult<string | FormulaError>url: string
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
- interfaceFormulaWorkbookMetadatasource ↗
-
interface FormulaWorkbookMetadataRead-only workbook facts consumed by information formulas.
propertycurrentSheetId readonly currentSheetId?: stringpropertycurrentSheetName readonly currentSheetName?: stringpropertysheets readonly sheets: readonly FormulaSheetMetadata[] - interfaceIAggregationCachesource ↗
-
interface IAggregationCachePublic contract for IAggregationCache.
methodclear clear(): voidClears all caches.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds cache writes to the owning editor command dispatch after initialization.
isCommandExecuting: (): boolean
methodgetCount getCount(startRow: number, startCol: number, endRow: number, endCol: number): numberGets the COUNT for a range, meaning the number of numeric cells.
Uses the same cache and incremental strategy as getSum.startRow: numberstartCol: numberendRow: numberendCol: number
methodgetSum getSum(startRow: number, startCol: number, endRow: number, endCol: number): numberGets 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): voidNotifies 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(): voidNotifies 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): voidStores a successfully calculated COUNT for a rectangular range.
startRow: numberstartCol: numberendRow: numberendCol: numbercount: number
methodsetSum setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): voidStores a successfully calculated SUM for a rectangular range.
startRow: numberstartCol: numberendRow: numberendCol: numbersum: number
- interfaceIDependencyGraphsource ↗
-
interface IDependencyGraphPublic contract for IDependencyGraph.
propertypendingCount readonly pendingCount: numberNumber of dirty formulas still waiting for evaluation.
propertysize readonly size: numberTotal number of formula cells currently in the graph.
methodclear clear(): voidClears all graph data.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds 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): booleanReports 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): voidMarks 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[]): voidMarks 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[]): voidNotifies 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): voidRemoves 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[]): voidRegisters 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 IFormulaCalculationTraceProviderRead-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): (): voidSubscribes 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 IFormulaDateSystemProviderEditor-local source for the workbook date serial system.
methodgetDateSystem getDateSystem(): FormulaDateSystem - interfaceIFormulaEvaluatorsource ↗
-
interface IFormulaEvaluatorPublic contract for IFormulaEvaluator.
methodevaluate evaluate(ast: FormulaAST, context: EvalContext): FormulaValueEvaluates 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): voidRegisters 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 FormulaExternalServiceReaderEditor-owned registry used by hosts to publish services and cache invalidation.
methoddestroy destroy(ownerToken?: object): voidownerToken: object
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidisCommandExecuting: (): booleandispatchRemoval: (id: number): void
methodenforceTeardownBoundary enforceTeardownBoundary(ownerToken: object): voidownerToken: object
methodgetinherited get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefineddefinition: FormulaExternalServiceDefinition<T>
methodinvalidate invalidate<T>(definition: FormulaExternalServiceDefinition<T>): voiddefinition: FormulaExternalServiceDefinition<T>
methodregister register<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): voiddefinition: FormulaExternalServiceDefinition<T>service: T
methodsubscribeInvalidation subscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): voidlistener: (serviceIds: readonly string[]): void
methodunregisterRegistration unregisterRegistration(id: number): voidid: number
- interfaceIFormulaIterationSettingsProvidersource ↗
-
interface IFormulaIterationSettingsProviderOptional editor-local provider for circular formula calculation.
methodgetSettings getSettings(): FormulaIterationSettings - interfaceIFormulaLocaleProvidersource ↗
-
interface IFormulaLocaleProviderEditor-local locale provider consumed by formula evaluation hosts.
methodgetDateTimeLocale getDateTimeLocale(): FormulaDateTimeLocaleReturns the current date/time locale strategy for formula functions.
methodgetTextLocale getTextLocale(): FormulaTextLocaleReturns the current text byte/width locale strategy for formula functions.
- interfaceIFormulaParsersource ↗
-
interface IFormulaParserPublic 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): FormulaASTParses 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[]): FormulaASTShifts 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!.ExampleA 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: FormulaASTchanges: StructureChange[]
- interfaceIFormulaResultProvidersource ↗
-
interface IFormulaResultProviderRead-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): voidVisits 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: numberstartColumn: numberendRow: numberendColumn: numbervisit: (row: number, column: number): void
methodgetFormulaResult getFormulaResult(row: number, col: number): FormulaValue | undefinedGets 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 IFormulaRichResultProviderRead-only provider for non-text visual results produced by formula cells.
methodgetFormulaRichResult getFormulaRichResult(row: number, col: number): FormulaRichResult | undefinedrow: numbercol: number
- interfaceIFormulaSourceProvidersource ↗
-
interface IFormulaSourceProviderRead-only provider for the formula source text shown while editing.
methodgetFormulaSource getFormulaSource(row: number, col: number): string | undefinedGets 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: numbercol: number
- interfaceIFormulaStatusProvidersource ↗
-
interface IFormulaStatusProviderRead-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): FormulaCellStatusGets 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 IFormulaTextServiceProviderOptional editor-local providers for metadata- and service-backed text formulas.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidisCommandExecuting: (): booleandispatchRemoval: (id: number): void
methodgetLanguageService getLanguageService(): FormulaLanguageService | undefinedmethodgetPhoneticReader getPhoneticReader(): FormulaPhoneticReader | undefinedmethodregisterLanguageService registerLanguageService(service: FormulaLanguageService): (): voidservice: FormulaLanguageService
methodregisterPhoneticReader registerPhoneticReader(reader: FormulaPhoneticReader): (): voidreader: FormulaPhoneticReader
methodsubscribeInvalidation subscribeInvalidation(listener: (): void): (): voidlistener: (): void
methodunregisterRegistration unregisterRegistration(id: number): voidid: number
- interfaceIFunctionRegistrysource ↗
-
interface IFunctionRegistryPublic contract for IFunctionRegistry.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidRequires post-initialization writes to occur during the owning editor's command dispatch.
isCommandExecuting: (): booleandispatchRemoval: (id: number): void
methodget get(name: string): FormulaFunction | undefinedGets a function definition by name.
ReturnsFunction definition, or undefined when it is not registered.
name: string- Function name, case-insensitive.
methodhas has(name: string): booleanChecks 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): (): voidRegisters a formula function.
fn: FormulaFunction- Function definition; name is stored in uppercase automatically.
methodregisterMany registerMany(functions: readonly FormulaFunction[]): (): voidRegisters 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): (): voidSubscribes to registrations and removals that can change formula results.
listener: (functionNames: readonly string[]): void
methodunregisterRegistration unregisterRegistration(id: number): voidRemoves one tokenized registration; disposal may dispatch an owner command.
id: number
- interfaceResolvedFormulaRangesource ↗
-
interface ResolvedFormulaRangeConcrete finite range resolved against sheet bounds.
- interfaceShiftedStructureCoordinatesource ↗
-
interface ShiftedStructureCoordinateResult of shifting one coordinate through structure changes.
- interfaceStructureMoveChangesource ↗
-
interface StructureMoveChangeFormula-aware row or column move.
- typeBinaryOpsource ↗
-
type BinaryOp = "+" | "-" | "*" | "/" | "^" | "&" | "=" | "<>" | "<" | ">" | "<=" | ">="Supported binary formula operators.
- 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.
- typeFormulaAddInCallsource ↗
-
type FormulaAddInCall = FormulaRegisteredAddInCall | FormulaDirectAddInCallSupported host add-in invocation request.
- typeFormulaAddInRegistrationIdsource ↗
-
type FormulaAddInRegistrationId = numberStable 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 } | FormulaReferenceArgumentFunction 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 | FormulaDependenciesChangedEventFormula calculation trace event union.
- typeFormulaCalculationTraceEventPayloadsource ↗
-
type FormulaCalculationTraceEventPayload = conditionalTrace event payload before the provider assigns its sequence number.
- typeFormulaCalculationTraceListenersource ↗
-
type FormulaCalculationTraceListener = (event: FormulaCalculationTraceEvent): voidListener 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 | FormulaErrorValue 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): voidCallback 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 | FormulaImageResultHost-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 | StructureMoveChangePublic 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.ColMoveMatrix structure action understood by formula reference transforms.
- 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): voidValidates 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: stringoptions: Pick<FormulaExternalServiceDefinition<T>, "subscribeInvalidation">
- functiongetStructureChangeAxissource ↗
-
getStructureChangeAxis(change: StructureChange): StructureChangeAxis | undefinedReturns the axis affected by one structure change.
change: StructureChange
- functiongetStructureChangeKindsource ↗
-
getStructureChangeKind(change: StructureChange): StructureChangeKind | undefinedReturns whether one structure change inserts, deletes, or moves coordinates.
change: StructureChange
- functionisFormulaArgumentKindsource ↗
-
isFormulaArgumentKind<K>(arg: FormulaArgumentLike | null | undefined, ...kinds: readonly K[]): argNarrows a formula argument to one or more discriminant kinds.
arg: FormulaArgumentLike | null | undefinedkinds: readonly K[]
- functionisFormulaErrorsource ↗
-
isFormulaError(value: unknown): valueReturns whether a formula value is an error value.
value: unknown
- functionisFormulaErrorCodesource ↗
-
isFormulaErrorCode(code: unknown): codeReports whether a runtime value is a canonical formula error code.
code: unknown
- functionmapFormulaReferenceNodessource ↗
-
mapFormulaReferenceNodes(ast: FormulaAST, map: (node: FormulaReferenceNode): FormulaAST): FormulaASTTraverses expression containers while preserving unchanged node identities.
ast: FormulaASTmap: (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 | nullConverts one Matrix OT structure operation into a formula structure change.
operation: OTOperation
- functionmoveFormulaReferencessource ↗
-
moveFormulaReferences(ast: FormulaAST, move: FormulaRangeMove): FormulaASTMoves referenced identities, including absolute references, without rebasing unrelated references.
ast: FormulaASTmove: FormulaRangeMove
- functionreorderFormulaReferencessource ↗
-
reorderFormulaReferences(ast: FormulaAST, changes: readonly StructureMoveChange[], options?: FormulaStructureMoveOptions): FormulaASTReorders reference identities (including absolute references) through the entire permutation.
ast: FormulaASTchanges: readonly StructureMoveChange[]options: FormulaStructureMoveOptions
- functionshiftStructureCoordinatesource ↗
-
shiftStructureCoordinate(input: { absolute?: boolean; axis: StructureChangeAxis; changes: readonly StructureChange[]; coordinate: number }): ShiftedStructureCoordinateShifts 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
Sparse matrix storage, structural row and column operations, dimensions, and serialization.
- classColumnShapeDimensionsCSRMatrixsource ↗
-
class ColumnShapeDimensionsCSRMatrix extends DimensionsCSRMatrixSpecialized subclass of DimensionsCSRMatrix for tracking column widths.
constructorconstructor ColumnShapeDimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]): ColumnShapeDimensionsCSRMatrixConstructs a DimensionsCSRMatrix instance.
args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]- Same parameters as CSRMatrix constructor
propertyname name: stringStable matrix name used in diagnostics and serialized metadata.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, column: number | null[]): thisInserts a column while omitting values equal to the configured default dimension.
targetIndex: numbercolumn: number | null[]
methodaddIteminherited addItem(row: number, col: number, value: number): thisStores 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): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: number | null[]): thisInserts a row while omitting values equal to the configured default dimension.
targetIndex: numberrow: number | null[]
methodcloneinherited clone(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: number): number): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: number): number
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): ColumnShapeDimensionsCSRMatrixDeletes 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): ColumnShapeDimensionsCSRMatrixDeletes 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>[]): ColumnShapeDimensionsCSRMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: number, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: number, col: number): void
methodfromDenseinherited fromDense(denseArray: number | null[][]): ColumnShapeDimensionsCSRMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: number | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetDimensionLeftBoundaryByIndexinherited getDimensionLeftBoundaryByIndex(colIndex: number): numberGets 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 onceExample// 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): numberGets 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 onceExample// 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 resultExampleconst matrix = new DimensionsCSRMatrix(...); const map = matrix.getDimensionsMap(); // [10, 30, 60]methodgetIteminherited getItem(row: number, col: number): number | nullRetrieves 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): numberFinds 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): numberFinds 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: number): voidSets 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): voidSums 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): ColumnShapeDimensionsCSRMatrixSwaps 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): ColumnShapeDimensionsCSRMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumn 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): voidRegisters 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedView cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetached cloneDetached(cloneValue: (value: T): T): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: T): T
methodcloneForStaging cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: T, row: number, column: number): void
methodforEachStoredInRow forEachStoredInRow(row: number, callback: (value: T, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (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): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetItem getItem(row: number, col: number): T | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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> | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: T): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: T- The default value to return for missing elements
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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 enginesExample// 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 rowsconstructorconstructor DimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]): DimensionsCSRMatrixConstructs a DimensionsCSRMatrix instance.
args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]- Same parameters as CSRMatrix constructor
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumn addColumn(targetIndex: number, column: number | null[]): thisInserts a column while omitting values equal to the configured default dimension.
targetIndex: numbercolumn: number | null[]
methodaddItem addItem(row: number, col: number, value: number): thisStores 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): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRow addRow(targetIndex: number, row: number | null[]): thisInserts a row while omitting values equal to the configured default dimension.
targetIndex: numberrow: number | null[]
methodcloneinherited clone(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: number): number): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: number): number
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): DimensionsCSRMatrixDeletes 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): DimensionsCSRMatrixDeletes 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>[]): DimensionsCSRMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: number, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: number, col: number): void
methodfromDenseinherited fromDense(denseArray: number | null[][]): DimensionsCSRMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: number | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetDimensionLeftBoundaryByIndex getDimensionLeftBoundaryByIndex(colIndex: number): numberGets 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 onceExample// 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): numberGets 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 onceExample// 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 resultExampleconst matrix = new DimensionsCSRMatrix(...); const map = matrix.getDimensionsMap(); // [10, 30, 60]methodgetIteminherited getItem(row: number, col: number): number | nullRetrieves 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): numberFinds 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): numberFinds 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValue setDefaultValue(value: number): voidSets 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): voidSums 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): DimensionsCSRMatrixSwaps 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): DimensionsCSRMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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 SearErrorError thrown when a persisted sparse matrix payload cannot be decoded.
constructorconstructor MatrixSerializationError(code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT", message: string, details?: SearErrorDetails): MatrixSerializationErrorCreates a MatrixSerializationError instance.
code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT"message: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT"Stable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classRowShapeDimensionsCSRMatrixsource ↗
-
class RowShapeDimensionsCSRMatrix extends DimensionsCSRMatrixSpecialized subclass of DimensionsCSRMatrix for tracking row heights.
constructorconstructor RowShapeDimensionsCSRMatrix(...args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]): RowShapeDimensionsCSRMatrixConstructs a DimensionsCSRMatrix instance.
args: [data: { data: number[]; indices: number[]; indptr: number[] }, shape: [number, number]]- Same parameters as CSRMatrix constructor
propertyname name: stringStable matrix name used in diagnostics and serialized metadata.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, column: number | null[]): thisInserts a column while omitting values equal to the configured default dimension.
targetIndex: numbercolumn: number | null[]
methodaddIteminherited addItem(row: number, col: number, value: number): thisStores 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): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: number | null[]): thisInserts a row while omitting values equal to the configured default dimension.
targetIndex: numberrow: number | null[]
methodcloneinherited clone(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: number): number): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: number): number
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): RowShapeDimensionsCSRMatrixDeletes 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): RowShapeDimensionsCSRMatrixDeletes 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>[]): RowShapeDimensionsCSRMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: number, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: number, col: number): void
methodfromDenseinherited fromDense(denseArray: number | null[][]): RowShapeDimensionsCSRMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: number | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetDimensionLeftBoundaryByIndexinherited getDimensionLeftBoundaryByIndex(colIndex: number): numberGets 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 onceExample// 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): numberGets 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 onceExample// 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 resultExampleconst matrix = new DimensionsCSRMatrix(...); const map = matrix.getDimensionsMap(); // [10, 30, 60]methodgetIteminherited getItem(row: number, col: number): number | nullRetrieves 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): numberFinds 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): numberFinds 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: number): voidSets 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): voidSums 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): RowShapeDimensionsCSRMatrixSwaps 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): RowShapeDimensionsCSRMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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.Exampleconst state: ISheetState<string> = { sheetData: new CSRMatrix<string>(...), rowSizes: new RowShapeDimensionsCSRMatrix(...), columnSizes: new ColumnShapeDimensionsCSRMatrix(...) };propertycolumnSizes columnSizes: ColumnShapeDimensionsCSRMatrixMatrix 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-450propertyrowSizes rowSizes: RowShapeDimensionsCSRMatrixMatrix 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-95propertysheetData 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 MatrixMoveRangeInclusive bounds used by matrix range movement.
- interfaceSerializedSparseMatrixsource ↗
-
interface SerializedSparseMatrix<TValue>Sparse matrix payload used by package-level serializers.
propertydefaultValue readonly defaultValue?: TValueOptional 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.
- 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: MatrixMoveRangedestination: MatrixMoveRangemapValue: (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): TMatrixDeserializes a generic sparse matrix payload into the requested runtime matrix class.
payload: unknownMatrixClass: SparseMatrixFactory<TMatrix, TValue>path: string
- functionhasMatrixRangeMoveConflictsource ↗
-
hasMatrixRangeMoveConflict<T>(matrix: CSRMatrix<T>, source: MatrixMoveRange, destination: MatrixMoveRange): booleanTests for explicit destination entries not already owned by the source range.
matrix: CSRMatrix<T>source: MatrixMoveRangedestination: 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
Operational-transformation primitives for matrices, rectangles, and rich documents.
- enumMatrixOTActionNamesource ↗
-
enum MatrixOTActionNameCompact 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 OTTransformPriorityTie-break direction used when two concurrent operations target the same position.
- enumRectOTActionNamesource ↗
-
enum RectOTActionNameCompact command keys persisted in rectangle OT payloads.
enum memberUpdateRect UpdateRect: "ur" - enumRichDocOTActionNamesource ↗
-
enum RichDocOTActionNameCompact 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 BaseOTBase 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): BaseOTConstructs an OT implementation descriptor.
name: string- Stable implementation name.
propertyname readonly name: stringHuman-readable OT implementation name for diagnostics and debugging.
methodappendstatic append(destination: OTOperation[], current: OTOperation): voidAppends 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[]): voidApplies operations to a domain snapshot.
ThrowsSearError until implemented by a concrete OT class.
snapshot: unknownoperations: OTOperation[]
methodcheckValidOpstatic checkValidOp(operations: OTOperation[]): voidValidates 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 BaseOTOperational 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(): MatrixOTCreates a MatrixOT descriptor for diagnostics and shared OT registries.
propertynameinherited readonly name: stringHuman-readable OT implementation name for diagnostics and debugging.
methodappendstatic append<U>(destination: MatrixOTOperation<U>[], current: MatrixOTOperation<U>): voidAppends 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>[]): SApplies 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[]): voidValidates 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>): numberComputes 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>[]): voidTransforms 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 BaseOTOperational 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(): RectOTCreates a RectOT descriptor for diagnostics and shared OT registries.
propertynameinherited readonly name: stringHuman-readable OT implementation name for diagnostics and debugging.
methodappendstaticinherited append(destination: OTOperation[], current: OTOperation): voidAppends 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[]): RectApplies 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[]): voidValidates 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): RectOTOperationBuilds 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 BaseOTOperational 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(): RichDocOTCreates a RichDocOT descriptor for diagnostics and shared OT registries.
propertynameinherited readonly name: stringHuman-readable OT implementation name for diagnostics and debugging.
methodappendstatic append(destination: RichDocOTOperation[], current: RichDocOTOperation): voidAppends 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[]): NodeSchemaApplies 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[]): voidValidates 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 SearErrorPublic error for invalid or unavailable transaction OT behavior.
constructorconstructor TransactionOTError(code: TransactionOTErrorCode, message: string, details?: SearErrorDetails): TransactionOTErrorcode: TransactionOTErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: TransactionOTErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classTransactionOTRegistrysource ↗
-
class TransactionOTRegistryLocal registry of versioned OT families and explicit pair transformations.
constructorconstructor TransactionOTRegistry(): TransactionOTRegistrymethoddecode decode(id: string, version: number, payload: unknown): OTOperation[]Decodes a wire payload through its registered family definition.
id: stringversion: numberpayload: unknown
methoddestroy destroy(): voidPermanently clears the registry.
methodencode encode<OperationType>(definition: TransactionOTDefinition<OperationType>, operations: readonly OperationType[]): OTEncodedValueEncodes 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): (): voidRegisters two families as independent, so pair transformation is explicit identity.
left: TransactionOTDefinitionright: TransactionOTDefinition
methodregisterRelation registerRelation<Left, Right>(relation: OTTransformRelation<Left, Right>): (): voidRegisters one explicit relation. Reverse lookup uses the same implementation with swapped branches.
relation: OTTransformRelation<Left, Right>
methodregisterType registerType<OperationType>(definition: TransactionOTDefinition<OperationType>): (): voidRegisters one operation family and returns an idempotent disposer.
definition: TransactionOTDefinition<OperationType>
methodrequireType requireType(id: string, version: number): TransactionOTDefinitionResolves a registered operation family.
id: stringversion: 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 OTOperationDeletes one column and carries the deleted column payload for inversion.
- interfaceDeleteNodeOTOperationsource ↗
-
interface DeleteNodeOTOperation extends OTOperationDeletes a node and carries the removed payload for inversion.
- interfaceDeleteRowOTOperationsource ↗
-
interface DeleteRowOTOperation<T> extends OTOperationDeletes one row and carries the deleted row payload for inversion.
- interfaceDeleteStringOTOperationsource ↗
-
interface DeleteStringOTOperation extends OTOperationDeletes text from a leaf text node and carries the removed string.
- interfaceInsertColOTOperationsource ↗
-
interface InsertColOTOperation<T> extends OTOperationInserts one column at the target column index.
- interfaceInsertNodeOTOperationsource ↗
-
interface InsertNodeOTOperation extends OTOperationInserts a node into a parent content array.
- interfaceInsertRowOTOperationsource ↗
-
interface InsertRowOTOperation<T> extends OTOperationInserts one row at the target row index.
- interfaceInsertStringOTOperationsource ↗
-
interface InsertStringOTOperation extends OTOperationInserts text into a leaf text node.
- interfaceMoveColOTOperationsource ↗
-
interface MoveColOTOperation<T> extends OTOperationExchanges the column at the path index with the column index encoded by cm.
- interfaceMoveNodeOTOperationsource ↗
-
interface MoveNodeOTOperation extends OTOperationMoves a node within its parent content array.
- interfaceMoveRowOTOperationsource ↗
-
interface MoveRowOTOperation<T> extends OTOperationExchanges the row at the path index with the row index encoded by rm.
- interfaceOTOperationsource ↗
-
interface OTOperationMinimal operation contract shared by every domain OT implementation.
propertyp p: OTOperationPathPath locating the operation target inside the snapshot.
- interfaceOTTransformPairsource ↗
-
interface OTTransformPair<Left, Right>Pair transformation result preserving both concurrent branches.
- 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 OTOperationReplaces one node in a content array while retaining both sides for OT inversion.
- interfaceResizeColOTOperationsource ↗
-
interface ResizeColOTOperation extends OTOperationUpdates one column dimension in a dimension matrix.
- interfaceResizeRowOTOperationsource ↗
-
interface ResizeRowOTOperation extends OTOperationUpdates one row dimension in a dimension matrix.
- interfaceTransactionOTDefinitionsource ↗
-
interface TransactionOTDefinition<OperationType>Stable, versioned operation family shared by history and collaboration.
propertyid readonly id: stringpropertyversion readonly version: numbermethoddecode decode(payload: unknown): OperationType[]payload: unknown
methodencode encode(operations: readonly OperationType[]): OTEncodedValueoperations: readonly OperationType[]
methodinvert invert(operations: readonly OperationType[]): OperationType[]operations: readonly OperationType[]
methodisOperation isOperation(operation: OTOperation): operationoperation: OTOperation
- interfaceUpdateAttrsOTOperationsource ↗
-
interface UpdateAttrsOTOperation extends OTOperationUpdates one node attribute and carries both previous and next values.
- interfaceUpdateCellOTOperationsource ↗
-
interface UpdateCellOTOperation<T> extends OTOperationUpdates a single cell and carries both forward and previous values.
- interfaceUpdateRectOTOperationsource ↗
-
interface UpdateRectOTOperation extends OTOperationReplaces a rectangle's two corner points.
- 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 | ResizeColOTOperationEvery 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 | RichDocOTOperationBuilt-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 | UpdateAttrsOTOperationEvery operation understood by RichDocOT.
- typeRichDocOTOperationPathsource ↗
-
type RichDocOTOperationPath = OTOperationPathPath 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(): TransactionOTRegistryCreates 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): ResizeColOTOperationCreates a semantic column-resize operation.
path: readonly number[]value: number | nullpreviousValue: number | null
- functioncreateResizeRowOTOperationsource ↗
-
createResizeRowOTOperation(path: readonly number[], value: number | null, previousValue: number | null): ResizeRowOTOperationCreates a semantic row-resize operation.
path: readonly number[]value: number | nullpreviousValue: 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 | nullpreviousValue: T | nullintent: "relocation"
- functioncreateUpdateRectOTOperationsource ↗
-
createUpdateRectOTOperation(path: readonly number[], start: readonly [number, number], end: readonly [number, number]): UpdateRectOTOperationCreates 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): operationNarrows an operation to any operation understood by MatrixOT.
operation: OTOperation
- functionisMatrixStructureOperationsource ↗
-
isMatrixStructureOperation<T>(operation: OTOperation): operationNarrows an OT operation to one of the row or column structure operations.
operation: OTOperation
- functionisResizeColOperationsource ↗
-
isResizeColOperation(operation: OTOperation): operationNarrows an OT operation to a column-resize operation with a present action payload.
operation: OTOperation
- functionisResizeRowOperationsource ↗
-
isResizeRowOperation(operation: OTOperation): operationNarrows an OT operation to a row-resize operation with a present action payload.
operation: OTOperation
- functionisUpdateCellOperationsource ↗
-
isUpdateCellOperation<T>(operation: OTOperation): operationNarrows an OT operation to an update-cell operation with a present action payload.
operation: OTOperation
- functionOTClonesource ↗
-
OTClone<T>(object: T): TDeep-clones JSON-compatible OT payloads before mutation or composition.
object: T
- functiontransactionOTTypeKeysource ↗
-
transactionOTTypeKey(definition: Pick<TransactionOTDefinition, "id" | "version">): stringReturns the wire identity of one versioned OT family.
definition: Pick<TransactionOTDefinition, "id" | "version">
- interfaceNodeSchemasource ↗
-
interface NodeSchemaPersisted 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?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text?: stringOptional text content for leaf text nodes.
propertytype type: stringDomain node type identifier.
- interfaceTextSchemasource ↗
-
interface TextSchema extends NodeSchemaPersisted 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?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text: stringOptional text content for leaf text nodes.
propertytypeinherited type: stringDomain node type identifier.
Package
@searsuite/sear-domain-state
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: stringStable state name used when registering state in plugin/core maps.
methodaddListener addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methoddispatch dispatch(operations: StateOperation[]): thisApplies 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 | nullReads 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
Package
@searsuite/sear-domain-transaction
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: TransactionPluginKeyoperations: 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: TransactionPluginKeyStable plugin key for Transaction.
methodaddOperation addOperation(operations: OperationType[]): voidAdds the operation.
operations: OperationType[]
methodgetMeta getMeta<T>(key: string): T | undefinedReturns the meta.
key: string
methodsetMeta setMeta(key: string, value: unknown): thisUpdates the meta.
key: stringvalue: unknown
- variableTRANSACTION_ORIGIN_META_KEYsource ↗
-
TRANSACTION_ORIGIN_META_KEY: "transaction:origin"Metadata key describing where a transaction originated.
- enumTransactionOriginsource ↗
-
enum TransactionOriginStable transaction origins observed by cross-cutting runtime features.
- interfaceTransactionPluginKeysource ↗
-
interface TransactionPluginKeyStable owner key accepted by a transaction.
propertykey readonly key: stringString identity for the plugin or state owner receiving this transaction.
Package
@searsuite/sear-domain-transation
Legacy compatibility entry point for transaction pipelines and operation ownership.
- enumTransactionOriginsource ↗
-
enum TransactionOriginStable transaction origins observed by cross-cutting runtime features.
- 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: TransactionPluginKeyStable plugin key for Transaction.
methodaddOperation addOperation(operations: OperationType[]): voidAdds the operation.
operations: OperationType[]
methodgetMeta getMeta<T>(key: string): T | undefinedReturns the meta.
key: string
methodsetMeta setMeta(key: string, value: unknown): thisUpdates the meta.
key: stringvalue: unknown
- interfaceTransactionPluginKeysource ↗
-
interface TransactionPluginKeyStable owner key accepted by a transaction.
propertykey readonly key: stringString 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: TransactionPluginKeyoperations: readonly OperationType[]meta: Readonly<Record<string, unknown>>
Package
@searsuite/sear-domain-workbook
Stable workbook and Sheet identities, structure, and document-state contracts.
- classWorkbookErrorsource ↗
-
class WorkbookError extends SearErrorError thrown when workbook state or workbook references violate their domain contract.
constructorconstructor WorkbookError(code: WorkbookErrorCode, message: string, details?: SearErrorDetails): WorkbookErrorCreates a WorkbookError instance.
code: WorkbookErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: WorkbookErrorCodeStable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- interfaceAddWorkbookSheetInputsource ↗
-
interface AddWorkbookSheetInput<SheetState>Input accepted by
addWorkbookSheet.propertyindex readonly index?: numberOptional insertion index; defaults to appending after the current last sheet.
propertysheet readonly sheet: WorkbookSheetDescriptorDescriptor for the sheet being inserted.
propertysheetState readonly sheetState: SheetStateInitial state payload for the inserted sheet.
- interfaceCreateWorkbookDocumentStateInputsource ↗
-
interface CreateWorkbookDocumentStateInput<SheetState>Input accepted by
createWorkbookDocumentState.propertyid readonly id: stringStable 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 MoveWorkbookSheetInputInput accepted by
moveWorkbookSheet. - interfaceParsedWorkbookFormulaReferencesource ↗
-
interface ParsedWorkbookFormulaReferenceParsed workbook formula reference bound to a stable sheet id.
- interfaceRemoveWorkbookSheetInputsource ↗
-
interface RemoveWorkbookSheetInputInput accepted by
removeWorkbookSheet.propertysheetId readonly sheetId: stringSheet id to remove.
- interfaceRenameWorkbookSheetInputsource ↗
-
interface RenameWorkbookSheetInputInput accepted by
renameWorkbookSheet. - interfaceUpdateWorkbookSheetStateInputsource ↗
-
interface UpdateWorkbookSheetStateInput<SheetState>Input accepted by
updateWorkbookSheetState.propertysheetId readonly sheetId: stringSheet id whose state payload should be replaced.
propertysheetState readonly sheetState: SheetStateReplacement sheet state payload.
- interfaceWorkbookCellReferencesource ↗
-
interface WorkbookCellReferenceQualified cell reference used by workbook-level formulas and dependency graphs.
- interfaceWorkbookColumnRangeReferencesource ↗
-
interface WorkbookColumnRangeReferenceQualified whole-column range reference used by workbook-level formulas.
- interfaceWorkbookDocumentStatesource ↗
-
interface WorkbookDocumentState<SheetState>Workbook state containing sheet metadata plus per-sheet state payloads.
SheetStateis generic so this package stays independent from sheet, render,
formula, and assembly packages.propertyid readonly id: stringStable 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 WorkbookRangeReferenceQualified rectangular range reference used by workbook-level formulas.
- interfaceWorkbookRowRangeReferencesource ↗
-
interface WorkbookRowRangeReferenceQualified whole-row range reference used by workbook-level formulas.
- interfaceWorkbookSheetDescriptorsource ↗
-
interface WorkbookSheetDescriptorWorkbook-level sheet metadata.
The containingWorkbookDocumentState.sheetsarray is the only source of sheet order;
descriptors intentionally do not carry a separate order field.propertycolor readonly color?: stringOptional UI tab color owned by the workbook host.
propertyid readonly id: stringStable 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: stringUnique user-facing sheet name used when displaying formula references.
- typeWorkbookCellKeysource ↗
-
type WorkbookCellKey = stringSerialized 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 | WorkbookRowRangeReferenceAny workbook-qualified formula reference supported by the workbook protocol.
- typeWorkbookIdsource ↗
-
type WorkbookId = stringStable workbook identifier used by host-level workbook registries.
- typeWorkbookReferenceDiagnosticFieldsource ↗
-
type WorkbookReferenceDiagnosticField = WorkbookReferenceField | templateLiteral | templateLiteralDiagnostic 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 = stringStable 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): stringCreates 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[]): stringFormats a parsed workbook formula reference with the current user-facing sheet name.
reference: ParsedWorkbookFormulaReferencesheets: readonly WorkbookSheetDescriptor[]
- functionformatWorkbookCellReferencesource ↗
-
formatWorkbookCellReference(reference: WorkbookCellReference, sheetName: string): stringFormats a workbook-qualified cell reference using a caller-provided sheet name.
reference: WorkbookCellReferencesheetName: string
- functionformatWorkbookRangeReferencesource ↗
-
formatWorkbookRangeReference(reference: WorkbookRangeReference, sheetName: string): stringFormats a workbook-qualified rectangular range reference using a caller-provided sheet name.
reference: WorkbookRangeReferencesheetName: string
- functiongetWorkbookSheetDescriptorsource ↗
-
getWorkbookSheetDescriptor<SheetState>(state: WorkbookDocumentState<SheetState>, sheetId: string): WorkbookSheetDescriptor | nullReturns 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 | nullReturns one sheet state payload, or null when the sheet is absent.
state: WorkbookDocumentState<SheetState>sheetId: string
- functionisValidWorkbookReferencesource ↗
-
isValidWorkbookReference(reference: unknown): referenceReports whether an unknown value is any valid workbook-qualified formula reference.
reference: unknown
- functionisWorkbookCellReferencesource ↗
-
isWorkbookCellReference(reference: unknown): referenceReports whether an unknown value is a valid workbook-qualified cell reference.
reference: unknown
- functionisWorkbookColumnRangeReferencesource ↗
-
isWorkbookColumnRangeReference(reference: unknown): referenceReports whether an unknown value is a valid workbook-qualified whole-column range reference.
reference: unknown
- functionisWorkbookRangeReferencesource ↗
-
isWorkbookRangeReference(reference: unknown): referenceReports whether an unknown value is a valid workbook-qualified rectangular range reference.
reference: unknown
- functionisWorkbookRowRangeReferencesource ↗
-
isWorkbookRowRangeReference(reference: unknown): referenceReports 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): WorkbookColumnRangeReferenceNormalizes a whole-column reference so the start column is before the end column.
reference: WorkbookColumnRangeReference
- functionnormalizeWorkbookRangeReferencesource ↗
-
normalizeWorkbookRangeReference(reference: WorkbookRangeReference): WorkbookRangeReferenceNormalizes a range reference so start is top-left and end is bottom-right.
reference: WorkbookRangeReference
- functionnormalizeWorkbookRowRangeReferencesource ↗
-
normalizeWorkbookRowRangeReference(reference: WorkbookRowRangeReference): WorkbookRowRangeReferenceNormalizes a whole-row reference so the start row is before the end row.
reference: WorkbookRowRangeReference
- functionparseWorkbookCellKeysource ↗
-
parseWorkbookCellKey(key: string): WorkbookCellReferenceParses a string produced by
createWorkbookCellKeyback into a cell reference.key: string
- functionparseWorkbookFormulaReferencesource ↗
-
parseWorkbookFormulaReference(reference: string, sheets: readonly WorkbookSheetDescriptor[]): ParsedWorkbookFormulaReferenceParses a displayed workbook reference such as Sheet2!A1 or Sheet2!A1:B5 into a stable sheet-id range.
reference: stringsheets: readonly WorkbookSheetDescriptor[]
- functionquoteWorkbookSheetNamesource ↗
-
quoteWorkbookSheetName(name: string): stringReturns 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
- 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>): voidValidates 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
Small dependency-free values and contracts shared across SearSuite packages.
- enumBuildInStateNamesource ↗
-
enum BuildInStateNameEnumeration 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 SearDocumentTypeEnumeration 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 visualizationenum memberSEAR_DOC SEAR_DOC: 1General document type (text processor)
enum memberSEAR_FLOW SEAR_FLOW: 6Flowchart and diagram document type
enum memberSEAR_MIND SEAR_MIND: 5Mind map document type for hierarchical visualization
enum memberSEAR_SHEET SEAR_SHEET: 2Spreadsheet document type with cell-based data
enum memberSEAR_SLIDE SEAR_SLIDE: 4Slide presentation document type
enum memberSEAR_TABLE SEAR_TABLE: 3Table document type for structured tabular data
enum memberUNKNOWN UNKNOWN: 0Unknown 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 queriesconstructorconstructor 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): booleanInserts 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): booleanRemoves 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: numberMaximum number of points this node can hold before subdividing.
propertydivided divided: booleanFlag indicating whether this node has been subdivided into children.
propertynortheast northeast: IQuadTreeNode<T> | nullNortheast child node (upper-right quadrant).
propertynorthwest northwest: IQuadTreeNode<T> | nullNorthwest child node (upper-left quadrant).
propertypoints points: NodeData<T>[]Array of data points stored in this node (before subdivision).
propertysoutheast southeast: IQuadTreeNode<T> | nullSoutheast child node (lower-right quadrant).
propertysouthwest southwest: IQuadTreeNode<T> | nullSouthwest child node (lower-left quadrant).
methodcontains contains(boundary: { height: number; width: number; x: number; y: number }, point: Point): booleanChecks 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>): booleanInserts 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 }): booleanChecks 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 BReturnstrue 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): booleanRemoves 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(): voidSubdivides 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 SearKeySearKey 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 objectsExampleconst 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): SearKeyCreates 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: stringThe 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): voidExports the console logging utility for displaying plugin name and version.
Exampleimport { printNameAndVersion } from '@searsuite/sear-foundation-common';\n * // Display plugin info on initialization printNameAndVersion('SearEditor', '1.2.3'); // Console output: \" SearEditor v1.2.3 \" with stylingname: 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
Editor-scoped dependency injection with explicit ownership and borrowed instances.
- classContainersource ↗
-
class ContainerDependency 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(): Containerpropertytypes readonly types: Map<any, any>Registered dependency tokens owned by this container.
methodaddDependency addDependency(parent: symbol, dependency: string | symbol): voidAdds the dependency.
parent: symboldependency: string | symbol
methodcreateLazy createLazy<T>(identifier: string): (): TCreates the lazy.
identifier: string
methoddestroy destroy(): voidmethoddispose dispose(): voidmethodgetDependency getDependency(): voidReturns the dependency.
methodgetDependencyGraphText getDependencyGraphText(): voidReturns the dependency graph text.
methodhasBinding hasBinding(identifier: string | symbol): booleanReturns whether this container has an explicit local binding for an identifier.
identifier: string | symbol
methodhasSingleton hasSingleton(identifier: string | symbol): booleanReturns whether a singleton has already been materialized for an identifier.
identifier: string | symbol
methodregister register<T>(identifier: Identifier<T>, clazz: Constructor<T>, scope?: Scope): voidRegisters the value.
identifier: Identifier<T>clazz: Constructor<T>scope: Scope
methodregisterBorrowedInstance registerBorrowedInstance<T>(identifier: Identifier<T>, instance: T): voidBinds 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): voidRegisters the factory.
identifier: Identifier<T>factory: FactoryFunction<T>scope: Scope
methodregisterInstance registerInstance<T>(identifier: Identifier<T>, instance: T): voidRegisters the instance.
identifier: Identifier<T>instance: T
methodregisterTypes registerTypes(module: symbol, types: { }): voidRegisters the types.
module: symboltypes: { }
methodreset reset(): voidReleases created resources and removes every registration from this container.
methodresolve resolve<T>(identifier: string | symbol): TResolves a dependency from this container and its parent scope.
identifier: string | symbol
- variableINJECT_METADATA_KEYsource ↗
-
INJECT_METADATA_KEY: typeof INJECT_METADATA_KEYMetadata key storing constructor parameter injection tokens.
- variableINJECTABLE_METADATA_KEYsource ↗
-
INJECTABLE_METADATA_KEY: typeof INJECTABLE_METADATA_KEYMetadata key that marks a class as resolvable by the DI container.
- functionInjectsource ↗
-
Inject(identifier: unknown): ParameterDecoratorRecords 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(): ClassDecoratorMarks a class as injectable by the DI container.
ReturnsClass decorator that records injectable metadata.
Package
@searsuite/sear-foundation-error
Structured public errors with stable codes and diagnostic details.
- classSearErrorsource ↗
-
class SearError extends ErrorBase 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 overridecode.constructorconstructor SearError(message: string, details?: SearErrorDetails, options?: ErrorOptions): SearErrorCreates a SearError instance.
message: stringdetails: SearErrorDetailsoptions: ErrorOptions
propertycauseinherited cause?: unknownpropertycode readonly code: stringStable machine-readable identifier for this error category.
propertydetails readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- typeSearErrorDetailssource ↗
-
type SearErrorDetails = Readonly<Record<string, unknown>>Machine-readable context attached to framework errors.
Package
@searsuite/sear-foundation-keymap
Portable keyboard key values, chords, and binding contracts.
- enumKeyboardKeysource ↗
-
enum KeyboardKeyStandard 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
Injectable timing, events, view geometry, identifiers, and host diagnostics.
- classBrowserPlatformsource ↗
-
class BrowserPlatform extends PlatformBrowser 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(): BrowserPlatformpropertysymbolstatic readonly symbol: symbolDI token for resolving BrowserPlatform.
methodaddEventListener addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): voidRegisters a host event listener and returns an idempotent disposer.
target: unknowntype: stringlistener: (event: unknown): voidoptions: PlatformEventListenerOptions
methodcancelAnimationFrame cancelAnimationFrame(handle: number): voidCancels a previously scheduled host animation frame.
handle: number
methodclearInterval clearInterval(handle: number): voidCancels a repeating host timer.
handle: number
methodclearTimeout clearTimeout(handle: number): voidCancels a one-shot host timer.
handle: number
methodcreateId createId(prefix?: string): stringCreates a Web-platform client/runtime identifier.
prefix: string
methodcurrentDateTime currentDateTime(): numberReturns the host wall-clock time as Unix milliseconds.
methodnow now(): numberReturns the host's monotonic time in milliseconds.
methodobserveResize observeResize(target: unknown, callback: (size: { height: number; width: number }): void): (): voidObserves host-view size changes and returns an idempotent disposer.
target: unknowncallback: (size: { height: number; width: number }): void
methodqueueMicrotask queueMicrotask(callback: (): void): voidSchedules a callback in the host microtask queue.
callback: (): void
methodreadViewOffset readViewOffset(target: unknown): PlatformViewOffsetReads an element's document-relative viewport offset.
target: unknown
methodrequestAnimationFrame requestAnimationFrame(callback: PlatformFrameRequestCallback): numberSchedules a callback for the next host animation frame.
callback: PlatformFrameRequestCallback
methodsetInterval setInterval(callback: (): void, ms: number): numberUpdates the interval.
callback: (): voidms: number
methodsetTimeout setTimeout(callback: (): void, ms: number): numberUpdates the timeout.
callback: (): voidms: number
methodtoLowerCaseinherited toLowerCase(value: string): stringConverts text to lowercase without consulting the host's locale.
value: string
methodwarn warn(message: string, ...details: unknown[]): voidReports a non-fatal diagnostic through the host warning channel.
message: stringdetails: unknown[]
- classFileDownloadsource ↗
-
class FileDownloadReplaceable host capability for saving generated files.
constructorconstructor FileDownload(): FileDownloadpropertysymbolstatic readonly symbol: typeof symbolToken for host composition roots that register the capability through DI.
methoddestroy destroy(): voidReleases pending host resources, idempotently.
methoddownload download(request: FileDownloadRequest): voidInitiates one host file save.
request: FileDownloadRequest
- classHeadlessPlatformsource ↗
-
class HeadlessPlatform extends PlatformPlatform adapter for Node and other environments without a UI surface.
constructorconstructor HeadlessPlatform(): HeadlessPlatformpropertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessPlatform.
methodaddEventListener addEventListener(_target: unknown, _type: string, _listener: (event: unknown): void): (): voidRegisters a host event listener and returns an idempotent disposer.
_target: unknown_type: string_listener: (event: unknown): void
methodcancelAnimationFrame cancelAnimationFrame(handle: number): voidCancels a previously scheduled host animation frame.
handle: number
methodclearInterval clearInterval(handle: number): voidCancels a repeating host timer.
handle: number
methodclearTimeout clearTimeout(handle: number): voidCancels a one-shot host timer.
handle: number
methodcreateId createId(prefix?: string): stringCreates a deterministic process-local runtime identifier.
prefix: string
methodcurrentDateTime currentDateTime(): numberReturns the host wall-clock time as Unix milliseconds.
methodnow now(): numberReturns the host's monotonic time in milliseconds.
methodobserveResize observeResize(_target: unknown, _callback: (size: { height: number; width: number }): void): (): voidObserves host-view size changes and returns an idempotent disposer.
_target: unknown_callback: (size: { height: number; width: number }): void
methodqueueMicrotask queueMicrotask(callback: (): void): voidSchedules a callback in the host microtask queue.
callback: (): void
methodreadViewOffset readViewOffset(_target: unknown): PlatformViewOffsetHeadless targets have no host-space offset.
_target: unknown
methodrequestAnimationFrame requestAnimationFrame(callback: PlatformFrameRequestCallback): numberSchedules a callback for the next host animation frame.
callback: PlatformFrameRequestCallback
methodsetInterval setInterval(callback: (): void, ms: number): numberUpdates the interval.
callback: (): voidms: number
methodsetTimeout setTimeout(callback: (): void, ms: number): numberUpdates the timeout.
callback: (): voidms: number
methodtoLowerCaseinherited toLowerCase(value: string): stringConverts text to lowercase without consulting the host's locale.
value: string
methodwarn warn(message: string, ...details: unknown[]): voidReports a non-fatal diagnostic through the host warning channel.
message: stringdetails: unknown[]
- classHeadlessWebServiceClientsource ↗
-
class HeadlessWebServiceClient extends WebServiceClientNode/headless fetch adapter. Hosts remain responsible for SSRF and network policy.
constructorconstructor HeadlessWebServiceClient(): HeadlessWebServiceClientpropertysymbolstatic readonly symbol: symbolDI 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: stringoptions: WebServiceRequestOptions
- classPlatformsource ↗
-
class Platformconstructorconstructor Platform(): Platformpropertysymbolstatic readonly symbol: symbolDI token for resolving Platform.
methodaddEventListener addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): voidAdds a platform event listener and returns its disposer.
target: unknowntype: stringlistener: (event: unknown): voidoptions: PlatformEventListenerOptions
methodcancelAnimationFrame cancelAnimationFrame(handle: number): voidCancels a previously scheduled host animation frame.
handle: number
methodclearInterval clearInterval(handle: number): voidCancels a repeating host timer.
handle: number
methodclearTimeout clearTimeout(handle: number): voidCancels a one-shot host timer.
handle: number
methodcreateId createId(prefix?: string): stringCreates a process- or session-unique identifier for runtime protocols.
prefix: string
methodcurrentDateTime currentDateTime(): numberReturns the host wall-clock time as Unix milliseconds.
methodnow now(): numberReturns the host's monotonic time in milliseconds.
methodobserveResize observeResize(target: unknown, callback: (size: { height: number; width: number }): void): (): voidObserves the CSS-pixel size of a platform render target.
target: unknowncallback: (size: { height: number; width: number }): void
methodqueueMicrotask queueMicrotask(callback: (): void): voidSchedules a callback in the host microtask queue.
callback: (): void
methodreadViewOffset readViewOffset(target: unknown): PlatformViewOffsetReads a render target's offset in host view coordinates.
target: unknown
methodrequestAnimationFrame requestAnimationFrame(callback: PlatformFrameRequestCallback): numberSchedules a callback for the next host animation frame.
callback: PlatformFrameRequestCallback
methodsetInterval setInterval(callback: (): void, ms: number): numberUpdates the interval.
callback: (): voidms: number
methodsetTimeout setTimeout(callback: (): void, ms: number): numberUpdates the timeout.
callback: (): voidms: number
methodtoLowerCase toLowerCase(value: string): stringConverts text to lowercase without consulting the host's locale.
value: string
methodwarn warn(message: string, ...details: unknown[]): voidReports a non-fatal platform warning.
message: stringdetails: unknown[]
- classWebFetchServiceClientsource ↗
-
class WebFetchServiceClient extends WebServiceClientBrowser fetch adapter. CORS and host security policy remain browser-owned concerns.
constructorconstructor WebFetchServiceClient(): WebFetchServiceClientpropertysymbolstatic readonly symbol: symbolDI 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: stringoptions: WebServiceRequestOptions
- classWebFileDownloadsource ↗
-
class WebFileDownload extends FileDownloadWeb file-save adapter; native elements and object URLs never enter the neutral contract.
constructorconstructor WebFileDownload(platform: Platform): WebFileDownloadReceives the owning host's timer adapter explicitly.
platform: Platform
propertysymbolstaticinherited readonly symbol: typeof symbolToken for host composition roots that register the capability through DI.
methoddestroy destroy(): voidCancels pending release callbacks and revokes every retained object URL.
methoddownload download(request: FileDownloadRequest): voidInitiates a native file save and tracks its delayed resource release.
request: FileDownloadRequest
- classWebServiceClientsource ↗
-
class WebServiceClientPlatform-neutral asynchronous HTTP boundary for service-backed formulas.
constructorconstructor WebServiceClient(): WebServiceClientpropertysymbolstatic readonly symbol: symbolDI 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: stringoptions: WebServiceRequestOptions
- classWebServiceErrorsource ↗
-
class WebServiceError extends SearErrorPublic error raised by a web-service adapter.
constructorconstructor WebServiceError(message: string, details?: Readonly<Record<string, unknown>>): WebServiceErrormessage: stringdetails: Readonly<Record<string, unknown>>
propertycauseinherited cause?: unknownpropertycode readonly code: "WEB_SERVICE_REQUEST_FAILED"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classWebXmlXPathEvaluatorsource ↗
-
class WebXmlXPathEvaluator extends XmlXPathEvaluatorBrowser-native XML/XPath adapter backed by DOMParser and XPathEvaluator.
constructorconstructor WebXmlXPathEvaluator(): WebXmlXPathEvaluatorpropertysymbolstatic readonly symbol: symbolDI token for resolving the editor-local XML/XPath adapter.
methodevaluateinherited evaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluationEvaluates an XPath expression against one XML document.
xml: stringxpath: stringoptions: XmlXPathOptions
- classXmlXPathErrorsource ↗
-
class XmlXPathError extends SearErrorPublic failure raised by XML/XPath adapters.
constructorconstructor XmlXPathError(code: XmlXPathErrorCode, message: string, details?: Readonly<Record<string, unknown>>): XmlXPathErrorcode: XmlXPathErrorCodemessage: stringdetails: Readonly<Record<string, unknown>>
propertycauseinherited cause?: unknownpropertycodeinherited readonly code: XmlXPathErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classXmlXPathEvaluatorsource ↗
-
class XmlXPathEvaluatorPlatform-neutral XML/XPath execution boundary used by formula adapters.
constructorconstructor XmlXPathEvaluator(): XmlXPathEvaluatorpropertysymbolstatic readonly symbol: symbolDI token for resolving the editor-local XML/XPath adapter.
methodevaluate evaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluationEvaluates an XPath expression against one XML document.
xml: stringxpath: stringoptions: XmlXPathOptions
- interfaceFileDownloadRequestsource ↗
-
interface FileDownloadRequestHost-neutral request to save an in-memory file.
- interfacePlatformEventListenerOptionssource ↗
-
interface PlatformEventListenerOptionsEvent-routing options supported by host adapters.
propertycapture readonly capture?: booleanReceives propagated events before target handlers can consume them.
- interfacePlatformViewOffsetsource ↗
-
interface PlatformViewOffset - interfaceWebServiceCancellationsource ↗
-
interface WebServiceCancellationHost-neutral request cancellation.
- interfaceWebServiceRequestOptionssource ↗
-
interface WebServiceRequestOptionspropertycancellation readonly cancellation?: WebServiceCancellationpropertyheaders readonly headers?: Readonly<Record<string, string>> - interfaceWebServiceResponsesource ↗
-
interface WebServiceResponseFully consumed response; platform-native response objects never escape an adapter.
- interfaceXmlXPathEvaluationsource ↗
-
interface XmlXPathEvaluationResult values in document order; selected nodes contribute their string values.
propertyvalues readonly values: readonly string[] - interfaceXmlXPathOptionssource ↗
-
interface XmlXPathOptionsExplicit prefix bindings used by an XPath expression.
propertynamespaces readonly namespaces?: Readonly<Record<string, string>> - typePlatformFrameRequestCallbacksource ↗
-
type PlatformFrameRequestCallback = (time: number): voidPlatform 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): booleanValidates absolute HTTP(S) URL syntax without enforcing host-owned network access policy.
url: string
Package
@searsuite/sear-foundation-range
Range primitives and normalization helpers used by Sheet and Doc domains.
- classRangesource ↗
-
class RangeParses 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): RangeConstructs a range from an A1-style string.
range: string- Range string in the form A1:B2.
memberrange range: unknownmembershape shape: unknownmethodcontains contains(x: number, y: number): booleanTests 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(): stringSerializes the range back to A1 notation.
methodcolumnToNumberstatic columnToNumber(column: string): numberConverts 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): stringConverts 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
Immutable rectangle geometry and intersection utilities.
- classPositionRectsource ↗
-
class PositionRect<T>Represents a rectangle in absolute position space.
UnlikeRect, 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: numberThe rectangle height measured from
y.propertykey key: T | undefinedOptional external identifier associated with this rectangle.
propertywidth readonly width: numberThe rectangle width measured from
x.propertyx x: numberHorizontal origin of the rectangle.
propertyy y: numberVertical 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): booleanChecks 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): voidMoves 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>): booleanChecks 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>): booleanReturns
truewhen 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: unknownmethodaddPositionRect addPositionRect(positionRect: PositionRect<PositionRectKeyType>): voidRegisters a rectangle with the manager.
positionRect: PositionRect<PositionRectKeyType>- Rectangle instance to track.
methodupdatePosition updatePosition(newX: number, newY: number): voidMoves 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: TValue returned for every cell covered by the range.
membershape shape: unknownmethodaddCol addCol(colIndex: number): thisExtends the range to the right when a column is inserted inside it.
colIndex: number- Inserted column index.
methodaddRow addRow(rowIndex: number): thisExtends 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): voidIterates 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 | nullReturns 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): thisContracts the range when a column is removed from inside it.
colIndex: number- Removed column index.
methodremoveRow removeRow(rowIndex: number): thisContracts 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
RangeRectinstances 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: unknownmethodaddRange addRange(range: RangeRect<T>): voidAdds a range to the manager.
range: RangeRect<T>- Range definition to register.
methodgetValue getValue(row: number, col: number): T | nullResolves the value for a cell by shallow-merging all matching ranges.
When no range covers the target cell,nullis 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 RectDescribes 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]): RectCreates a rectangle from two corner points.
rect: [Point, Point]- The rectangle bounds as
[[startRow, startCol], [endRow, endCol]].
membershape shape: unknownmemberEmptystatic Empty: unknownmethodaddCol addCol(colIndex: number): thisExpands or shifts the rectangle after a column insertion.
colIndex: number- The inserted column index.
methodaddRow addRow(rowIndex: number): thisExpands 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(): RectCreates an independent copy of this value and its mutable data.
methodforEach forEach(callbackfn: (rowIndex: number, colIndex: number): void): voidIterates 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): PointReturns one of the stored corner points.
index: 0 | 10for the start point,1for the end point.
methodlockMutations lockMutations(): voidPrevents changes through methods or coordinates retained from a committed state.
methodremoveCol removeCol(colIndex: number): thisShrinks or shifts the rectangle after a column removal.
colIndex: number- The removed column index.
methodremoveRow removeRow(rowIndex: number): thisShrinks 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]): RectReplaces the rectangle with a new set of bounds.
rect: [Point, Point]- The new rectangle coordinates.
methodcontainsstatic contains(rectA: Rect, rectB: Rect): booleanChecks whether
rectAfully containsrectB.rectA: Rect- The outer candidate rectangle.
rectB: Rect- The inner candidate rectangle.
methodfindBoundingRectanglestatic findBoundingRectangle(rects: Rect[]): RectComputes the smallest rectangle that encloses all provided rectangles.
rects: Rect[]- The rectangles to merge into a bounding box.
- interfacePositionRectPropssource ↗
-
interface PositionRectPropsPlain-object shape of a rectangle in pixel or layout coordinates.
- 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: PositionRectPropsZero-sized rectangle used as the default empty layout region.
- functioncreateEmptyRectsource ↗
-
createEmptyRect(): RectPublic 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
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: symbolDI token for resolving DataStorage.
methoddelete delete(key: U): voidDeletes the requested entry.
key: U
methodget get(key: U): T | undefinedReturns the value.
key: U
methodset set(key: U, value: T): voidUpdates the value.
key: Uvalue: T
- classDataStorageFactorysource ↗
-
class DataStorageFactory<T>Factory contract for creating data storage instances.
constructorconstructor DataStorageFactory<T>(): DataStorageFactory<T>methodcreate create(): TCreates 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: symbolDI token for resolving DataStorage.
methoddelete delete(key: U): voidDeletes the requested entry.
key: U
methodget get(key: U): T | undefinedReturns the value.
key: U
methodset set(key: U, value: T): voidUpdates the value.
key: Uvalue: 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
Idempotent subscription ownership and reverse-order disposal utilities.
- classObservationErrorsource ↗
-
class ObservationError extends SearErrorPublic error raised when an observation definition or registry lifecycle contract is violated.
constructorconstructor ObservationError(code: ObservationErrorCode, message: string, details?: SearErrorDetails): ObservationErrorCreates an observation contract error with structured diagnostic details.
code: ObservationErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: ObservationErrorCodeStable observation-specific error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classObservationRegistrysource ↗
-
class ObservationRegistryEditor-local typed observation registry exposed to plugins and third-party hosts.
constructorconstructor ObservationRegistry(platform?: Platform): ObservationRegistryCreates a registry that reports isolated host listener failures through the platform.
platform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the registry owned by one editor instance.
methoddestroy destroy(): voidDisposes every active host subscription and removes all registered sources.
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void, runListener?: ObservationListenerScope, detachValue?: (value: unknown, definition: ObservationDefinition<unknown>): unknown): voidRequires editor command dispatch for source registration changes after assembly.
assertWrite: (): voidrunListener: ObservationListenerScopedetachValue: (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>): ValueReturns the current snapshot for a state observation without subscribing.
definition: StateObservationDefinition<Value>
methodhas has(definition: string | ObservationDefinition<unknown>): booleanReturns whether an observation id is registered in this editor instance.
definition: string | ObservationDefinition<unknown>
methodregister register<Value>(definition: EventObservationDefinition<Value>, source: ObservationSource<Value>): (): voidregister<Value>(definition: StateObservationDefinition<Value>, source: StateObservationSource<Value>): (): voidRegisters 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): (): voidSubscribes to a typed observation and returns an idempotent disposer.
definition: ObservationDefinition<Value>listener: (value: Value): void
- classSubscriptionManagersource ↗
-
class SubscriptionManagerOwns 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): SubscriptionManagerCreates a SubscriptionManager instance.
platform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SubscriptionManager.
methoddestroy destroy(): voidReleases resources owned by SubscriptionManager.
methodobserveResize observeResize(target: unknown, callback: (size: { height: number; width: number }): void): (): voidObserves host-view size changes and returns an idempotent disposer.
target: unknowncallback: (size: { height: number; width: number }): void
methodtrack track(dispose: (): void): (): voidTracks 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.
- interfaceObservationDefinitionsource ↗
-
interface ObservationDefinition<Value>Typed identity imported by publishers and consumers of one observation.
propertyid readonly id: stringStable globally unique id used for registration diagnostics.
propertykind readonly kind: ObservationKindDelivery model that determines whether a current snapshot is available.
propertyvalueType readonly valueType?: ValueCompile-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): (): voidRegisters 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.
- interfaceStateObservationSourcesource ↗
-
interface StateObservationSource<Value> extends ObservationSource<Value>Produces a current snapshot plus future values for a state observation.
methodgetSnapshot getSnapshot(): ValueReturns the current immutable state snapshot.
methodsubscribeinherited subscribe(listener: (value: Value): void): (): voidRegisters 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
Typed theme tokens and editor-local theme access.
Package
@searsuite/sear-foundation-user-interaction
Portable interaction-state contracts for host input and editor behavior.
- classUserInteractionServicesource ↗
-
class UserInteractionServiceHost-provided, editor-local requests for a user's decision.
constructorconstructor UserInteractionService(): UserInteractionServicepropertysymbolstatic readonly symbol: symbolmethodconfirm confirm(request: UserConfirmationRequest): Promise<boolean>Resolves true only when the user explicitly confirms.
request: UserConfirmationRequest
methoddestroy destroy(): voidCancels pending requests and releases host resources.
- classWebUserInteractionServicesource ↗
-
class WebUserInteractionService extends UserInteractionServiceBrowser dialog adapter for explicit user confirmations.
constructorconstructor WebUserInteractionService(documentRef?: Pick<Document, "body" | "createElement">): WebUserInteractionServicedocumentRef: Pick<Document, "body" | "createElement">
propertysymbolstaticinherited readonly symbol: symbolmethodconfirm confirm(request: UserConfirmationRequest): Promise<boolean>Resolves true only when the user explicitly confirms.
request: UserConfirmationRequest
methoddestroy destroy(): voidCancels pending requests and releases host resources.
- interfaceUserConfirmationRequestsource ↗
-
interface UserConfirmationRequestA host-owned confirmation with explicit, localizable presentation text.
propertycancelLabel readonly cancelLabel: stringpropertyconfirmLabel readonly confirmLabel: stringpropertymessage readonly message: stringpropertytitle readonly title: string
Package
@searsuite/sear-foundation-utils
General-purpose algorithms and guards without editor-domain ownership.
- variableStandardColorsource ↗
-
StandardColor: { Black: "#000000" }Standard opaque colors shared by renderers and host adapters.
- functioncolumnIndexToLabelsource ↗
-
columnIndexToLabel(columnIndex: number): stringConverts a zero-based column index to an Excel-style label (A, Z, AA, ...).
ExamplecolumnIndexToLabel(0) // 'A' columnIndexToLabel(26) // 'AA'columnIndex: number
- functioncolumnLabelToIndexsource ↗
-
columnLabelToIndex(label: string): numberConverts an Excel-style column label (A, Z, AA, ...) to a zero-based index.
ExamplecolumnLabelToIndex('A') // 0 columnLabelToIndex('AA') // 26label: string
- functionerfsource ↗
-
erf(value: number): numberEvaluates erf without the error floor of short polynomial approximations.
value: number
- functionerfcsource ↗
-
erfc(value: number): numberEvaluates erfc directly in the positive tail to preserve small probabilities.
value: number
- functiongetRandomColorsource ↗
-
getRandomColor(): templateLiteral | nullGenerates 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): valueType guard for formula error-shaped values.
value: T
- functionisFormulaTextsource ↗
-
isFormulaText<T>(value: T): valueReturns whether a value carries text-specific formula coercion semantics.
value: T
- functionisNumbersource ↗
-
isNumber(value: unknown): valueReturns whether a value is a JavaScript number.
value: unknown
- functionreleaseColorsource ↗
-
releaseColor(color: templateLiteral): booleanRelease 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): numberConverts a formula value for aggregate functions; non-numeric values are 0.
value: unknown
Package
@searsuite/sear-plugin-alignment
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]): AlignmentMatrixCreates 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: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: LeftDefault horizontal alignment returned for cells without an explicit override.
membernnzinherited nnz: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: string | null[]): AlignmentMatrixAdds 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): thisStores 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): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: string | null[]): AlignmentMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: string): string): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: string): string
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): AlignmentMatrixDeletes 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): AlignmentMatrixDeletes 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>[]): AlignmentMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: string, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: string, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: string, col: number): void
methodfromDenseinherited fromDense(denseArray: string | null[][]): AlignmentMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: string | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): string | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: string): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: string- The default value to return for missing elements
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): AlignmentMatrixSwaps 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): AlignmentMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetAlignmentPluginConstructs the alignment plugin.
state: SheetAlignmentPluginState- Shared alignment state.
propertydepthinherited readonly depth: numberDraw 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseAlignment 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: PluginKeyStable plugin key shared by all alignment plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the alignment plugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: SheetAlignmentPluginState, transaction: Transaction): SheetAlignmentPluginState | nullApplies 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 | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullAlignment data has no render-time configuration.
methodgetStateinherited getState(): SheetAlignmentPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetAlignmentPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetAlignmentPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetAlignmentPluginStatetransaction: Transaction
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidContributes horizontal alignment to the shared Sheet cell visual pipeline.
registry: SheetCellVisualReaderRegistrycontext: SheetCellVisualReaderRegistrationContext
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidTransfers only this owner's persisted formats.
registry: SheetFormatTransferRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetAlignmentPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetAlignmentPluginStatecommitToken: object
- classSheetVerticalAlignmentPluginsource ↗
-
class SheetVerticalAlignmentPlugin extends Plugin<unknown, CellProperties, SheetVerticalAlignmentPluginState>Plugin that owns vertical cell alignment data, commands, and structural projections.
constructorconstructor SheetVerticalAlignmentPlugin(state: SheetVerticalAlignmentPluginState): SheetVerticalAlignmentPluginConstructs the vertical alignment plugin around a shared sparse matrix.
state: SheetVerticalAlignmentPluginState
propertydepthinherited readonly depth: numberDraw 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseAlignment 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: PluginKeyStable plugin key shared by all vertical alignment plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the vertical alignment plugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: SheetVerticalAlignmentPluginState, transaction: Transaction): SheetVerticalAlignmentPluginState | nullApplies direct vertical alignment and structural matrix operations.
pluginState: SheetVerticalAlignmentPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullVertical alignment data has no render-time configuration.
methodgetStateinherited getState(): SheetVerticalAlignmentPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetVerticalAlignmentPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetVerticalAlignmentPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetVerticalAlignmentPluginStatetransaction: Transaction
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidContributes vertical alignment to the shared Sheet cell visual pipeline.
registry: SheetCellVisualReaderRegistrycontext: SheetCellVisualReaderRegistrationContext
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidTransfers only this owner's persisted formats.
registry: SheetFormatTransferRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetVerticalAlignmentPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetVerticalAlignmentPluginStatecommitToken: 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]): VerticalAlignmentMatrixCreates a matrix and compacts explicit default-alignment entries.
data: VerticalAlignmentMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: CenterDefault vertical alignment returned for cells without an explicit override.
membernnzinherited nnz: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: string | null[]): VerticalAlignmentMatrixAdds 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): thisStores an explicit non-default override, or removes it for centered alignment.
row: numbercol: numbervalue: string
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: string | null[]): VerticalAlignmentMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: string): string): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: string): string
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): VerticalAlignmentMatrixDeletes 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): VerticalAlignmentMatrixDeletes 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>[]): VerticalAlignmentMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: string, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: string, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: string, col: number): void
methodfromDenseinherited fromDense(denseArray: string | null[][]): VerticalAlignmentMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: string | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): string | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: string): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: string- The default value to return for missing elements
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): VerticalAlignmentMatrixSwaps 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): VerticalAlignmentMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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 AlignmentMatrixDataSerialized sparse entries accepted by AlignmentMatrix.
- interfaceSheetAlignmentPluginStatesource ↗
-
interface SheetAlignmentPluginStateState owned by SheetAlignmentPlugin.
propertycellAlignments cellAlignments: AlignmentMatrixSparse matrix containing non-left or cell-type-derived horizontal alignment overrides.
- interfaceSheetHorizontalAlignmentCommandDataSourcesource ↗
-
interface SheetHorizontalAlignmentCommandDataSource extends AlignmentCommandRangeDataSourceState access required by the horizontal alignment command.
propertytarget readonly target: PluginKeymethodgetColumnCountinherited getColumnCount(): numbermethodgetRowCountinherited getRowCount(): numbermethodreadCellAlignment readCellAlignment(row: number, column: number): SheetHorizontalAlignment | nullrow: numbercolumn: number
- interfaceSheetSetRangeAlignmentInputsource ↗
-
interface SheetSetRangeAlignmentInput extends SheetRangeInputPublic input for setting horizontal alignment in a range.
- interfaceSheetSetRangeVerticalAlignmentInputsource ↗
-
interface SheetSetRangeVerticalAlignmentInput extends SheetRangeInputPublic input for setting vertical alignment in a range.
propertyanchorinherited readonly anchor: SheetCellPointOne corner of the target range.
propertyfocusinherited readonly focus: SheetCellPointOpposite corner of the target range.
propertyverticalAlignment readonly verticalAlignment: SheetVerticalAlignment - interfaceSheetVerticalAlignmentCommandDataSourcesource ↗
-
interface SheetVerticalAlignmentCommandDataSource extends AlignmentCommandRangeDataSourceState access required by the vertical alignment command.
propertytarget readonly target: PluginKeymethodgetColumnCountinherited getColumnCount(): numbermethodgetRowCountinherited getRowCount(): numbermethodreadCellVerticalAlignment readCellVerticalAlignment(row: number, column: number): SheetVerticalAlignment | nullrow: numbercolumn: number
- interfaceSheetVerticalAlignmentPluginStatesource ↗
-
interface SheetVerticalAlignmentPluginStateState owned by SheetVerticalAlignmentPlugin.
propertycellVerticalAlignments cellVerticalAlignments: VerticalAlignmentMatrixSparse matrix containing non-centered vertical alignment overrides.
- interfaceVerticalAlignmentMatrixDatasource ↗
-
interface VerticalAlignmentMatrixDataSerialized sparse entries accepted by VerticalAlignmentMatrix.
- 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: SheetSetRangeAlignmentInputdataSource: SheetHorizontalAlignmentReader
- functioncreateSetRangeVerticalAlignmentOperationssource ↗
-
createSetRangeVerticalAlignmentOperations(input: SheetSetRangeVerticalAlignmentInput, dataSource: SheetVerticalAlignmentReader): UpdateCellOTOperation<SheetVerticalAlignment>[]Creates sparse UpdateCell operations for vertical alignment.
input: SheetSetRangeVerticalAlignmentInputdataSource: SheetVerticalAlignmentReader
- functionreadSheetCellAlignmentssource ↗
-
readSheetCellAlignments(dataEngine: DataEngine): AlignmentMatrix | nullReads horizontal cell alignment published by SheetAlignmentPlugin.
dataEngine: DataEngine
- functionreadSheetCellVerticalAlignmentssource ↗
-
readSheetCellVerticalAlignments(dataEngine: DataEngine): VerticalAlignmentMatrix | nullReads vertical cell alignment published by SheetVerticalAlignmentPlugin.
dataEngine: DataEngine
- functionregisterSheetHorizontalAlignmentCommandsource ↗
-
registerSheetHorizontalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetHorizontalAlignmentCommandDataSource): voidRegisters the horizontal alignment command owned by SheetAlignmentPlugin.
commands: SheetCommandBusdataSource: SheetHorizontalAlignmentCommandDataSource
- functionregisterSheetVerticalAlignmentCommandsource ↗
-
registerSheetVerticalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetVerticalAlignmentCommandDataSource): voidRegisters the vertical alignment command owned by SheetVerticalAlignmentPlugin.
commands: SheetCommandBusdataSource: SheetVerticalAlignmentCommandDataSource
- functionassertSheetHorizontalAlignmentsource ↗
-
assertSheetHorizontalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet horizontal alignments.
value: unknown
- functionassertSheetVerticalAlignmentsource ↗
-
assertSheetVerticalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet vertical alignments.
value: unknown
- functionisSheetHorizontalAlignmentsource ↗
-
isSheetHorizontalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet horizontal alignment.
value: unknown
- functionisSheetVerticalAlignmentsource ↗
-
isSheetVerticalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet vertical alignment.
value: unknown
- enumSheetHorizontalAlignmentsource ↗
-
enum SheetHorizontalAlignmentHorizontal alignment values supported by the built-in Sheet alignment feature.
- enumSheetVerticalAlignmentsource ↗
-
enum SheetVerticalAlignmentVertical alignment values supported by the built-in Sheet alignment feature.
Package
@searsuite/sear-plugin-cell-border
Independent Sheet cell borders, commands, rendering, history and collaboration.
- classCellBorderErrorsource ↗
-
class CellBorderError extends SearErrorTyped error for invalid border commands or document values.
constructorconstructor CellBorderError(message: string, details?: Record<string, unknown>): CellBorderErrormessage: stringdetails: Record<string, unknown>
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_CELL_BORDER_INVALID"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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]): CellBorderMatrixdata: CellBorderMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]): CellBorderMatrixAdds 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): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: number- The row index.
column: numbervalue: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null- The value to add.
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]): CellBorderMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches 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): thisCopies 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): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): CellBorderMatrixDeletes 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): CellBorderMatrixDeletes 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>[]): CellBorderMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (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): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null, col: number): void
methodfromDenseinherited fromDense(denseArray: Readonly<Partial<Record<unknown, unknown>>> | null[][]): CellBorderMatrixConverts 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): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetItem getItem(row: number, column: number): Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: 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): thisStores an isolated edge record or clears its sparse entry.
row: numbercolumn: numbervalue: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): CellBorderMatrixSwaps 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): CellBorderMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetCellBorderPluginConstructs the plugin around its independently owned sparse border matrix.
state: SheetCellBorderPluginState
propertydepth readonly depth: 2Border 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseMultiple extension layers may share the same depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>Document-state export contribution for cell borders.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key shared by all cell-border plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the cell-border plugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: SheetCellBorderPluginState, transaction: Transaction): SheetCellBorderPluginState | nullApplies direct border and structural matrix operations.
pluginState: SheetCellBorderPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullCell-border data has no render-time configuration.
methodgetStateinherited getState(): SheetCellBorderPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetCellBorderPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetCellBorderPluginState
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetCellBorderPluginStatetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidTransfers only this owner's persisted formats.
registry: SheetFormatTransferRegistry
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidPublishes the border owner's typed read-only queries.
queries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetCellBorderPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetCellBorderPluginStatecommitToken: object
- interfaceBorderLinePaintsource ↗
-
interface BorderLinePaintPaint projection of one persisted border style.
- interfaceCellBorderMatrixDatasource ↗
-
interface CellBorderMatrixDataSerialized sparse border entries.
- interfaceSheetBorderStrokesource ↗
-
interface SheetBorderStrokeOne explicit persisted border stroke.
- interfaceSheetCellBorderPluginStatesource ↗
-
interface SheetCellBorderPluginStateState owned by SheetCellBorderPlugin.
propertycellBorders cellBorders: CellBorderMatrixSparse matrix containing explicit per-cell edge strokes.
- interfaceSheetSetRangeCellBorderInputsource ↗
-
interface SheetSetRangeCellBorderInput extends SheetRangeInputPublic range-border input.
- 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 | nullReads the border owner's projection, when that plugin is installed.
dataEngine: DataEngine
Package
@searsuite/sear-plugin-cell-editor
Sheet cell-edit sessions, text input, selection, and embedded-editor coordination.
- enumSheetCellEditorExitReasonsource ↗
-
enum SheetCellEditorExitReasonEnumerates SheetCellEditorExitReason values.
enum memberCancel Cancel: "cancel"enum memberCommit Commit: "commit"enum memberOutsideClick OutsideClick: "outside-click" - enumSheetCellEditorInteractionNamesource ↗
-
enum SheetCellEditorInteractionNameEnumerates SheetCellEditorInteractionName values.
enum memberSessionEnded SessionEnded: "edit-session-ended"enum memberSessionStarted SessionStarted: "edit-session-started" - enumSheetCellEditorKindsource ↗
-
enum SheetCellEditorKindEnumerates SheetCellEditorKind values.
enum memberCell Cell: "cell" - enumSheetCellEditorPipelineNamesource ↗
-
enum SheetCellEditorPipelineNameObservable 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 SheetCellEditorPipelineStepNameEnumerates 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 HighlighterFormula implementation of the editor's generic Highlighter contract.
constructorconstructor FormulaReferenceHighlighter(parser: IFormulaParser, configEngine: ConfigEngine): FormulaReferenceHighlighterCreates a FormulaReferenceHighlighter instance.
parser: IFormulaParserconfigEngine: ConfigEngine
propertysymbolstatic readonly symbol: symbolDI token for resolving FormulaReferenceHighlighter.
methodclear clear(): voidReleases any session-scoped resources. Stateless highlighters need not override this.
methodhighlight highlight(formula: string, context?: HighlightContext): HighlightingReturns highlighted segments for the supplied source range.
formula: stringcontext: HighlightContext
- classFormulaReferencePickServicesource ↗
-
class FormulaReferencePickServiceOptional workbook-owned bridge for references picked on another sheet.
constructorconstructor FormulaReferencePickService(): FormulaReferencePickServicepropertysymbolstatic readonly symbol: typeof symbolmethodcancelPendingPick cancelPendingPick(): voidmethodhasPendingPick hasPendingPick(): booleanmethodpick pick(start: Point, end: Point): voidstart: Pointend: Point
- classHighlightersource ↗
-
class HighlighterExtensible 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(): Highlighterpropertysymbolstatic readonly symbol: symbolDI token for resolving Highlighter.
methodclear clear(): voidReleases any session-scoped resources. Stateless highlighters need not override this.
methodhighlight highlight(text: string, context?: HighlightContext): HighlightingReturns highlighted segments for the supplied source range.
text: stringcontext: 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): SheetCellEditorPluginCreates a SheetCellEditorPlugin instance.
mergePlugin: SheetCellMergePluginselectionPlugin: SheetSelectionPlugintextInput: TextInputkeyboardRouter: KeyboardRouterpointerCapture: PointerCapturecursorRegistry: CursorRegistrycursorEngine: CursorEngineplatform: PlatformcommitStrategies: CellCommitStrategyRegistryhighlighter: Highlightercoordinates: CoordinateTransformerinteractionReducers: SheetInteractionReducerRegistryembeddedEditor: unknowncommands: SheetCommandBusformulaSourceProvider: IFormulaSourceProvidertextShaper: TextShapercellFormatLocaleProvider: ICellFormatLocaleProviderqueries: SheetQueryRegistryformulaParser: IFormulaParserinputValidation: SheetCellInputValidationRegistry
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertydefaultConfigstatic readonly defaultConfig: SheetCellEditorConfigDefault visual configuration for the inline cell editor.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for SheetCellEditorPlugin.
propertysymbolstatic readonly symbol: symbolDI token for resolving SheetCellEditorPlugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: EditorState, transaction: Transaction): EditorState | nullApplies a transaction to SheetCellEditorPlugin state.
pluginState: EditorStatetransaction: Transaction
methodbindCore bindCore(core: SearCoreSheet): voidBinds this plugin to the core owned by its editor-local container.
core: SearCoreSheet
methodbindFormulaRegistry bindFormulaRegistry(registry: IFunctionRegistry): voidBinds the editor-local registry after formula services have been assembled.
registry: IFunctionRegistry
methodbindReferencePickService bindReferencePickService(service: FormulaReferencePickService): voidBinds the optional parent-workbook reference picker.
service: FormulaReferencePickService
methodbindRuntimeServices bindRuntimeServices(container: Container): voidExplicitly binds services for isolated plugin tests or custom local assembly.
container: Container
methodcancelEdit cancelEdit(searCore: SearCoreSheet): voidCancels the active cell edit session without committing its draft.
searCore: SearCoreSheet
methodcommitEdit commitEdit(searCore: SearCoreSheet, fillSelection?: boolean): booleanCommits the active cell edit session through its owning command.
searCore: SearCoreSheetfillSelection: boolean
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetDocumentSelection getDocumentSelection(): DocSelectionReturns the active document selection for host diagnostics and adapters.
methodgetPluginConfig getPluginConfig(_searCore: SearCoreSheet): nullReturns the plugin config.
_searCore: SearCoreSheet
methodgetStateinherited getState(): EditorStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedState lockCommittedState(state: EditorState): voidLocks committed editor selection rectangles while staged clones stay writable.
state: EditorState
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClick onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): booleanHandles a double-click pointer event.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDown onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp onMouseUp(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
_searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidSynchronizes 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: EditorStatetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters the commands.
commands: SheetCommandBus
methodregisterConfig registerConfig(): { config: ConfigUnit<SheetCellEditorConfig>; key: PluginKey }[]Registers visual defaults for the inline cell editor.
methodregisterObservations registerObservations(observations: ObservationRegistry): voidPublishes formula authoring state through the editor's typed observation registry.
observations: ObservationRegistry
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidRegisters 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: SearCoreSheetoffset: { x: number; y: number }
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: EditorState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: EditorStatecommitToken: object
methodregisterServicesstatic registerServices(_context: { container: Container }): voidRegisters rich-document node types used by the sheet cell editor.
_context: { container: Container }
- interfaceCellRangeHighlightsource ↗
-
interface CellRangeHighlightA sheet rectangle rendered as part of an editor highlight.
- interfaceEditSessionEndedInteractionSignalsource ↗
-
interface EditSessionEndedInteractionSignal extends SheetInteractionSignalPublic contract for EditSessionEndedInteractionSignal.
- interfaceEditSessionStartedInteractionSignalsource ↗
-
interface EditSessionStartedInteractionSignal extends SheetInteractionSignalPublic contract for EditSessionStartedInteractionSignal.
- interfaceFormulaEditDraftsource ↗
-
interface FormulaEditDraftTransient formula draft retained while a workbook mounts another sheet.
propertyautoClosingParentheses readonly autoClosingParentheses?: readonly number[]propertycell readonly cell: PointpropertyselectionEnd readonly selectionEnd: numberpropertyselectionStart readonly selectionStart: numberpropertytext readonly text: string - interfaceFormulaInputAssistStatesource ↗
-
interface FormulaInputAssistStateCurrent formula-authoring suggestions and caret position in the host view.
propertyanchor readonly anchor: { x: number; y: number } | nullpropertydiagnostic readonly diagnostic: FormulaInputDiagnostic | nullpropertyselectedIndex readonly selectedIndex: numberpropertysignature readonly signature: FormulaSignature | nullpropertysuggestions readonly suggestions: readonly FormulaSuggestion[] - interfaceHighlightContextsource ↗
-
interface HighlightContextGeneric editor state that can influence a highlighter's presentation.
propertycursorOffset cursorOffset?: numberZero-based cursor position in the editor's plain-text content.
- interfaceHighlightingsource ↗
-
interface HighlightingPresentation-only output shared by all editor highlighters.
propertycellRanges cellRanges: SheetReferenceHighlight[]propertytextAttributes textAttributes: TextAttributeRange<Readonly<Record<string, unknown>>>[] - interfaceSheetBeginCellEditInputsource ↗
-
interface SheetBeginCellEditInputPublic input used to enter cell edit mode.
- interfaceSheetCancelCellEditInputsource ↗
-
interface SheetCancelCellEditInputPublic input used to cancel the active edit session.
propertyrestoreOriginalDocument readonly restoreOriginalDocument?: boolean - interfaceSheetCellEditorPointerInputsource ↗
-
interface SheetCellEditorPointerInputPointer selection update inside an active embedded editor.
- interfaceSheetCellEditSelectionInputsource ↗
-
interface SheetCellEditSelectionInputOptional selection change applied while committing an edit session.
- interfaceSheetCommitCellEditInputsource ↗
-
interface SheetCommitCellEditInputPublic input used to commit the active edit session.
propertyfillSelection readonly fillSelection?: booleanApplies the entered value to every cell in the current selected rectangle.
propertynextSelection readonly nextSelection?: SheetCellEditSelectionInputpropertypipelineName readonly pipelineName?: SheetCellEditorPipelineNamepropertyreason readonly reason?: SheetCellEditorExitReason - interfaceSheetDocumentCursorPositionInputsource ↗
-
interface SheetDocumentCursorPositionInputDocument cursor position inside the active cell editor session.
- interfaceSheetDocumentSelectionCommandInputsource ↗
-
interface SheetDocumentSelectionCommandInputDocument selection input expressed as anchor/head coordinates.
- interfaceSheetFormulaBarStatesource ↗
-
interface SheetFormulaBarStateSource text and transient edit selection for the active Sheet cell.
propertycell readonly cell: Point | nullpropertyediting readonly editing: booleanpropertyrange readonly range: { end: Point; start: Point } | nullpropertyselectionEnd readonly selectionEnd: numberpropertyselectionStart readonly selectionStart: numberpropertytext readonly text: string - interfaceSheetFormulaReferenceReplacementInputsource ↗
-
interface SheetFormulaReferenceReplacementInputFormula reference replacement while an edit session is active.
- interfaceSheetInlineStyleCommandInputsource ↗
-
interface SheetInlineStyleCommandInputInline text-style patch applied to the active embedded cell editor.
propertyattrs readonly attrs: Readonly<Record<string, unknown>> - interfaceSheetOpenCellEditorInputsource ↗
-
interface SheetOpenCellEditorInputCell target for opening an embedded edit session.
propertycolumn readonly column: numberpropertyreplaceContent readonly replaceContent?: booleanpropertyrow readonly row: number - interfaceSheetRangeTextStyleInputsource ↗
-
interface SheetRangeTextStyleInputpropertyattrs 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): stringFormats a selected grid rectangle as an A1 reference.
start: Pointend: PointsheetName: string
- functiongetCellEditableValuesource ↗
-
getCellEditableValue(cell: CellMatrixElement | null | undefined, coordinate?: { col: number; row: number }, formulaSourceProvider?: IFormulaSourceProvider | null): unknownReturns 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 | undefinedcoordinate: { col: number; row: number }formulaSourceProvider: IFormulaSourceProvider | null
- functionregisterSheetCellEditorInteractionReducerssource ↗
-
registerSheetCellEditorInteractionReducers(registry: SheetInteractionReducerRegistry): voidRegisters Cell Editor's local interaction projections once per DI container.
registry: SheetInteractionReducerRegistry
Package
@searsuite/sear-plugin-cell-fill
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]): CellFillMatrixCreates a sparse cell-fill matrix from serialized CSR data.
data: CellFillMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: templateLiteral | null[]): CellFillMatrixAdds 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): thisStores a fill color through the CSR API, removing the entry for null.
row: numbercol: numbervalue: templateLiteral | null
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: templateLiteral | null[]): CellFillMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: templateLiteral | null): templateLiteral | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: templateLiteral | null): templateLiteral | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): CellFillMatrixDeletes 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): CellFillMatrixDeletes 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>[]): CellFillMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: templateLiteral | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: templateLiteral | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: templateLiteral | null, col: number): void
methodfromDenseinherited fromDense(denseArray: templateLiteral | null[][]): CellFillMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: templateLiteral | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): templateLiteral | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: templateLiteral | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: templateLiteral | null- The default value to return for missing elements
methodsetItem setItem(row: number, col: number, value: templateLiteral | null): thisStores a fill color. Null is represented by removing the sparse entry.
row: numbercol: numbervalue: templateLiteral | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): CellFillMatrixSwaps 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): CellFillMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetCellFillPluginConstructs the plugin around a shared sparse fill matrix.
state: SheetCellFillPluginState
propertydepthinherited readonly depth: numberDraw 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseFill 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: PluginKeyStable plugin key shared by all cell-fill plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the cell-fill plugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: SheetCellFillPluginState, transaction: Transaction): SheetCellFillPluginState | nullApplies direct fill and structural matrix operations.
pluginState: SheetCellFillPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullCell-fill data has no render-time configuration.
methodgetStateinherited getState(): SheetCellFillPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetCellFillPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetCellFillPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetCellFillPluginStatetransaction: Transaction
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidContributes explicit fill colors to the shared Sheet cell visual pipeline.
registry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidTransfers only this owner's persisted formats.
registry: SheetFormatTransferRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetCellFillPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetCellFillPluginStatecommitToken: object
- interfaceCellFillMatrixDatasource ↗
-
interface CellFillMatrixDataSerialized sparse entries accepted by CellFillMatrix.
- interfaceSheetCellFillCommandDataSourcesource ↗
-
interface SheetCellFillCommandDataSource extends CellFillCommandRangeDataSourceState access required by the cell-fill command.
propertytarget readonly target: PluginKeymethodgetColumnCountinherited getColumnCount(): numbermethodgetRowCountinherited getRowCount(): numbermethodreadCellFill readCellFill(row: number, column: number): templateLiteral | nullrow: numbercolumn: number
- interfaceSheetCellFillPluginStatesource ↗
-
interface SheetCellFillPluginStateState owned by SheetCellFillPlugin.
propertycellFills cellFills: CellFillMatrixSparse matrix containing explicit cell fill colors.
- interfaceSheetSetRangeCellFillInputsource ↗
-
interface SheetSetRangeCellFillInput extends SheetRangeInputPublic input for setting or clearing cell fill in a range.
- typeSheetCellFillsource ↗
-
type SheetCellFill = HexColorA 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): valueAsserts 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: SheetSetRangeCellFillInputdataSource: SheetCellFillCommandDataSource
- functionisSheetCellFillsource ↗
-
isSheetCellFill(value: unknown): valueReturns whether a value is a supported cell fill color.
value: unknown
- functionreadSheetCellFillssource ↗
-
readSheetCellFills(dataEngine: DataEngine): CellFillMatrix | nullReads cell fills published by SheetCellFillPlugin.
dataEngine: DataEngine
- functionregisterSheetCellFillCommandsource ↗
-
registerSheetCellFillCommand(commands: SheetCommandBus, dataSource: SheetCellFillCommandDataSource): voidRegisters the cell-fill command owned by SheetCellFillPlugin.
commands: SheetCommandBusdataSource: SheetCellFillCommandDataSource
Package
@searsuite/sear-plugin-cell-format
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]): CellFormatMatrixdata: CellFormatMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: CellFormat | null[]): CellFormatMatrixAdds 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): thisStores a format through the CSR API.
row: numbercolumn: numberformat: CellFormat | null
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: CellFormat | null[]): CellFormatMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: CellFormat | null): CellFormat | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: CellFormat | null): CellFormat | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): CellFormatMatrixDeletes 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): CellFormatMatrixDeletes 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>[]): CellFormatMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: CellFormat | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: CellFormat | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: CellFormat | null, col: number): void
methodfromDenseinherited fromDense(denseArray: CellFormat | null[][]): CellFormatMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: CellFormat | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): CellFormat | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: CellFormat | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: CellFormat | null- The default value to return for missing elements
methodsetItem setItem(row: number, column: number, format: CellFormat | null): thisStores a validated format, or removes the sparse entry for null.
row: numbercolumn: numberformat: CellFormat | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): CellFormatMatrixSwaps 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): CellFormatMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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 SearErrorPublic error raised when persisted Sheet cell-format state is invalid.
constructorconstructor CellFormatMatrixError(message: string, details?: SearErrorDetails): CellFormatMatrixErrormessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_CELL_FORMAT_INVALID"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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): SheetCellFormatPluginstate: SheetCellFormatPluginState
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetCellFormatPluginState, SheetCellFormatPluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: symbolmemberkeyinherited key: unknownmethodapply apply(state: SheetCellFormatPluginState, transaction: Transaction): SheetCellFormatPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
state: SheetCellFormatPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetCellFormatPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetCellFormatPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetCellFormatPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetCellFormatPluginStatetransaction: Transaction
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidregistry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterFormatTransfers registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registry: SheetFormatTransferRegistry
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetCellFormatPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetCellFormatPluginStatecommitToken: object
- interfaceSheetAdjustRangeCellFormatDecimalsInputsource ↗
-
interface SheetAdjustRangeCellFormatDecimalsInput extends SheetRangeInputInput accepted by AdjustRangeCellFormatDecimalPlacesCommand.
- interfaceSheetCellFormatCommandDataSourcesource ↗
-
interface SheetCellFormatCommandDataSource extends CellFormatCommandRangeDataSourceState access required by the cell-format command.
propertytarget readonly target: PluginKeymethodgetColumnCountinherited getColumnCount(): numbermethodgetRowCountinherited getRowCount(): numbermethodreadCellFormat readCellFormat(row: number, column: number): CellFormat | nullrow: numbercolumn: number
- interfaceSheetCellFormatPluginStatesource ↗
-
interface SheetCellFormatPluginStateState exclusively owned by SheetCellFormatPlugin.
propertycellFormats readonly cellFormats: CellFormatMatrix - interfaceSheetCellFormatReadersource ↗
-
interface SheetCellFormatReaderRead-only projection of one Sheet's persisted cell-format matrix.
- interfaceSheetSetRangeCellFormatInputsource ↗
-
interface SheetSetRangeCellFormatInput extends SheetRangeInputInput accepted by SetRangeCellFormatCommand.
- 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: SheetAdjustRangeCellFormatDecimalsInputdataSource: SheetCellFormatCommandDataSource
- functioncreateSetRangeCellFormatOperationssource ↗
-
createSetRangeCellFormatOperations(input: SheetSetRangeCellFormatInput, dataSource: SheetCellFormatCommandDataSource): UpdateCellOTOperation<CellFormat>[]Creates sparse MatrixOT updates for one format range.
input: SheetSetRangeCellFormatInputdataSource: SheetCellFormatCommandDataSource
- functionreadSheetCellFormatssource ↗
-
readSheetCellFormats(dataEngine: DataEngine): CellFormatMatrix | nullReads the live format matrix published by SheetCellFormatPlugin.
dataEngine: DataEngine
- functionregisterSheetCellFormatCommandsource ↗
-
registerSheetCellFormatCommand(commands: SheetCommandBus, dataSource: SheetCellFormatCommandDataSource): voidRegisters the command owned by SheetCellFormatPlugin.
commands: SheetCommandBusdataSource: SheetCellFormatCommandDataSource
Package
@searsuite/sear-plugin-cell-highlight
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]): CellHighlightMatrixdata: CellHighlightMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: CellHighlightRule[] | null[]): CellHighlightMatrixAdds 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): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: number- The row index.
column: numberrules: CellHighlightRule[] | null
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: CellHighlightRule[] | null[]): CellHighlightMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: CellHighlightRule[] | null): CellHighlightRule[] | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: CellHighlightRule[] | null): CellHighlightRule[] | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): CellHighlightMatrixDeletes 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): CellHighlightMatrixDeletes 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>[]): CellHighlightMatrixApplies 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>): voidComputes 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: numbercolumn: number
methodforEachinherited forEach(callback: (value: CellHighlightRule[] | null, row: number, col: number): void): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: CellHighlightRule[] | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: CellHighlightRule[] | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: CellHighlightRule[] | null, col: number): void
methodfromDenseinherited fromDense(denseArray: CellHighlightRule[] | null[][]): CellHighlightMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: CellHighlightRule[] | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetItem getItem(row: number, column: number): CellHighlightRule[] | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodreplaceRules replaceRules(entries: readonly PositionedCellHighlightRule[]): voidentries: readonly PositionedCellHighlightRule[]
methodsetDefaultValueinherited setDefaultValue(value: CellHighlightRule[] | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: CellHighlightRule[] | null- The default value to return for missing elements
methodsetItem setItem(row: number, column: number, rules: CellHighlightRule[] | null): thisrow: numbercolumn: numberrules: CellHighlightRule[] | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): CellHighlightMatrixSwaps 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): CellHighlightMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetCellHighlightPluginstate: SheetCellHighlightPluginStatedependencies: CellHighlightDependencies
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetCellHighlightPluginState, SheetCellHighlightPluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(state: SheetCellHighlightPluginState, transaction: Transaction): SheetCellHighlightPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
state: SheetCellHighlightPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methoddispose dispose(): voidmethodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetCellHighlightPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinvalidateRangeStatistics invalidateRangeStatistics(cells?: readonly SheetDisplayedValueCoordinate[]): voidInvalidates derived range statistics after displayed values change.
cells: readonly SheetDisplayedValueCoordinate[]
methodlockCommittedStateinherited lockCommittedState(state: SheetCellHighlightPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetCellHighlightPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetCellHighlightPluginStatetransaction: Transaction
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidregistry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetCellHighlightPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetCellHighlightPluginStatecommitToken: object
- interfaceAddCellHighlightRuleInputsource ↗
-
interface AddCellHighlightRuleInput extends SheetRangeInputCommon range input accepted by explicit range commands.
- interfaceCellHighlightConditionsource ↗
-
interface CellHighlightConditionpropertycount readonly count?: numberpropertyincludeEqual readonly includeEqual?: booleanpropertykind readonly kind: CellHighlightKindpropertyoperator readonly operator?: CellHighlightValueOperator | CellHighlightTextOperatorpropertypercent readonly percent?: booleanpropertysecondValue readonly secondValue?: stringpropertyvalue readonly value?: string - interfaceCellHighlightRulesource ↗
-
interface CellHighlightRuleOne conditional rule stored at its range's top-left matrix cell.
- interfacePositionedCellHighlightRulesource ↗
-
interface PositionedCellHighlightRule - interfaceSheetCellHighlightPluginStatesource ↗
-
interface SheetCellHighlightPluginStatepropertycellHighlights 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 | nulldataEngine: DataEngine
Package
@searsuite/sear-plugin-cell-merge
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]): CellMergeMatrixdata: CellMergeMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: SheetCellMerge | null[]): CellMergeMatrixAdds 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): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: number- The row index.
column: numbervalue: SheetCellMerge | null- The value to add.
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: SheetCellMerge | null[]): CellMergeMatrixAdds 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(): thisDeep-clones stored merge values.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: SheetCellMerge | null): SheetCellMerge | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: SheetCellMerge | null): SheetCellMerge | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): CellMergeMatrixDeletes 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): CellMergeMatrixDeletes 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>[]): CellMergeMatrixApplies 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>): voidComputes 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 | nullFinds the merged range containing one sheet cell.
row: numbercolumn: number
methodforEachinherited forEach(callback: (value: SheetCellMerge | null, row: number, col: number): void): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: SheetCellMerge | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: SheetCellMerge | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: SheetCellMerge | null, col: number): void
methodfromDenseinherited fromDense(denseArray: SheetCellMerge | null[][]): CellMergeMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: SheetCellMerge | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetItem getItem(row: number, column: number): SheetCellMerge | nullReturns an isolated value so callers cannot mutate persisted matrix state.
row: numbercolumn: number
methodgetRanges getRanges(): Rect[]Returns all merged ranges in matrix traversal order.
methodgetRowinherited getRow(rowIndex: number): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodreplaceRanges replaceRanges(ranges: readonly Rect[]): thisRebuilds sparse entries from normalized ranges while preserving matrix shape.
ranges: readonly Rect[]
methodsetDefaultValueinherited setDefaultValue(value: SheetCellMerge | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: SheetCellMerge | null- The default value to return for missing elements
methodsetItem setItem(row: number, column: number, value: SheetCellMerge | null): thisStores or clears a merged range anchored at the supplied cell.
row: numbercolumn: numbervalue: SheetCellMerge | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): CellMergeMatrixSwaps 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): CellMergeMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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 SearErrorBase 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 overridecode.constructorconstructor SheetCellMergeConfirmationError(reason: "required" | "changed"): SheetCellMergeConfirmationErrorreason: "required" | "changed"
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_MERGE_CONFIRMATION_REQUIRED"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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): SheetCellMergePluginstate: SheetCellMergePluginStatecellContent: SheetCellMergeContentSource
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetCellMergePluginState, SheetCellMergePluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(pluginState: SheetCellMergePluginState, transaction: Transaction): SheetCellMergePluginState | nullApplies a transaction to plugin-owned state and returns the next state.
pluginState: SheetCellMergePluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetCellMergePluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodisMergedCell isMergedCell(row: number, column: number): Rect | nullrow: numbercolumn: number
methodlockCommittedStateinherited lockCommittedState(state: SheetCellMergePluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetCellMergePluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetCellMergePluginStatetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidMoves complete merged ranges and rejects moves that split a merge.
registry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetCellMergePluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetCellMergePluginStatecommitToken: object
- classSheetMergeRangeMoveErrorsource ↗
-
class SheetMergeRangeMoveError extends SearErrorA cell move that would split an existing merged range.
constructorconstructor SheetMergeRangeMoveError(context: SheetRangeMoveContext): SheetMergeRangeMoveErrorcontext: SheetRangeMoveContext
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_MOVE_SPLIT_MERGE"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSheetMergeStructureMoveErrorsource ↗
-
class SheetMergeStructureMoveError extends SearErrorA structure permutation would leave a merged range noncontiguous.
constructorconstructor SheetMergeStructureMoveError(range: readonly readonly number[][]): SheetMergeStructureMoveErrorrange: readonly readonly number[][]
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_STRUCTURE_MOVE_SPLIT_MERGE"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- interfaceCellMergeMatrixDatasource ↗
-
interface CellMergeMatrixDataSerialized CSR entries accepted by CellMergeMatrix.
- interfaceSheetCellMergesource ↗
-
interface SheetCellMergeSparse value stored only at the top-left cell of a merged range.
- interfaceSheetCellMergeActionDataSourcesource ↗
-
interface SheetCellMergeActionDataSource extends SheetCellMergeCommandDataSourcepropertycellContent readonly cellContent: SheetCellMergeContentSourcepropertytargetinherited readonly target: PluginKeymethodreadMatrixinherited readMatrix(): CellMergeMatrix - interfaceSheetCellMergeCommandDataSourcesource ↗
-
interface SheetCellMergeCommandDataSourcepropertytarget readonly target: PluginKeymethodreadMatrix readMatrix(): CellMergeMatrix - interfaceSheetCellMergeContentSourcesource ↗
-
interface SheetCellMergeContentSource - interfaceSheetCellMergePluginStatesource ↗
-
interface SheetCellMergePluginStatepropertycellMerges cellMerges: CellMergeMatrix - interfaceSheetMergeAnalysissource ↗
-
interface SheetMergeAnalysispropertydiscardedCells readonly discardedCells: readonly SheetMergeDiscardedCell[]propertyend readonly end: readonly [number, number]propertyretainedCell readonly retainedCell: SheetMergeDiscardedCell | nullpropertystart readonly start: readonly [number, number] - interfaceSheetMergeInputsource ↗
-
interface SheetMergeInput extends SheetRangeInputCommon range input accepted by explicit range commands.
propertyanchorinherited readonly anchor: SheetCellPointOne corner of the target range.
propertyconfirmation readonly confirmation?: SheetMergeAnalysispropertyfocusinherited readonly focus: SheetCellPointOpposite 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 | nullinput: SheetRangeInputdataSource: SheetCellMergeActionDataSource
- functioncreateMergeCellsOperationssource ↗
-
createMergeCellsOperations(input: SheetRangeInput, dataSource: SheetCellMergeCommandDataSource): UpdateCellOTOperation<SheetCellMerge>[]input: SheetRangeInputdataSource: SheetCellMergeCommandDataSource
- functioncreateUnmergeCellsOperationssource ↗
-
createUnmergeCellsOperations(input: SheetRangeInput, dataSource: SheetCellMergeCommandDataSource): UpdateCellOTOperation<SheetCellMerge>[]input: SheetRangeInputdataSource: SheetCellMergeCommandDataSource
- functionreadSheetCellMergessource ↗
-
readSheetCellMerges(dataEngine: DataEngine): CellMergeMatrix | nullReads merged-cell state published by SheetCellMergePlugin.
dataEngine: DataEngine
- functionregisterSheetCellMergeCommandssource ↗
-
registerSheetCellMergeCommands(commands: SheetCommandBus, dataSource: SheetCellMergeActionDataSource): voidRegisters every command owned by SheetCellMergePlugin.
commands: SheetCommandBusdataSource: SheetCellMergeActionDataSource
- functionregisterSheetCellMergeQueriessource ↗
-
registerSheetCellMergeQueries(queries: SheetQueryRegistry, dataSource: SheetCellMergeActionDataSource): voidqueries: SheetQueryRegistrydataSource: SheetCellMergeActionDataSource
Package
@searsuite/sear-plugin-checkbox
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): CheckboxCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiesmethodgetDisplayText getDisplayText(): stringPreserves 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 CellCommitStrategyDefinitionRetains checkbox identity for boolean edits, including cells governed by checkbox validation.
constructorconstructor CheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategyCreates 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: 1100Runs before numeric/formula/string fallbacks, only for checkbox targets.
methodcommit commit(context: CellCommitContext): { type: "string"; value: string } | { type: string; value: boolean } | nullProduces boolean cells, clears empty edits, or leaves permitted invalid warning input as text.
context: CellCommitContext
methodmatches matches(context: CellCommitContext): booleanReports whether this strategy owns the target's edit semantics.
context: CellCommitContext
- classCheckboxCellTypeDefinitionsource ↗
-
class CheckboxCellTypeDefinition extends CellTypeDefinitionAtomic catalog contribution for rendering, editing, display and clipboard behavior.
constructorconstructor CheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinitionBinds 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 | undefinedOptional format-transfer behavior owned by this cell type.
methodcreateRenderer createRenderer(): CellRendererDefinitionRegisters portable glyph rendering.
methodisStoredValue isStoredValue(cell: { value?: unknown }): booleanValidates persisted booleans before creating a glyph.
cell: { value?: unknown }
- classCheckboxErrorsource ↗
-
class CheckboxError extends SearErrorCheckbox-specific public error with structured context.
constructorconstructor CheckboxError(code: CheckboxErrorCode, message: string, details?: SearErrorDetails): CheckboxErrorCreates a feature diagnostic.
code: CheckboxErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycodeinherited readonly code: CheckboxErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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): CheckboxGlyphNodeConstructs a new Node<T> instance with specified properties and position.
Updates the boundary in the positionRectStorage if necessary.positionRect: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(context: RenderContext): voidClears this node's bounds from a raster context using stroke padding.
context: RenderContext- Render context to clear.
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidDraws the node into the hit-test context unless the node is visual-only.
context: RenderContext- Hit render context.
methoddrawScene drawScene(context: RenderContext, _clip?: ClipRegion): voidPaints the symbol using paths supported by every render adapter.
context: RenderContext_clip: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<CellProperties<boolean>> | nullFinds 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>> | nullFinds 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): voidRemoves 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): CheckboxGlyphNodeRegisters 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>>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<CellProperties<boolean>>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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): SheetCheckboxPluginInstalls all type capabilities atomically into the owning editor's registries.
options: SheetCheckboxOptions
propertydepth readonly depth: -25Intercepts 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseStateless input features need no duplicate-depth warning.
propertysymbolstatic readonly symbol: typeof symbolEditor-local DI token.
memberkeyinherited key: unknownmethodapply apply(): nullThe feature never owns or directly applies cell state.
methoddestroy destroy(): voidRestores all replaced capabilities and releases handlers idempotently.
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullNo render configuration is contributed.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClick onDblClick(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidConsumes glyph double-clicks so they do not enter text editing.
_core: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDown onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidChanges a glyph through typed selection and toggle commands, never through direct matrix mutation.
_core: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidPublishes sparse range-state reads.
queries: SheetQueryRegistry
methodregisterState registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }No independent document state is registered.
methodrender render(): nullGlyphs are rendered by the catalog's ordinary cell renderer.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
- interfaceCheckboxCellValuesource ↗
-
interface CheckboxCellValue extends CellMatrixElementA checkbox's persisted boolean state.
propertyformulainherited formula?: stringFormula 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: booleanBoolean used directly by formula semantics.
- interfaceCheckboxCellWritesource ↗
-
interface CheckboxCellWritePlanned update owned by the ordinary cell-data plugin.
- interfaceCheckboxRangeStatussource ↗
-
interface CheckboxRangeStatusRead-only aggregate of existing checkbox states.
- interfaceInsertCheckboxesInputsource ↗
-
interface InsertCheckboxesInput extends SheetRangeInputConverts empty or explicit boolean cells; replacement of other content requires opt-in.
propertyanchorinherited readonly anchor: SheetCellPointOne corner of the target range.
propertychecked readonly checked?: booleanOptional forced initial state; otherwise existing boolean states are retained.
propertyfocusinherited readonly focus: SheetCellPointOpposite corner of the target range.
propertyreplaceExisting readonly replaceExisting?: booleanExplicitly replace other persisted content.
- interfaceSheetCheckboxOptionssource ↗
-
interface SheetCheckboxOptionsEditor-local dependencies; checkbox state stays in the cell-data owner.
propertycatalog readonly catalog: CellTypeCatalogCell-type extension catalog.
propertycursor readonly cursor?: CursorRegistryOptional editor-local cursor registry.
propertyformulas readonly formulas?: CellFormulaValueConverterRegistryFormula converter registry, when formula support is installed.
propertyinputValidation readonly inputValidation?: SheetCellInputValidationRegistryShared cell-edit validation registry.
methodbeforeToggle beforeToggle(): booleanAllows the composition root to commit or reject an active edit before pointer toggling.
methodcreateTransaction createTransaction(writes: readonly CheckboxCellWrite[]): TransactionCreates 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): voidVisits persisted sparse entries inside the inclusive selection.
range: SheetRangeInputvisit: (cell: CellMatrixElement | null, row: number, column: number): void
methodhasCheckboxRule hasCheckboxRule(row: number, column: number): booleanReports a checkbox validation rule, including cells currently showing warning text.
row: numbercolumn: number
methodreadCell readCell(row: number, column: number): CellMatrixElement | nullReads current persisted cell values.
row: numbercolumn: 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: numbercolumn: numbertext: 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: 10000Maximum 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): stringFormats the boolean display, editor and clipboard representation.
value: boolean
- functionisCheckboxCellsource ↗
-
isCheckboxCell(cell: CellMatrixElement | null | undefined): cellReports whether a persisted value is a well-formed checkbox.
cell: CellMatrixElement | null | undefined
- functionnormalizeCheckboxRangesource ↗
-
normalizeCheckboxRange(input: SheetRangeInput, shape: readonly [number, number]): SheetRangeInputValidates and orders a public range without limiting sparse read traversal by viewport.
input: SheetRangeInputshape: readonly [number, number]
- functionparseCheckboxTextsource ↗
-
parseCheckboxText(text: string): boolean | nullConverts explicit boolean editor text without coercing numbers or other strings.
text: string
Package
@searsuite/sear-plugin-clear-style
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): SheetClearStylePluginoptions: SheetClearStyleOptions
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(): nullApplies a transaction to plugin-owned state and returns the next state.
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: 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(): nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
- interfaceSheetClearStyleOptionssource ↗
-
interface SheetClearStyleOptionsEditor-local dependencies provided by the owning composition root.
- variableClearRangeStylesCommandsource ↗
-
ClearRangeStylesCommand: SheetCommandDefinition<SheetRangeInput, SheetCommandResult>Clears explicit formatting from an inclusive rectangular selection, preserving cell data.
Package
@searsuite/sear-plugin-clipboard
Type-neutral Sheet clipboard traversal, serialization, and paste commands.
- enumSheetPasteModesource ↗
-
enum SheetPasteModeSelects which structured clipboard channels are applied by a paste command.
- classDefaultSheetClipboardCodecsource ↗
-
class DefaultSheetClipboardCodec extends SheetClipboardCodecDefault codec that delegates cell serialization to the cell-type registry.
constructorconstructor DefaultSheetClipboardCodec(cellCodecs: CellClipboardCodecRegistry): DefaultSheetClipboardCodeccellCodecs: CellClipboardCodecRegistry
methoddecode decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRangepayload: SheetClipboardPayloadcontext: SheetClipboardDecodeContext
methodencode encode(range: SheetRangeBounds, source: SheetClipboardDataSource): SheetClipboardPayloadrange: SheetRangeBoundssource: SheetClipboardDataSource
- classInMemorySheetClipboardsource ↗
-
class InMemorySheetClipboard extends SheetClipboardNode-safe clipboard used when a host does not expose system clipboard I/O.
constructorconstructor InMemorySheetClipboard(): InMemorySheetClipboardpropertysymbolstaticinherited readonly symbol: typeof symbolmethodread read(): Promise<SheetClipboardPayload | null>methodwrite write(payload: SheetClipboardPayload): Promise<void>payload: SheetClipboardPayload
- classSheetClipboardsource ↗
-
class SheetClipboardPlatform-neutral clipboard abstraction. Implementations own system I/O.
constructorconstructor SheetClipboard(): SheetClipboardpropertysymbolstatic readonly symbol: typeof symbolmethodread read(): Promise<SheetClipboardPayload | null>methodwrite write(payload: SheetClipboardPayload): Promise<void>payload: SheetClipboardPayload
- classSheetClipboardErrorsource ↗
-
class SheetClipboardError extends SearErrorPublic error raised when a clipboard command cannot satisfy its contract.
constructorconstructor SheetClipboardError(code: SheetClipboardErrorCode, message: string, details?: SearErrorDetails): SheetClipboardErrorcode: SheetClipboardErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: SheetClipboardErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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): SheetClipboardPluginsource: SheetClipboardDataSourcecodec: SheetClipboardCodec
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply 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 | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns 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(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: object
- interfaceSheetClipboardCodecsource ↗
-
interface SheetClipboardCodecCodec extension point for clipboard envelope and external formats. Cell types register their own handlers separately.
methoddecode decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRangepayload: SheetClipboardPayloadcontext: SheetClipboardDecodeContext
methodencode encode(range: SheetRangeBounds, source: SheetClipboardDataSource): SheetClipboardPayloadrange: SheetRangeBoundssource: SheetClipboardDataSource
- interfaceSheetClipboardCommandResultsource ↗
-
interface SheetClipboardCommandResult extends SheetCommandResultResult 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: SheetClipboardPayloadpropertypipelineinherited readonly pipeline: PipelinePipeline containing transaction, render, interaction and local-action steps.
propertyrange readonly range: SheetClipboardRangeInput - interfaceSheetClipboardDataSourcesource ↗
-
interface SheetClipboardDataSourceData source required by the clipboard plugin; selection and storage stay replaceable.
propertyformatTarget readonly formatTarget: PluginKeypropertytarget readonly target: PluginKeymethodgetColumnCount getColumnCount(): numbermethodgetRowCount getRowCount(): numbermethodgetSelection getSelection(): SheetRangeBounds | nullmethodreadCell readCell(row: number, column: number): CellMatrixElement | nullrow: numbercolumn: number
methodreadCellFormat readCellFormat(row: number, column: number): CellFormat | nullrow: numbercolumn: number
- interfaceSheetClipboardDecodeContextsource ↗
-
interface SheetClipboardDecodeContextContext supplied to codecs so formula-aware implementations can rebase references on paste.
propertytarget readonly target: SheetClipboardCellPoint - interfaceSheetClipboardDecodedRangesource ↗
-
interface SheetClipboardDecodedRangeDecoded value and format matrices ready for parallel paste transactions.
- interfaceSheetClipboardPayloadsource ↗
-
interface SheetClipboardPayloadPlatform-neutral clipboard data. It is transient and is not a persistence envelope.
propertyplainText readonly plainText: stringPlain text representation suitable for external applications.
propertystructured readonly structured?: SheetClipboardStructuredPayloadOptional editor-native representation preserving cell type and metadata.
- interfaceSheetClipboardRangeInputsource ↗
-
interface SheetClipboardRangeInputInclusive range accepted by clipboard commands.
- interfaceSheetClipboardStructuredPayloadsource ↗
-
interface SheetClipboardStructuredPayloadEditor-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: SheetClipboardCellPointOriginal top-left coordinate, supplied to cell-type paste codecs.
propertyversion readonly version: 3 - interfaceSheetCopyRangeInputsource ↗
-
interface SheetCopyRangeInputOptional explicit range; omitted means the current editor selection.
propertyrange readonly range?: SheetClipboardRangeInput - interfaceSheetPasteRangeInputsource ↗
-
interface SheetPasteRangeInputInput for pasting a previously decoded or host-read clipboard payload.
- 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: 3Current version of the transient structured sheet clipboard payload.
- variableSheetClipboardCodecSymbolsource ↗
-
SheetClipboardCodecSymbol: typeof SheetClipboardCodecSymbolDI token for the editor-local clipboard codec.
- variableSheetClipboardDataSourceSymbolsource ↗
-
SheetClipboardDataSourceSymbol: typeof SheetClipboardDataSourceSymbolDI 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 AbstractSheetClipboardPlatform-neutral clipboard abstraction. Implementations own system I/O.
constructorconstructor SheetClipboard(): SheetClipboardpropertysymbolstatic readonly symbol: typeof symbolmethodread 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
Editor bridges that connect committed collaborative transactions to host transports.
- classCollaborationChannelsource ↗
-
class CollaborationChannel extends CollaborationSessionLong-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">): CollaborationChanneltransport: CollabTransport | (): CollabTransportplatform: Pick<Platform, "warn" | "createId">
methodapplyExternalEvent applyExternalEvent(event: CollaborationExternalEvent): voidApplies one transport event while the owning editor dispatches its command.
event: CollaborationExternalEvent
methodattachRemoteApplier attachRemoteApplier(applier: CollaborationRemoteOperationApplier): (): voidAttaches 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(): voidmethoddisconnect disconnect(): voidmethodenforceCommandBoundary enforceCommandBoundary(assertWrite: (): void, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value, dispatchExternalEvent: (event: CollaborationExternalEvent): void): voidRestricts public channel mutations after its owning editor finishes assembly.
assertWrite: (): voidrunWithoutMutationAuthority: <Value>(callback: (): Value): ValuedispatchExternalEvent: (event: CollaborationExternalEvent): void
methodgetStatus getStatus(): CollaborationStatusmethodregisterContributor registerContributor(contribution: CollaborationContribution): voidInstalls one open OT owner contract for the lifetime of this channel.
contribution: CollaborationContribution
methodsubmitLocal submitLocal(ownerId: string, operations: readonly OTOperation[]): voidQueues a committed local operation batch through the shared collaboration engine.
ownerId: stringoperations: readonly OTOperation[]
methodsubscribeStatus subscribeStatus(listener: (status: CollaborationStatus): void): (): voidlistener: (status: CollaborationStatus): void
- classCollaborationChannelErrorsource ↗
-
class CollaborationChannelError extends SearErrorStable public failures raised by a collaboration channel host.
constructorconstructor CollaborationChannelError(code: CollaborationChannelErrorCode, message: string, details?: Record<string, unknown>): CollaborationChannelErrorcode: CollaborationChannelErrorCodemessage: stringdetails: Record<string, unknown>
propertycauseinherited cause?: unknownpropertycode readonly code: CollaborationChannelErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classCollabTransportsource ↗
-
class CollabTransportAbstract transport layer. Swap implementations (WebSocket, BroadcastChannel,
polling, etc.) without touching the plugin logic.constructorconstructor CollabTransport(): CollabTransportpropertysymbolstatic readonly symbol: symbolDI token for resolving CollabTransport.
methodconnect connect(options: CollaborationTransportConnectOptions): Promise<void>Opens the collaboration transport and begins receiving messages.
options: CollaborationTransportConnectOptions
methoddisconnect disconnect(): voidCloses the collaboration transport and releases its listeners.
methodsend send(message: CollaborationSubmission): voidSends one encoded collaboration message through the transport.
message: CollaborationSubmission
methodsubscribe subscribe(handler: (message: CollaborationServerMessage): void): (): voidSubscribes to server messages and returns an idempotent disposer.
handler: (message: CollaborationServerMessage): void
- classHeadlessCollabTransportsource ↗
-
class HeadlessCollabTransport extends CollabTransportCollaboration transport that keeps the plugin local to the current host.
constructorconstructor HeadlessCollabTransport(): HeadlessCollabTransportpropertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessCollabTransport.
methodconnect connect(_options: CollaborationTransportConnectOptions): Promise<void>Opens the collaboration transport and begins receiving messages.
_options: CollaborationTransportConnectOptions
methoddisconnect disconnect(): voidCloses the collaboration transport and releases its listeners.
methodsend send(_message: CollaborationSubmission): voidSends one encoded collaboration message through the transport.
_message: CollaborationSubmission
methodsubscribe subscribe(_handler: (message: CollaborationServerMessage): void): (): voidSubscribes without producing network messages.
_handler: (message: CollaborationServerMessage): void
- classSheetCollaborationPluginsource ↗
-
class SheetCollaborationPlugin extends Plugin<SearCoreSheet, CellProperties, null>, SheetLifecycleController, CollaborationSessionThin Sheet bridge around the editor-independent collaboration engine.
constructorconstructor SheetCollaborationPlugin(channelBinding: CollaborationChannelBinding, plugins: PluginManager<SearCoreSheet, CellProperties>, commands: SheetCommandBus): SheetCollaborationPluginchannelBinding: CollaborationChannelBindingplugins: PluginManager<SearCoreSheet, CellProperties>commands: SheetCommandBus
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: Transaction): nullApplies 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(): voidmethoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methoddisconnect disconnect(): voidmethodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodgetStatus getStatus(): CollaborationStatusmethodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterObservations registerObservations(observations: ObservationRegistry): voidobservations: ObservationRegistry
methodregisterState registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }Registers one or more plugin-owned state records with the host manager.
methodrender render(): nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstart start(_context: SheetLifecycleContext): void_context: SheetLifecycleContext
- classWebSocketTransportsource ↗
-
class WebSocketTransport extends CollabTransportBrowser WebSocket implementation of CollabTransport.
The authority validates and orders submitted operation batches while this
adapter owns only WebSocket lifecycle and JSON framing.constructorconstructor WebSocketTransport(): WebSocketTransportpropertysymbolstaticinherited readonly symbol: symbolDI token for resolving CollabTransport.
methodconnect connect(options: CollaborationTransportConnectOptions): Promise<void>Opens the collaboration transport and begins receiving messages.
options: CollaborationTransportConnectOptions
methoddisconnect disconnect(): voidCloses the collaboration transport and releases its listeners.
methodsend send(message: CollaborationSubmission): voidSends one encoded collaboration message through the transport.
message: CollaborationSubmission
methodsubscribe subscribe(handler: (message: CollaborationServerMessage): void): (): voidSubscribes to parsed server messages.
handler: (message: CollaborationServerMessage): void
- interfaceCollaborationChannelBindingsource ↗
-
interface CollaborationChannelBindingDI value used to distinguish editor-owned channels from host-retained channels.
- interfaceCollaborationConnectOptionssource ↗
-
interface CollaborationConnectOptionspropertyresourceId readonly resourceId: stringpropertyrevision readonly revision?: numberpropertyurl readonly url: string - interfaceCollaborationRemoteOperationssource ↗
-
interface CollaborationRemoteOperationsRemote operation batch delivered to the currently mounted editor bridge.
propertyoperations readonly operations: readonly OTOperation[]propertyownerId readonly ownerId: stringpropertyserverRevision readonly serverRevision: number - interfaceCollaborationSessionsource ↗
-
interface CollaborationSessionHost-facing lifecycle API independent from a concrete editor bridge.
methodconnect connect(options: CollaborationConnectOptions): Promise<void>options: CollaborationConnectOptions
methoddisconnect disconnect(): voidmethodgetStatus getStatus(): CollaborationStatus - interfaceCollaborationStatussource ↗
-
interface CollaborationStatuspropertyerror readonly error: unknownpropertypendingCount readonly pendingCount: numberpropertyresourceId readonly resourceId: string | nullpropertyrevision readonly revision: numberpropertystate readonly state: CollaborationConnectionState - interfaceCollaborationTransportConnectOptionssource ↗
-
interface CollaborationTransportConnectOptionsConnection parameters for one collaboration resource.
propertyresourceId readonly resourceId: stringpropertyrevision readonly revision: numberpropertyurl readonly url: string - interfaceConnectSheetCollaborationResultsource ↗
-
interface ConnectSheetCollaborationResult extends SheetCommandResultCommand 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: PipelinePipeline containing transaction, render, interaction and local-action steps.
- interfaceSheetApplyRemoteOperationsInputsource ↗
-
interface SheetApplyRemoteOperationsInputInput for applying operations received from a collaboration transport.
propertyoperations readonly operations: readonly Operation[]Remote operations after local OT transformation.
propertyownerId readonly ownerId: stringStable 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 CollaborationAcceptedBatchCanonical operation batch accepted and ordered by the authority.
propertybaseRevision readonly baseRevision: numberpropertyclientId readonly clientId: stringpropertykind readonly kind: "accepted"propertyoperationId readonly operationId: stringpropertyoperationType readonly operationType: CollaborationOperationTypepropertyownerId readonly ownerId: stringpropertypayload readonly payload: OTEncodedValuepropertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: stringpropertyserverRevision 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: 1Current collaboration wire protocol version.
- interfaceCollaborationRejectedMessagesource ↗
-
interface CollaborationRejectedMessageExplicit authority rejection; clients must not infer recovery from dropped frames.
propertycode readonly code: stringpropertykind readonly kind: "rejected"propertymessage readonly message: stringpropertyoperationId readonly operationId?: stringpropertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: string - typeCollaborationServerMessagesource ↗
-
type CollaborationServerMessage = CollaborationAcceptedBatch | CollaborationSyncMessage | CollaborationRejectedMessage - interfaceCollaborationSubmissionsource ↗
-
interface CollaborationSubmissionClient submission before the authority assigns a canonical revision.
propertybaseRevision readonly baseRevision: numberpropertyclientId readonly clientId: stringpropertykind readonly kind: "submit"propertyoperationId readonly operationId: stringpropertyoperationType readonly operationType: CollaborationOperationTypepropertyownerId readonly ownerId: stringpropertypayload readonly payload: OTEncodedValuepropertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: string - interfaceCollaborationSyncMessagesource ↗
-
interface CollaborationSyncMessageOrdered catch-up response sent when a transport joins a resource.
propertybatches readonly batches: readonly CollaborationAcceptedBatch[]propertyfromRevision readonly fromRevision: numberpropertykind readonly kind: "sync"propertyprotocolVersion readonly protocolVersion: 1propertyresourceId readonly resourceId: stringpropertyserverRevision readonly serverRevision: number
Package
@searsuite/sear-plugin-data-validation
Sheet data validation rules, commands, queries, and editor-local evaluation.
- classDataValidationEvaluatorRegistrysource ↗
-
class DataValidationEvaluatorRegistryHost extension point for structured values and custom formulas.
constructorconstructor DataValidationEvaluatorRegistry(): DataValidationEvaluatorRegistrymethodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): voidSeals post-assembly writes without adding work to evaluator reads.
isExecuting: (): booleandispatchRemoval: (id: number): void
methodevaluate evaluate(condition: DataValidationCondition, text: string, row: number, column: number): boolean | nullcondition: DataValidationConditiontext: stringrow: numbercolumn: number
methodregister register(kind: DataValidationKind, evaluator: DataValidationExternalEvaluator): (): voidkind: DataValidationKindevaluator: DataValidationExternalEvaluator
methodunregister unregister(id: number): voidRemoves 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]): DataValidationMatrixdata: { data: DataValidationRule[] | null[]; indices: number[]; indptr: number[] }shape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: DataValidationRule[] | null[]): DataValidationMatrixAdds 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): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: number- The row index.
column: numberrules: DataValidationRule[] | null
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: DataValidationRule[] | null[]): DataValidationMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: DataValidationRule[] | null): DataValidationRule[] | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: DataValidationRule[] | null): DataValidationRule[] | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): DataValidationMatrixDeletes 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): DataValidationMatrixDeletes 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>[]): DataValidationMatrixApplies 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>): voidComputes 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: numbercolumn: number
methodforEachinherited forEach(callback: (value: DataValidationRule[] | null, row: number, col: number): void): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: DataValidationRule[] | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: DataValidationRule[] | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: DataValidationRule[] | null, col: number): void
methodfromDenseinherited fromDense(denseArray: DataValidationRule[] | null[][]): DataValidationMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: DataValidationRule[] | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetItem getItem(row: number, column: number): DataValidationRule[] | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodreplaceRules replaceRules(entries: readonly PositionedDataValidationRule[]): voidentries: readonly PositionedDataValidationRule[]
methodsetDefaultValueinherited setDefaultValue(value: DataValidationRule[] | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: DataValidationRule[] | null- The default value to return for missing elements
methodsetItem setItem(row: number, column: number, rules: DataValidationRule[] | null): thisrow: numbercolumn: numberrules: DataValidationRule[] | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): DataValidationMatrixSwaps 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): DataValidationMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetDataValidationPluginstate: SheetDataValidationPluginStatedependencies: SheetDataValidationDependencies
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetDataValidationPluginState, SheetDataValidationPluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(state: SheetDataValidationPluginState, transaction: Transaction): SheetDataValidationPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
state: SheetDataValidationPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methoddispose dispose(): voidmethodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetDataValidationPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetDataValidationPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetDataValidationPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetDataValidationPluginStatetransaction: Transaction
methodreadIssue readIssue(row: number, column: number): DataValidationIssue | nullReturns a definite failure for the cell's current value, including values predating the rule.
row: numbercolumn: number
methodregisterCapabilities registerCapabilities(registry: RuntimeCapabilityRegistry): voidregistry: RuntimeCapabilityRegistry
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidregistry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterObservations registerObservations(registry: ObservationRegistry): voidregistry: ObservationRegistry
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWrites sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetDataValidationPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetDataValidationPluginStatecommitToken: object
methodvalidate validate(row: number, column: number, text: string): SheetCellInputValidationResultrow: numbercolumn: numbertext: string
- interfaceDataValidationConditionsource ↗
-
interface DataValidationConditionType-specific settings used to evaluate a cell value.
propertydropdownMode readonly dropdownMode?: DataValidationDropdownModepropertyformula readonly formula?: stringpropertyintegerOnly readonly integerOnly?: booleanpropertykind readonly kind: DataValidationKindpropertyoperator readonly operator?: DataValidationOperatorpropertyoptions readonly options?: readonly DataValidationOption[]propertysecondValue readonly secondValue?: stringpropertyshowDropdownArrow readonly showDropdownArrow?: booleanpropertysourceRange readonly sourceRange?: { end: readonly [number, number]; start: readonly [number, number] }propertytextMode readonly textMode?: DataValidationTextModepropertyvalue readonly value?: string - interfaceDataValidationEvaluationContextsource ↗
-
interface DataValidationEvaluationContextpropertycolumn readonly column: numberpropertyevaluateExternal readonly evaluateExternal?: (condition: DataValidationCondition, text: string, row: number, column: number): boolean | nullHost 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 DataValidationIssueA definite failure of the current cell value against a validation rule.
- interfaceDataValidationOptionsource ↗
-
interface DataValidationOptionOne displayable dropdown choice and its optional color.
- interfaceDataValidationRulesource ↗
-
interface DataValidationRuleOne independently editable rule stored at the top-left cell of its range.
propertycondition readonly condition: DataValidationConditionpropertyendColumn readonly endColumn: numberpropertyendRow readonly endRow: numberpropertyerrorMessage readonly errorMessage?: stringpropertyid readonly id: stringpropertyinputMessage readonly inputMessage?: stringpropertyinputPolicy readonly inputPolicy: DataValidationInputPolicy - interfaceDataValidationWarningsource ↗
-
interface DataValidationWarning - interfacePositionedDataValidationRulesource ↗
-
interface PositionedDataValidationRuleA rule with its persisted range anchor.
- interfaceSetDataValidationRuleInputsource ↗
-
interface SetDataValidationRuleInput extends SheetRangeInputTarget range and rule settings for creating or editing a rule.
- interfaceSheetDataValidationDependenciessource ↗
-
interface SheetDataValidationDependenciespropertycreateId readonly createId: (): stringpropertyevaluators readonly evaluators: DataValidationEvaluatorRegistrypropertyinputValidation readonly inputValidation: SheetCellInputValidationRegistrypropertyreadSourceValues readonly readSourceValues?: (start: readonly [number, number], end: readonly [number, number]): readonly string[]propertyreadValue readonly readValue?: (row: number, column: number): unknownpropertyrequestRender readonly requestRender?: (): void - interfaceSheetDataValidationPluginStatesource ↗
-
interface SheetDataValidationPluginStatepropertydataValidations 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 | nullReturns null when a host-owned value type has no evaluator. Empty input is allowed.
condition: DataValidationConditiontext: stringcontext: DataValidationEvaluationContext
- functionformatDropdownSelectionsource ↗
-
formatDropdownSelection(values: readonly string[]): stringSerializes 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 | nullReads the current validation matrix from the sheet data view.
dataEngine: DataEngine
Package
@searsuite/sear-plugin-dropdown
Optional dropdown cell interactions over validation-owned rules.
- classDropdownErrorsource ↗
-
class DropdownError extends SearErrorStructured feature diagnostic.
constructorconstructor DropdownError(code: DropdownErrorCode, message: string, details?: SearErrorDetails): DropdownErrorCreates a public dropdown diagnostic.
code: DropdownErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycodeinherited readonly code: DropdownErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSheetDropdownPluginsource ↗
-
class SheetDropdownPlugin extends Plugin<unknown, CellProperties, null>Stateless dropdown interaction; rules and values retain their existing document owners.
constructorconstructor SheetDropdownPlugin(options: SheetDropdownOptions): SheetDropdownPluginReceives owner-scoped projections and semantic transaction factories.
options: SheetDropdownOptions
propertydepth readonly depth: -24Handles 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseSeveral stateless interaction extensions may share depth.
propertysymbolstatic readonly symbol: typeof symbolEditor-local service token.
memberkeyinherited key: unknownmethodapply apply(): nullMutations belong to validation and cell owners.
methoddestroy destroy(): voidReleases transient host subscriptions.
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullNo independent render configuration.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDown onMouseDown(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidActivates the trailing cell arrow through the public command bus.
_core: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp onMouseUp(_core: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidKeeps an arrow release from returning focus to the cell text editor.
_core: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidAdds viewport-bounded arrows and option color layers without taking fill ownership.
registry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidHost listener failures are isolated by the editor observation registry.
registry: ObservationRegistry
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidPublishes a typed, current-cell query.
queries: SheetQueryRegistry
methodregisterState registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }No duplicate document field is created.
methodrender render(): nullCell visual readers supply all adornments.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
- interfaceDropdownCellInputsource ↗
-
interface DropdownCellInputAbsolute target cell; all picker reads are editor-local.
- interfaceDropdownCellSnapshotsource ↗
-
interface DropdownCellSnapshot extends DropdownCellInputImmutable current rule and cell projection.
propertycolumninherited readonly column: numberZero-based column.
propertyinputMessage readonly inputMessage?: stringSelection prompt from the validation owner.
propertymultiple readonly multiple: booleanWhether choices accumulate.
propertyoptions readonly options: readonly DataValidationOption[]Ordered, distinct current choices.
propertyrowinherited readonly row: numberZero-based row.
propertyruleId readonly ruleId: stringStable validation owner id.
propertyselected readonly selected: readonly string[]Current selected labels, including values absent from the rule.
propertyshowArrow readonly showArrow: booleanWhether the cell shows its arrow.
- interfacePickDropdownOptionInputsource ↗
-
interface PickDropdownOptionInput extends DropdownCellInputTarget and choice to set, or toggle in multiple-selection mode.
propertycolumninherited readonly column: numberZero-based column.
propertylabel readonly label: stringOption label, matched exactly against current choices.
propertyrowinherited readonly row: numberZero-based row.
propertyruleId readonly ruleId?: stringOptional rule identity guards stale picker actions after configuration changes.
- interfaceSheetDropdownOptionssource ↗
-
interface SheetDropdownOptionsDependencies supplied by the composition root; persistent data stays with its original owners.
propertyqueries readonly queries: SheetQueryRegistryEditor-local query bus for validation-owner projections.
propertyvalidation readonly validation: SheetCellInputValidationRegistryShared edit validation, including overlapping rules.
methodbeforeOpen beforeOpen(): booleanCommits active editing before pointer activation; false leaves the edit active.
methodcreateValueTransaction createValueTransaction(row: number, column: number, text: string | null): TransactionPlans a text or empty replacement as an ordinary cell-owner transaction.
row: numbercolumn: numbertext: string | null
methodforEachSourceValue forEachSourceValue(start: readonly [number, number], end: readonly [number, number], visit: (value: unknown): void): voidVisits 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): stringReads display text, including formula results and structured cells.
row: numbercolumn: 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[]): voidValidates a cell before any source traversal or mutation.
input: DropdownCellInputshape: readonly number[]
- functionplanDropdownValuesource ↗
-
planDropdownValue(state: DropdownCellSnapshot | null, input: PickDropdownOptionInput): string | nullComputes a selection without mutating state; stale or removed choices fail explicitly.
state: DropdownCellSnapshot | nullinput: PickDropdownOptionInput
- functionreadDropdownCellsource ↗
-
readDropdownCell(input: DropdownCellInput, options: SheetDropdownOptions): DropdownCellSnapshot | nullResolves the last covering dropdown rule and bounded, distinct choices.
input: DropdownCellInputoptions: SheetDropdownOptions
- variableDropdownModesource ↗
-
DropdownMode: { Multiple: "multiple"; Single: "single" }Selection modes for dropdown validation.
- interfaceDropdownOptionsource ↗
-
interface DropdownOptionOne displayable dropdown choice and its optional color.
- functionformatDropdownSelectionsource ↗
-
formatDropdownSelection(values: readonly string[]): stringSerializes 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
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]): DuplicateMatrixCreates a sparse duplicate-highlight matrix from serialized CSR data.
data: DuplicateMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: templateLiteral | null[]): DuplicateMatrixAdds 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): thisStores a duplicate highlight through the CSR API, removing the entry for null.
row: numbercol: numbervalue: templateLiteral | null
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: templateLiteral | null[]): DuplicateMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: templateLiteral | null): templateLiteral | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: templateLiteral | null): templateLiteral | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): DuplicateMatrixDeletes 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): DuplicateMatrixDeletes 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>[]): DuplicateMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: templateLiteral | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: templateLiteral | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: templateLiteral | null, col: number): void
methodfromDenseinherited fromDense(denseArray: templateLiteral | null[][]): DuplicateMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: templateLiteral | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): templateLiteral | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: templateLiteral | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: templateLiteral | null- The default value to return for missing elements
methodsetItem setItem(row: number, col: number, value: templateLiteral | null): thisStores a duplicate highlight. Null is represented by removing the sparse entry.
row: numbercol: numbervalue: templateLiteral | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): DuplicateMatrixSwaps 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): DuplicateMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetDuplicatePluginConstructs the plugin around a shared sparse duplicate-highlight matrix.
state: SheetDuplicatePluginStatesheetData: SheetDataPlugincellCodecs: CellClipboardCodecRegistry
propertydepthinherited readonly depth: numberDraw 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseDuplicate 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: PluginKeyStable plugin key shared by all duplicate plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the duplicate plugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: SheetDuplicatePluginState, transaction: Transaction): SheetDuplicatePluginState | nullApplies direct duplicate-highlight and structural matrix operations.
pluginState: SheetDuplicatePluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullDuplicate state has no render-time configuration.
methodgetStateinherited getState(): SheetDuplicatePluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetDuplicatePluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetDuplicatePluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetDuplicatePluginStatetransaction: Transaction
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidContributes duplicate highlights to the shared Sheet cell visual pipeline.
registry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidContributes this owner's cell state to atomic range moves.
registry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetDuplicatePluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetDuplicatePluginStatecommitToken: object
- interfaceDuplicateMatrixDatasource ↗
-
interface DuplicateMatrixDataSerialized sparse entries accepted by DuplicateMatrix.
- interfaceSheetDuplicateClearInputsource ↗
-
interface SheetDuplicateClearInput extends SheetRangeInputPublic input for clearing duplicate highlights.
- interfaceSheetDuplicateCommandDataSourcesource ↗
-
interface SheetDuplicateCommandDataSource extends DuplicateRangeDataSourceState access required by duplicate commands.
propertyduplicateTarget readonly duplicateTarget: PluginKeypropertysheetDataTarget readonly sheetDataTarget: PluginKeymethodgetColumnCountinherited getColumnCount(): numbermethodgetRowCountinherited getRowCount(): numbermethodreadCell readCell(row: number, column: number): CellMatrixElement | nullrow: numbercolumn: number
methodreadCellText readCellText(cell: CellMatrixElement): stringcell: CellMatrixElement
methodreadDuplicateHighlight readDuplicateHighlight(row: number, column: number): templateLiteral | nullrow: numbercolumn: number
- interfaceSheetDuplicateDeleteInputsource ↗
-
interface SheetDuplicateDeleteInput extends SheetRangeInputPublic input for duplicate deletion.
propertyanchorinherited readonly anchor: SheetCellPointOne corner of the target range.
propertycolumns readonly columns?: readonly number[]propertyfocusinherited readonly focus: SheetCellPointOpposite corner of the target range.
propertyheaderRow readonly headerRow?: booleanpropertykeep readonly keep?: SheetDuplicateKeepMode - interfaceSheetDuplicateHighlightInputsource ↗
-
interface SheetDuplicateHighlightInput extends SheetRangeInputPublic input for duplicate highlighting.
propertyanchorinherited readonly anchor: SheetCellPointOne corner of the target range.
propertycolumns readonly columns?: readonly number[]propertyfocusinherited readonly focus: SheetCellPointOpposite corner of the target range.
propertyheaderRow readonly headerRow?: booleanpropertyhighlight readonly highlight: templateLiteral - interfaceSheetDuplicatePluginStatesource ↗
-
interface SheetDuplicatePluginStateState owned by SheetDuplicatePlugin.
propertyduplicates duplicates: DuplicateMatrixSparse matrix containing duplicate highlight settings.
- typeSheetDuplicateHighlightsource ↗
-
type SheetDuplicateHighlight = HexColorA 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): valueAsserts 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: SheetDuplicateClearInputdataSource: SheetDuplicateCommandDataSource
- functioncreateDeleteDuplicateRowsOperationssource ↗
-
createDeleteDuplicateRowsOperations(input: SheetDuplicateDeleteInput, dataSource: SheetDuplicateCommandDataSource): DeleteRowOTOperation<CellMatrixElement>[]Creates sheet-data operations that clear duplicate row contents in the selected range.
input: SheetDuplicateDeleteInputdataSource: SheetDuplicateCommandDataSource
- functioncreateHighlightDuplicateOperationssource ↗
-
createHighlightDuplicateOperations(input: SheetDuplicateHighlightInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]Creates sparse update operations for duplicate-value highlighting.
input: SheetDuplicateHighlightInputdataSource: SheetDuplicateCommandDataSource
- functionisSheetDuplicateHighlightsource ↗
-
isSheetDuplicateHighlight(value: unknown): valueReturns whether a value is a supported duplicate-highlight color.
value: unknown
- functionreadSheetDuplicateHighlightssource ↗
-
readSheetDuplicateHighlights(dataEngine: DataEngine): DuplicateMatrix | nullReads duplicate highlights published by SheetDuplicatePlugin.
dataEngine: DataEngine
- functionregisterSheetDuplicateCommandssource ↗
-
registerSheetDuplicateCommands(commands: SheetCommandBus, dataSource: SheetDuplicateCommandDataSource): voidRegisters duplicate commands owned by SheetDuplicatePlugin.
commands: SheetCommandBusdataSource: SheetDuplicateCommandDataSource
Package
@searsuite/sear-plugin-export-node
Node CSV and XLSX adapters for Workbook document states.
- interfaceNodeCsvWorkbookImportOptionssource ↗
-
interface NodeCsvWorkbookImportOptionspropertysheetId readonly sheetId?: stringpropertysheetName readonly sheetName?: stringpropertyworkbookId readonly workbookId: string - functionexportNodeCsvSheetsource ↗
-
exportNodeCsvSheet(state: WorkbookDocumentState<SheetDocumentState>, sheetId: string): stringExports 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: stringoptions: NodeCsvWorkbookImportOptions
- functionimportNodeXlsxWorkbooksource ↗
-
importNodeXlsxWorkbook(bytes: Uint8Array, workbookId: string): Promise<WorkbookDocumentState<SheetDocumentState>>Reads values and formula sources from an XLSX buffer into a Workbook document.
bytes: Uint8ArrayworkbookId: string
Package
@searsuite/sear-plugin-export
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>): thisRegisters a module codec. Duplicate keys are rejected.
codec: DocumentStateCodec<TState>
methodregisterContribution registerContribution(contribution: DocumentStateModuleContribution<unknown, object>): thisRegisters 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 SearErrorError thrown when a persisted workbook payload cannot be encoded or decoded.
constructorconstructor ExportError(code: ExportErrorCode, message: string, details?: SearErrorDetails): ExportErrorCreates an ExportError instance.
code: ExportErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: ExportErrorCodeStable machine-readable error code.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- interfaceDocumentStateCodecsource ↗
-
interface DocumentStateCodec<TState>Codec contributed by the owner of one document-state module.
propertykey readonly key: stringStable module key written to persisted files.
methoddeserialize deserialize(payload: JsonValue, path: string): Partial<TState>Restores the module-owned part of a document state.
payload: JsonValuepath: string
methodserialize serialize(state: TState): unknownSerializes 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: stringStable module key written to persisted files.
methodcapture capture(ownerState: TOwnerState): Partial<TDocumentState> | undefinedCaptures this owner state into the aggregate document-state snapshot.
ownerState: TOwnerState
- interfaceSearDocumentStateModuleFilesource ↗
-
interface SearDocumentStateModuleFileOne registered document-state module in a stable export file.
- interfaceSearFormulaBindingFilesource ↗
-
interface SearFormulaBindingFileOne formula cell's workbook-qualified reference targets.
propertycol readonly col: numberpropertyformula readonly formula: stringpropertyreferences readonly references: readonly { sheetId: string; sheetName: string }[]propertyrow readonly row: numberpropertysheetId readonly sheetId: string - interfaceSearSheetDocumentFilesource ↗
-
interface SearSheetDocumentFileStable persisted representation of one Sheet document state.
- 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>> | undefinedNarrows a runtime value to a JSON-compatible metadata record.
value: Readonly<Record<string, unknown>> | undefinedpath: string
- functioncloneJsonValuesource ↗
-
cloneJsonValue<TValue>(value: TValue, path?: string): TValueClones a JSON-compatible value and rejects values that cannot be persisted as JSON.
value: TValuepath: string
- functionreadRecordsource ↗
-
readRecord(value: unknown, path: string): Record<string, unknown>Narrows a runtime value to a plain object.
value: unknownpath: 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
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[] }): SheetFilterMatrixdata: { data: SheetFilterDefinition | null[]; indices: number[]; indptr: number[] }
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: SheetFilterDefinition | null[]): SheetFilterMatrixAdds 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): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: number- The row index.
column: numbervalue: SheetFilterDefinition | null- The value to add.
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: SheetFilterDefinition | null[]): SheetFilterMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: SheetFilterDefinition | null): SheetFilterDefinition | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: SheetFilterDefinition | null): SheetFilterDefinition | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetFilterMatrixDeletes 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): SheetFilterMatrixDeletes 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>[]): SheetFilterMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: SheetFilterDefinition | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: SheetFilterDefinition | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: SheetFilterDefinition | null, col: number): void
methodfromDenseinherited fromDense(denseArray: SheetFilterDefinition | null[][]): SheetFilterMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: SheetFilterDefinition | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetItem getItem(row: number, column: number): SheetFilterDefinition | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: SheetFilterDefinition | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: SheetFilterDefinition | null- The default value to return for missing elements
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): SheetFilterMatrixSwaps 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): SheetFilterMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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>, SheetRowVisibilityOwns persisted filter rules and a derived, editor-local row visibility view.
constructorconstructor SheetFilterPlugin(state: SheetFilterPluginState, dependencies: SheetFilterDependencies): SheetFilterPluginstate: SheetFilterPluginStatedependencies: SheetFilterDependencies
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetFilterPluginState, SheetFilterPluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberactive active: unknownmemberkeyinherited key: unknownmemberversion version: unknownmethodapply apply(state: SheetFilterPluginState, transaction: Transaction): SheetFilterPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
state: SheetFilterPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methoddispose dispose(): voidmethodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetFilterPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodisRowFiltered isRowFiltered(row: number): booleanrow: number
methodlockCommittedStateinherited lockCommittedState(state: SheetFilterPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetFilterPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetFilterPluginStatetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetFilterPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetFilterPluginStatecommitToken: object
- interfaceCreateSheetFilterInputsource ↗
-
interface CreateSheetFilterInputSheet range and header policy for a new filter or private view.
propertyfirstRowIsHeader readonly firstRowIsHeader?: booleanTreat 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 ReadSheetFilterValuesInputParameters for a bounded distinct-value query.
- interfaceSetSheetColumnFilterInputsource ↗
-
interface SetSheetColumnFilterInputSets or clears a predicate for one column.
- interfaceSheetFilterColumnRulesource ↗
-
interface SheetFilterColumnRuleA rule attached to one column within a filter range.
- interfaceSheetFilterDefinitionsource ↗
-
interface SheetFilterDefinitionDocument or private-session filter configuration for one sheet range.
propertyfirstRowIsHeader readonly firstRowIsHeader: booleanWhether the first row is always visible as a header.
propertyprivateView readonly privateView: booleanWhether 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?: PluginKeypropertydisplayedValueChanges readonly displayedValueChanges?: Pick<SheetDisplayedValueChanges, "subscribe">propertyinvalidateVisibilityAggregates readonly invalidateVisibilityAggregates?: (): voidpropertyparseDate readonly parseDate?: (value: unknown): number | nullpropertyplatform readonly platform: Pick<Platform, "toLowerCase">propertyreadColor readonly readColor: (row: number, column: number, property: "fill" | "textColor"): string | nullpropertyrenderKeysinherited renderKeys?: (): readonly PluginKey[]propertyrequestRenderAll readonly requestRenderAll?: (): voidmethodforEachStoredInRangeinherited forEachStoredInRange(startRow: number, column: number, endRow: number, visit: (row: number): void): voidstartRow: numbercolumn: numberendRow: numbervisit: (row: number): void
methodreadShapeinherited readShape(): readonly [number, number]methodreadValueinherited readValue(row: number, column: number): unknownrow: numbercolumn: number
- interfaceSheetFilterPluginStatesource ↗
-
interface SheetFilterPluginStatePersisted state owned by the filter plugin.
propertyfilters readonly filters: SheetFilterMatrix - interfaceSheetFilterValueCountsource ↗
-
interface SheetFilterValueCountOne distinct displayed value and its occurrence count.
- interfaceSheetFilterValuePagesource ↗
-
interface SheetFilterValuePageBounded distinct-value query result for a filter column.
- 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): stringUses display values for distinct-value selection, including an explicit blank key.
value: unknown
Package
@searsuite/sear-plugin-find-replace
Sparse, typed Sheet find and replace.
- classSheetFindReplaceErrorsource ↗
-
class SheetFindReplaceError extends SearErrorDiagnostic error surfaced to hosts by find and replace commands or queries.
constructorconstructor SheetFindReplaceError(code: SheetFindReplaceErrorCode, message: string, details?: SearErrorDetails): SheetFindReplaceErrorcode: SheetFindReplaceErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: SheetFindReplaceErrorCodeStable error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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">): SheetFindReplacePlugindata: SheetDataPlugincodecs: CellClipboardCodecRegistrycommits: CellCommitStrategyRegistryprojection: Pick<SheetFindSource, "readValue" | "forEachProjectedValueInRange">
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
- interfaceSheetFindInputsource ↗
-
interface SheetFindInputQuery options shared by navigation and replacement.
propertycontent readonly content?: SheetFindContentWhether to read displayed values or formula source.
propertyentireCell readonly entireCell?: booleanRequires the search text to equal the entire cell text.
propertymatchCase readonly matchCase?: booleanEnables case-sensitive matching.
propertyorder readonly order?: SheetFindOrderCell traversal order.
propertyrange readonly range?: SheetFindRangeLimits search to an inclusive rectangular cell range.
propertytext readonly text: stringLiteral text to search for; an empty string produces no matches.
- interfaceSheetFindMatchsource ↗
-
interface SheetFindMatchOne occurrence, with UTF-16 offsets within the cell's searched text.
propertycolumn readonly column: numberZero-based column coordinate.
propertyend readonly end: numberExclusive UTF-16 offset.
propertyrow readonly row: numberZero-based row coordinate.
propertystart readonly start: numberInclusive UTF-16 offset.
propertytext readonly text: stringSearched cell text at query time.
- interfaceSheetFindPagesource ↗
-
interface SheetFindPageMatch window and its position in the complete result set.
propertymatches readonly matches: readonly SheetFindMatch[]propertyrevision readonly revision: numberpropertystartIndex readonly startIndex: numberpropertytotal readonly total: number - interfaceSheetFindPageInputsource ↗
-
interface SheetFindPageInput extends SheetFindInputA bounded window of matches in the requested traversal order.
propertybackward readonly backward?: booleanReads the matches preceding the cursor when set.
propertycontentinherited readonly content?: SheetFindContentWhether to read displayed values or formula source.
propertycursor readonly cursor?: Pick<SheetFindMatch, "start" | "row" | "column">Exclusive position from which to continue.
propertyentireCellinherited readonly entireCell?: booleanRequires the search text to equal the entire cell text.
propertyexpectedRevision readonly expectedRevision?: numberRejects a cursor created before the Sheet data changed.
propertylimit readonly limit: numberMaximum number of matches returned.
propertymatchCaseinherited readonly matchCase?: booleanEnables case-sensitive matching.
propertyorderinherited readonly order?: SheetFindOrderCell traversal order.
propertyrangeinherited readonly range?: SheetFindRangeLimits search to an inclusive rectangular cell range.
propertytextinherited readonly text: stringLiteral text to search for; an empty string produces no matches.
- interfaceSheetFindRangesource ↗
-
interface SheetFindRangeInclusive cell bounds for a Sheet search.
- interfaceSheetFindReplaceSourcesource ↗
-
interface SheetFindReplaceSource extends SheetFindSourceSearch 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): voidpropertygetRevisioninherited readonly getRevision?: (): numberpropertymatrixinherited readonly matrix: CSRMatrix<CellMatrixElement>propertyreadValueinherited readonly readValue?: (row: number, column: number, cell: CellMatrixElement | null): unknown - interfaceSheetFindSourcesource ↗
-
interface SheetFindSourceSparse 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): voidpropertygetRevision readonly getRevision?: (): numberpropertymatrix readonly matrix: CSRMatrix<CellMatrixElement>propertyreadValue readonly readValue?: (row: number, column: number, cell: CellMatrixElement | null): unknown - interfaceSheetReplaceInputsource ↗
-
interface SheetReplaceInput extends SheetFindInputReplacement options shared by single and bulk commands.
propertycontentinherited readonly content?: SheetFindContentWhether to read displayed values or formula source.
propertyentireCellinherited readonly entireCell?: booleanRequires the search text to equal the entire cell text.
propertymatchCaseinherited readonly matchCase?: booleanEnables case-sensitive matching.
propertyorderinherited readonly order?: SheetFindOrderCell traversal order.
propertyrangeinherited readonly range?: SheetFindRangeLimits search to an inclusive rectangular cell range.
propertyreplacement readonly replacement: stringLiteral text inserted for each matching occurrence.
propertytextinherited readonly text: stringLiteral text to search for; an empty string produces no matches.
- interfaceSheetReplaceOneInputsource ↗
-
interface SheetReplaceOneInput extends SheetReplaceInputReplaces one match returned by the find query.
propertycontentinherited readonly content?: SheetFindContentWhether to read displayed values or formula source.
propertyentireCellinherited readonly entireCell?: booleanRequires the search text to equal the entire cell text.
propertymatch readonly match: SheetFindMatchSelected occurrence, including the cell text observed by the find query.
propertymatchCaseinherited readonly matchCase?: booleanEnables case-sensitive matching.
propertyorderinherited readonly order?: SheetFindOrderCell traversal order.
propertyrangeinherited readonly range?: SheetFindRangeLimits search to an inclusive rectangular cell range.
propertyreplacementinherited readonly replacement: stringLiteral text inserted for each matching occurrence.
propertytextinherited readonly text: stringLiteral 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: 200Bounds 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: SheetFindInputsource: SheetFindSource
- functionfindSheetMatchPagesource ↗
-
findSheetMatchPage(input: SheetFindPageInput, source: SheetFindSource): SheetFindPageFinds a bounded window while still reporting the complete match count.
input: SheetFindPageInputsource: SheetFindSource
- functionregisterSheetFindReplaceCommandssource ↗
-
registerSheetFindReplaceCommands(commands: SheetCommandBus, source: SheetFindReplaceSource): voidPublishes single and bulk replace commands for a Sheet plugin.
commands: SheetCommandBussource: SheetFindReplaceSource
- functionregisterSheetFindReplaceQueriessource ↗
-
registerSheetFindReplaceQueries(queries: SheetQueryRegistry, source: SheetFindReplaceSource): voidPublishes the typed find query for a Sheet plugin.
queries: SheetQueryRegistrysource: 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 | SheetReplaceOneInputsource: SheetFindReplaceSourceone: boolean
Package
@searsuite/sear-plugin-fixed-row
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
truevalues identify fixed rows.constructorconstructor FixedRowMatrix(data?: FixedRowMatrixData, shape?: [number, number]): FixedRowMatrixdata: FixedRowMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: boolean | null[]): FixedRowMatrixAdds 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): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: number- The row index.
column: numbervalue: boolean | null- The value to add.
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: boolean | null[]): FixedRowMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: boolean | null): boolean | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: boolean | null): boolean | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): FixedRowMatrixDeletes 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): FixedRowMatrixDeletes 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>[]): FixedRowMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: boolean | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: boolean | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: boolean | null, col: number): void
methodfromDenseinherited fromDense(denseArray: boolean | null[][]): FixedRowMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: boolean | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): boolean | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: boolean | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: boolean | null- The default value to return for missing elements
methodsetItem setItem(row: number, column: number, value: boolean | null): thisStores true sparsely; false and null clear the row's fixed state.
row: numbercolumn: numbervalue: boolean | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): FixedRowMatrixSwaps 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): FixedRowMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetFixedRowPluginstate: SheetFixedRowPluginState
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetFixedRowPluginState, SheetFixedRowPluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(state: SheetFixedRowPluginState, transaction: Transaction): SheetFixedRowPluginState | nullApplies direct fixed-row updates and projects sheet row structure changes.
state: SheetFixedRowPluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetFixedRowPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetFixedRowPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetFixedRowPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetFixedRowPluginStatetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetFixedRowPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetFixedRowPluginStatecommitToken: object
- interfaceFixedRowMatrixDatasource ↗
-
interface FixedRowMatrixDataSerialized sparse storage accepted by FixedRowMatrix.
- interfaceSheetFixedRowCommandDataSourcesource ↗
-
interface SheetFixedRowCommandDataSourceFixed-row state needed to validate and create invertible command operations.
propertytarget readonly target: PluginKeymethodgetRowCount getRowCount(): numbermethodisRowFixed isRowFixed(index: number): booleanindex: number
- interfaceSheetFixedRowPluginStatesource ↗
-
interface SheetFixedRowPluginStateState owned exclusively by SheetFixedRowPlugin.
propertyfixedRows readonly fixedRows: FixedRowMatrix - interfaceSheetSetRowsFixedInputsource ↗
-
interface SheetSetRowsFixedInputPublic input for fixing or unfixing rows.
- 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: SheetSetRowsFixedInputdataSource: SheetFixedRowCommandDataSource
- functionreadSheetFixedRowssource ↗
-
readSheetFixedRows(dataEngine: DataEngine): FixedRowMatrix | nullReads the fixed-row matrix published by SheetFixedRowPlugin.
dataEngine: DataEngine
- functionregisterSheetFixedRowCommandssource ↗
-
registerSheetFixedRowCommands(commands: SheetCommandBus, dataSource: SheetFixedRowCommandDataSource): voidRegisters the fixed-row command against one plugin-owned state source.
commands: SheetCommandBusdataSource: SheetFixedRowCommandDataSource
Package
@searsuite/sear-plugin-format-painter
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): SheetFormatPainterPluginoptions: SheetFormatPainterOptions
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
_state: null_transaction: Transaction
methoddestroy destroy(): voidmethoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterObservations registerObservations(observations: ObservationRegistry): voidobservations: ObservationRegistry
methodregisterState registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }Registers one or more plugin-owned state records with the host manager.
methodrender render(): nullProduces scene nodes owned by this plugin for the current core state.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
- interfaceFormatPainterStatesource ↗
-
interface FormatPainterState - interfaceSheetFormatPainterOptionssource ↗
-
interface SheetFormatPainterOptionsDependencies supplied by the owning composition root, with no global state.
- interfaceStartFormatPainterInputsource ↗
-
interface StartFormatPainterInput - 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: stringtarget: PluginKeyreadMatrix: (): SheetFormatMatrix<Value>
- typeSheetFormatRangesource ↗
-
type SheetFormatRange = SheetMoveRangeInclusive range shared by format-transfer owners and hosts.
- interfaceSheetFormatTransferContributionsource ↗
-
interface SheetFormatTransferContributionOptional state-owner contribution to format painting.
propertyid readonly id: stringmethodcapture capture(source: SheetMoveRange): SheetFormatTransferSnapshotsource: SheetMoveRange
methodclear clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans removal of this owner's explicit formats without changing cell content.
range: SheetMoveRange
- interfaceSheetFormatTransferPlansource ↗
-
interface SheetFormatTransferPlanOne owner's isolated plan; only the owner interprets its operations.
propertyoperations readonly operations: readonly Operation[]propertytarget readonly target: PluginKey - classSheetFormatTransferRegistrysource ↗
-
class SheetFormatTransferRegistryEditor-local composition of state-owner format transfers.
constructorconstructor SheetFormatTransferRegistry(): SheetFormatTransferRegistrypropertysymbolstatic readonly symbol: typeof symbolmethodcapture capture(source: SheetMoveRange): SheetFormatTransferSnapshotsource: SheetMoveRange
methodclear clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans all format owners against the same unchanged pre-clear state.
range: SheetMoveRange
methoddestroy destroy(): voidmethodregister register(owner: SheetFormatTransferContribution): (): voidowner: SheetFormatTransferContribution
- interfaceSheetFormatTransferSnapshotsource ↗
-
interface SheetFormatTransferSnapshotCaptured format data, independent of subsequent source changes.
methodplan plan(destination: SheetMoveRange): readonly SheetFormatTransferPlan[]destination: SheetMoveRange
Package
@searsuite/sear-plugin-formula-engineering
Host-neutral Excel-compatible engineering formulas organized by category.
- interfaceEngineeringFunctionRegistrationOptionssource ↗
-
interface EngineeringFunctionRegistrationOptionspropertyexcludedNames readonly excludedNames?: readonly string[]Function names omitted for hosts whose formula dialect does not expose them.
- variableBESSELIsource ↗
-
BESSELI: FormulaFunctionBESSELI returns the modified Bessel function I_n(x). Example: =BESSELI(1.5,1) returns about 0.981666.
- variableBESSELJsource ↗
-
BESSELJ: FormulaFunctionBESSELJ returns the Bessel function J_n(x). Example: =BESSELJ(1.9,2) returns about 0.329926.
- variableBESSELKsource ↗
-
BESSELK: FormulaFunctionBESSELK returns the modified Bessel function K_n(x). Example: =BESSELK(1.5,1) returns about 0.277388.
- variableBESSELYsource ↗
-
BESSELY: FormulaFunctionBESSELY returns the Bessel function Y_n(x). Example: =BESSELY(2.5,1) returns about 0.145918.
- variableBIN2DECsource ↗
-
BIN2DEC: FormulaFunctionBIN2DEC converts binary to decimal. Example: =BIN2DEC("1100100") returns 100.
- variableBIN2HEXsource ↗
-
BIN2HEX: FormulaFunctionBIN2HEX converts binary to hexadecimal. Example: =BIN2HEX("11111011") returns FB.
- variableBIN2OCTsource ↗
-
BIN2OCT: FormulaFunctionBIN2OCT converts binary to octal. Example: =BIN2OCT("1001") returns 11.
- variableBITANDsource ↗
-
BITAND: FormulaFunctionBITAND returns the bitwise AND of two 48-bit nonnegative integers. Example: =BITAND(13,25) returns 9.
- variableBITLSHIFTsource ↗
-
BITLSHIFT: FormulaFunctionBITLSHIFT shifts a 48-bit integer left, or right for a negative shift. Example: =BITLSHIFT(4,2) returns 16.
- variableBITORsource ↗
-
BITOR: FormulaFunctionBITOR returns the bitwise OR of two 48-bit nonnegative integers. Example: =BITOR(23,10) returns 31.
- variableBITRSHIFTsource ↗
-
BITRSHIFT: FormulaFunctionBITRSHIFT shifts a 48-bit integer right, or left for a negative shift. Example: =BITRSHIFT(16,2) returns 4.
- variableBITXORsource ↗
-
BITXOR: FormulaFunctionBITXOR returns the bitwise exclusive OR of two 48-bit nonnegative integers. Example: =BITXOR(5,3) returns 6.
- variableCOMPLEXsource ↗
-
COMPLEX: FormulaFunctionCOMPLEX creates Excel complex-number text from real and imaginary coefficients. Example: =COMPLEX(3,4) returns "3+4i".
- variableCONVERTsource ↗
-
CONVERT: FormulaFunctionCONVERT changes a number between compatible measurement units. Example: =CONVERT(1,"mi","km") returns 1.609344.
- variableDEC2BINsource ↗
-
DEC2BIN: FormulaFunctionDEC2BIN converts decimal to binary. Example: =DEC2BIN(9) returns 1001.
- variableDEC2HEXsource ↗
-
DEC2HEX: FormulaFunctionDEC2HEX converts decimal to hexadecimal. Example: =DEC2HEX(100) returns 64.
- variableDEC2OCTsource ↗
-
DEC2OCT: FormulaFunctionDEC2OCT converts decimal to octal. Example: =DEC2OCT(58) returns 72.
- variableDELTAsource ↗
-
DELTA: FormulaFunctionDELTA tests whether two numbers are equal. Example: =DELTA(5,4) returns 0.
- variableengineeringFunctionssource ↗
-
engineeringFunctions: readonly FormulaFunction[] - variableERFsource ↗
-
ERF: FormulaFunctionERF returns the error function between lower and optional upper bounds. Example: =ERF(1) returns about 0.842701.
- variableERF_PRECISEsource ↗
-
ERF_PRECISE: FormulaFunctionERF.PRECISE returns the error function from zero to x. Example: =ERF.PRECISE(1) returns about 0.842701.
- variableERFCsource ↗
-
ERFC: FormulaFunctionERFC returns the complementary error function. Example: =ERFC(1) returns about 0.157299.
- variableERFC_PRECISEsource ↗
-
ERFC_PRECISE: FormulaFunctionERFC.PRECISE returns the precise complementary error function. Example: =ERFC.PRECISE(1) returns about 0.157299.
- variableGESTEPsource ↗
-
GESTEP: FormulaFunctionGESTEP tests whether a number is at least a threshold. Example: =GESTEP(5,4) returns 1.
- variableHEX2BINsource ↗
-
HEX2BIN: FormulaFunctionHEX2BIN converts hexadecimal to binary. Example: =HEX2BIN("F") returns 1111.
- variableHEX2DECsource ↗
-
HEX2DEC: FormulaFunctionHEX2DEC converts hexadecimal to decimal. Example: =HEX2DEC("A5") returns 165.
- variableHEX2OCTsource ↗
-
HEX2OCT: FormulaFunctionHEX2OCT converts hexadecimal to octal. Example: =HEX2OCT("F") returns 17.
- variableIMABSsource ↗
-
IMABS: FormulaFunctionIMABS returns the modulus of a complex number. Example: =IMABS("3+4i") returns 5.
- variableIMAGINARYsource ↗
-
IMAGINARY: FormulaFunctionIMAGINARY returns the imaginary coefficient. Example: =IMAGINARY("3+4i") returns 4.
- variableIMARGUMENTsource ↗
-
IMARGUMENT: FormulaFunctionIMARGUMENT returns a complex number's angle in radians. Example: =IMARGUMENT("3+4i") returns about 0.9273.
- variableIMCONJUGATEsource ↗
-
IMCONJUGATE: FormulaFunctionIMCONJUGATE returns the complex conjugate. Example: =IMCONJUGATE("3+4i") returns a 3-4i.
- variableIMCOSsource ↗
-
IMCOS: FormulaFunctionIMCOS returns the cosine of a complex number. Example: =IMCOS("1+i") returns a complex cosine.
- variableIMCOSHsource ↗
-
IMCOSH: FormulaFunctionIMCOSH returns the hyperbolic cosine of a complex number. Example: =IMCOSH("1+i") returns a complex hyperbolic cosine.
- variableIMCOTsource ↗
-
IMCOT: FormulaFunctionIMCOT returns the cotangent of a complex number. Example: =IMCOT("1+i") returns a complex cotangent.
- variableIMCOTHsource ↗
-
IMCOTH: FormulaFunctionIMCOTH returns the hyperbolic cotangent. Example: =IMCOTH("1+i") returns a complex value.
- variableIMCSCsource ↗
-
IMCSC: FormulaFunctionIMCSC returns the cosecant of a complex number. Example: =IMCSC("1+i") returns a complex cosecant.
- variableIMCSCHsource ↗
-
IMCSCH: FormulaFunctionIMCSCH returns the hyperbolic cosecant of a complex number. Example: =IMCSCH("1+i") returns a complex hyperbolic cosecant.
- variableIMDIVsource ↗
-
IMDIV: FormulaFunctionIMDIV divides one complex number by another. Example: =IMDIV("3+4i","5-3i") returns their quotient.
- variableIMEXPsource ↗
-
IMEXP: FormulaFunctionIMEXP returns the exponential of a complex number. Example: =IMEXP("1+i") returns a complex exponential.
- variableIMLNsource ↗
-
IMLN: FormulaFunctionIMLN returns the natural logarithm of a complex number. Example: =IMLN("3+4i") returns a complex logarithm.
- variableIMLOGsource ↗
-
IMLOG: FormulaFunctionIMLOG returns a complex logarithm in a chosen base. Example: =IMLOG("8",2) returns 3.
- variableIMLOG10source ↗
-
IMLOG10: FormulaFunctionIMLOG10 returns the base-10 logarithm of a complex number. Example: =IMLOG10("3+4i") returns a complex logarithm.
- variableIMLOG2source ↗
-
IMLOG2: FormulaFunctionIMLOG2 returns the base-2 logarithm of a complex number. Example: =IMLOG2("3+4i") returns a complex logarithm.
- variableIMPOWERsource ↗
-
IMPOWER: FormulaFunctionIMPOWER raises a complex number to a real power. Example: =IMPOWER("2+3i",3) returns "-46+9i".
- variableIMPRODUCTsource ↗
-
IMPRODUCT: FormulaFunctionIMPRODUCT multiplies complex numbers and ranges. Example: =IMPRODUCT("3+4i","5-3i") returns "27+11i".
- variableIMREALsource ↗
-
IMREAL: FormulaFunctionIMREAL returns the real coefficient. Example: =IMREAL("6-9i") returns 6.
- variableIMSECsource ↗
-
IMSEC: FormulaFunctionIMSEC returns the secant of a complex number. Example: =IMSEC("1+i") returns a complex secant.
- variableIMSECHsource ↗
-
IMSECH: FormulaFunctionIMSECH returns the hyperbolic secant of a complex number. Example: =IMSECH("1+i") returns a complex hyperbolic secant.
- variableIMSINsource ↗
-
IMSIN: FormulaFunctionIMSIN returns the sine of a complex number. Example: =IMSIN("1+i") returns a complex sine.
- variableIMSINHsource ↗
-
IMSINH: FormulaFunctionIMSINH returns the hyperbolic sine of a complex number. Example: =IMSINH("1+i") returns a complex hyperbolic sine.
- variableIMSQRTsource ↗
-
IMSQRT: FormulaFunctionIMSQRT returns the square root of a complex number. Example: =IMSQRT("1+i") returns a complex square root.
- variableIMSUBsource ↗
-
IMSUB: FormulaFunctionIMSUB subtracts the second complex number from the first. Example: =IMSUB("13+4i","5+3i") returns "8+i".
- variableIMSUMsource ↗
-
IMSUM: FormulaFunctionIMSUM adds complex numbers and ranges. Example: =IMSUM("3+6i","5-2i") returns "8+4i".
- variableIMTANsource ↗
-
IMTAN: FormulaFunctionIMTAN returns the tangent of a complex number. Example: =IMTAN("1+i") returns a complex tangent.
- variableIMTANHsource ↗
-
IMTANH: FormulaFunctionIMTANH returns the hyperbolic tangent. Example: =IMTANH("1+i") returns a complex value.
- variableOCT2BINsource ↗
-
OCT2BIN: FormulaFunctionOCT2BIN converts octal to binary. Example: =OCT2BIN("3") returns 11.
- variableOCT2DECsource ↗
-
OCT2DEC: FormulaFunctionOCT2DEC converts octal to decimal. Example: =OCT2DEC("54") returns 44.
- variableOCT2HEXsource ↗
-
OCT2HEX: FormulaFunctionOCT2HEX converts octal to hexadecimal. Example: =OCT2HEX("100") returns 40.
- functionregisterEngineeringFunctionssource ↗
-
registerEngineeringFunctions(registry: IFunctionRegistry, options?: EngineeringFunctionRegistrationOptions): (): voidRegisters engineering formulas into an editor-local registry and returns an idempotent disposer.
registry: IFunctionRegistryoptions: EngineeringFunctionRegistrationOptions
Package
@searsuite/sear-plugin-formula
Sheet formula source, evaluation scheduling, dependency tracking, and result projection.
- namespaceFormulaRegistryOwnershipsource ↗
-
FormulaRegistryOwnership: unknownvariablesymbol symbol: typeof symbol - namespaceFormulaSchedulerDataSourcesource ↗
-
FormulaSchedulerDataSource: unknownvariablesymbol symbol: typeof symbolDI token for resolving FormulaSchedulerDataSource.
- classCellFormulaValueConverterRegistrysource ↗
-
class CellFormulaValueConverterRegistryCell 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): CellFormulaValueConverterRegistryCreates 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 symbolDI token for resolving CellFormulaValueConverterRegistry.
methodregister register(converter: CellFormulaValueConverter): (): voidRegisters 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): FormulaValueConverts 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 IFormulaCalculationTraceProviderEditor-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): FormulaCalculationTraceBusCreates a trace hub bound to one editor instance.
platform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FormulaCalculationTraceBus.
methodemit emit(event: Omit<FormulaBatchFlushedEvent, "sequence"> | Omit<FormulaDependenciesChangedEvent, "sequence"> | Omit<FormulaErrorChangedEvent, "sequence"> | Omit<FormulaRecalculationCompletedEvent, "sequence">): voidEmits 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): voidSeals event publication after initial formula data has been scanned.
isCommandExecuting: (): boolean
methodsubscribeFormulaCalculationTrace subscribeFormulaCalculationTrace(listener: FormulaCalculationTraceListener): (): voidSubscribes 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 FormulaCrossSheetHighlightSourceOptional workbook-owned source for cross-sheet formula reference overlays.
constructorconstructor FormulaCrossSheetHighlightSource(): FormulaCrossSheetHighlightSourcepropertysymbolstatic readonly symbol: typeof symbolmethodgetReferences getReferences(selectionRevision: number, selectionSource?: string): readonly FormulaCrossSheetReference[]selectionRevision: numberselectionSource: string
- classFormulaRefShiftersource ↗
-
class FormulaRefShifterRewrites formula references after Sheet structure changes.
constructorconstructor FormulaRefShifter(parser: IFormulaParser): FormulaRefShifterCreates a FormulaRefShifter instance.
parser: IFormulaParser
propertysymbolstatic readonly symbol: typeof symbolDI 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 FormulaRenderInvalidatorFormula-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): FormulaRenderInvalidatordisplayedValueChanges: SheetDisplayedValueChanges
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FormulaRenderInvalidator.
methodbind bind(handler: FormulaRenderInvalidationHandler): (): voidRegisters 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[]): voidReports formula result changes to displayed-value subscribers.
keys: readonly number[]- Formula cell keys whose derived display values changed.
- classFormulaResultProviderRegistrysource ↗
-
class FormulaResultProviderRegistry extends IFormulaResultProviderInstance-local result provider registry exposed as the renderer's formula result reader.
constructorconstructor FormulaResultProviderRegistry(): FormulaResultProviderRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the registry owned by one SheetEditor instance.
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): voidBinds post-assembly registration and disposal to the owning command bus.
isExecuting: (): booleanremove: (id: number): void
methodforEachFormulaResultInRange forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): voidVisits derived result coordinates published by registered providers, once per position.
startRow: numberstartColumn: numberendRow: numberendColumn: numbervisit: (row: number, column: number): void
methodgetFormulaResult getFormulaResult(row: number, col: number): FormulaValue | undefinedReads the first defined result supplied by registered providers.
row: numbercol: number
methodregister register(registration: FormulaResultProviderRegistration): (): voidRegisters one formula result provider and returns an idempotent disposer.
registration: FormulaResultProviderRegistration
methodunregister unregister(id: number): voidRemoves one provider inside the formula owner's unregister command.
id: number
- classFormulaResultStoresource ↗
-
class FormulaResultStoreStores calculated formula results independently from persisted formula source.
constructorconstructor FormulaResultStore(valueConverters: CellFormulaValueConverterRegistry): FormulaResultStoreCreates a FormulaResultStore instance.
valueConverters: CellFormulaValueConverterRegistry
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving FormulaResultStore.
methodcellToFormulaValue cellToFormulaValue(row: number, col: number, cell: CellMatrixElement | null | undefined): FormulaValueConverts 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: numbercol: numbercell: CellMatrixElement | null | undefined
methodclear clear(): voidClears state owned by FormulaResultStore.
methoddelete delete(key: number): voidRemoves the calculated result for one formula cell.
key: number
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidCloses 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): voidVisits projected spill coordinates in a range; formula anchors live in the Sheet data matrix.
startRow: numberstartColumn: numberendRow: numberendColumn: numbervisit: (row: number, column: number): void
methodget get(key: number): FormulaValue | undefinedReturns the value.
key: number
methodgetAt getAt(row: number, col: number): FormulaValue | undefinedReads an anchor or projected spill value at any sheet coordinate.
row: numbercol: number
methodhas has(key: number): booleanReturns whether value exists.
key: number
methodset set(key: number, value: FormulaValue): voidUpdates the value.
key: numbervalue: 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: numbervalue: FormulaValuecontext: { isCellInBounds: unknown; isCellOccupied?: unknown }
- classFormulaRichResultProviderRegistrysource ↗
-
class FormulaRichResultProviderRegistry extends IFormulaRichResultProviderInstance-local provider registry for formula hyperlinks, images, and future rich results.
constructorconstructor FormulaRichResultProviderRegistry(): FormulaRichResultProviderRegistrypropertysymbolstatic readonly symbol: typeof symbolmethodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): voidisExecuting: (): booleanremove: (id: number): void
methodgetFormulaRichResult getFormulaRichResult(row: number, col: number): FormulaRichResult | undefinedrow: numbercol: number
methodregister register(registration: FormulaRichResultProviderRegistration): (): voidregistration: FormulaRichResultProviderRegistration
methodunregister unregister(id: number): voidid: number
- classFormulaSourceProviderRegistrysource ↗
-
class FormulaSourceProviderRegistry extends IFormulaSourceProviderEditor-local ordered registry for formula source providers.
constructorconstructor FormulaSourceProviderRegistry(): FormulaSourceProviderRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving IFormulaSourceProvider.
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): voidisExecuting: (): booleanremove: (id: number): void
methodgetFormulaSource getFormulaSource(row: number, col: number): string | undefinedGets 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: numbercol: number
methodregister register(registration: FormulaSourceProviderRegistration): (): voidregistration: FormulaSourceProviderRegistration
methodunregister unregister(id: number): voidid: number
- classRecalcSchedulersource ↗
-
class RecalcSchedulerSchedules 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): RecalcSchedulerCreates a RecalcScheduler instance.
graph: IDependencyGraphevaluator: IFormulaEvaluatorresultStore: FormulaResultStoreaggCache: IAggregationCachedataSource: FormulaSchedulerDataSourceplatform: PlatformrenderInvalidator: FormulaRenderInvalidatortrace: FormulaCalculationTraceBusfunctionRegistry: IFunctionRegistryiterationSettings: IFormulaIterationSettingsProvider
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving RecalcScheduler.
methodbindAstCache bindAstCache(cache: ReadonlyMap<number, FormulaAST>): voidBinds the formula owner's cache during plugin setup.
cache: ReadonlyMap<number, FormulaAST>
methodbindCommandBus bindCommandBus(commands: SheetCommandBus): voidBinds asynchronous formula work to the owning editor's command bus.
commands: SheetCommandBus
methodbindTeardownToken bindTeardownToken(token: object): voidGives the owning editor lifecycle exclusive authority to dispose the mounted scheduler.
token: object
methoddiscardPendingWork discardPendingWork(): voidDiscards pending formula batches when committed formula inputs are replaced.
methoddispose dispose(token?: object): voidReleases scheduler-owned subscriptions.
token: object
methodgetFormulaKeys getFormulaKeys(): IterableIterator<number>Iterates formula coordinates without exposing the cache for mutation.
methodmarkDirty markDirty(changedKeys: number[]): voidTriggers 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[]): voidRecalculates formulas that contain any of the supplied function names.
functionNames: readonly string[]
methodprocessScheduledBatch processScheduledBatch(): voidRuns one budgeted batch inside the formula owner's command.
methodrecalculateVolatile recalculateVolatile(): voidStarts an explicit recalculation epoch for every formula containing a volatile call.
methodresumePendingWork resumePendingWork(): voidResumes 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, IFormulaStatusProviderOwns 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): SheetFormulaPluginCreates a SheetFormulaPlugin instance.
parser: IFormulaParsergraph: IDependencyGraphaggCache: IAggregationCacheresultStore: FormulaResultStorescheduler: RecalcSchedulerrefShifter: FormulaRefShiftertrace: FormulaCalculationTraceBusdataEngine: DataEngineplatform: Platformresults: IFormulaResultProviderresultProviders: FormulaResultProviderRegistryrichResultProviders: FormulaRichResultProviderRegistrysourceProviders: FormulaSourceProviderRegistryfunctions: IFunctionRegistryexternalServices: IFormulaExternalServiceProvidertextServices: IFormulaTextServiceProvider
propertydepthinherited readonly depth: numberDraw 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: ColDeletepropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for SheetFormulaPlugin.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetFormulaPlugin.
memberkeyinherited key: unknownmethodapply apply(_pluginState: null, transaction: Transaction): nullRejects unsupported structure operations before the owning transaction commits.
Derived ASTs are not staged as plugin state._pluginState: nulltransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceProviderCommandBoundary enforceProviderCommandBoundary(commands: SheetCommandBus, workbookOwnership?: FormulaRegistryOwnership): voidSeals provider registration once every configured Sheet plugin has started.
commands: SheetCommandBusworkbookOwnership: FormulaRegistryOwnership
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts 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): voidExposes derived spill coordinates to sparse range consumers.
startRow: numberstartColumn: numberendRow: numberendColumn: numbervisit: (row: number, column: number): void
methodgetFormulaCellStatus getFormulaCellStatus(row: number, col: number): FormulaCellStatusIFormulaStatusProvider implementation used by hosts and plugins to inspect
formula source, result, dirty state, and dependency edges without touching
plugin-owned caches directly.row: numbercol: number
methodgetFormulaResult getFormulaResult(row: number, col: number): FormulaValue | undefinedIFormulaResultProvider 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: numbercol: number
methodgetFormulaSource getFormulaSource(row: number, col: number): string | undefinedIFormulaSourceProvider implementation used by editors to read persisted formula text.
row: numbercol: number
methodgetPluginConfig getPluginConfig(): unknownReturns the plugin config.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCell onInitialDataCell(_searCore: SearCoreSheet, value: unknown, row: number, col: number): voidReceives 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: SearCoreSheetvalue: unknownrow: numbercol: number
methodonInitialDataComplete onInitialDataComplete(_searCore: SearCoreSheet): voidStarts one recalculation after dependencies for all initial formulas have been registered.
_searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidRebuilds 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: nulltransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidRegisters formula calculation trace as an editor-local host observation.
observations: ObservationRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes formula identity updates to the same atomic cell-move plan.
registry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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): voidPlans 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: 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): SheetFormulaReferenceHighlightPluginCreates a SheetFormulaReferenceHighlightPlugin instance.
statusProvider: IFormulaStatusProviderconfigEngine: ConfigEnginehighlightRegistry: SheetHighlightRegistryinteractionStore: SheetInteractionStore
propertydepth depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether 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: PluginKeyStable plugin key for SheetFormulaReferenceHighlightPlugin.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetFormulaReferenceHighlightPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: Record<string, never>, _transaction: Transaction): Record<string, never> | nullApplies a transaction to SheetFormulaReferenceHighlightPlugin state.
_state: Record<string, never>_transaction: Transaction
methodbindCrossSheetSource bindCrossSheetSource(source: FormulaCrossSheetHighlightSource): voidBinds an optional workbook-owned reference source for this Sheet instance.
source: FormulaCrossSheetHighlightSource
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts 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(): unknownReturns the plugin config.
methodgetStateinherited getState(): Record<string, never>Returns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: object
- interfaceCellFormulaValueConvertersource ↗
-
interface CellFormulaValueConverterDefines how one persisted cell type enters the formula domain.
propertycellType readonly cellType: stringPersisted cell type identifier handled by this converter.
methodtoFormulaValue toFormulaValue(cell: CellMatrixElement): FormulaValueConverts 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 FormulaCellStatusCommandInputInput for querying one cell's formula status through the host command bus.
- interfaceFormulaCellStatusCommandResultsource ↗
-
interface FormulaCellStatusCommandResult extends SheetCommandResultCommand 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: PipelinePipeline containing transaction, render, interaction and local-action steps.
propertystatus readonly status: FormulaCellStatusFormula status snapshot returned by the formula status provider.
- interfaceFormulaCrossSheetReferencesource ↗
-
interface FormulaCrossSheetReferenceOne workbook-qualified reference projected onto the currently mounted sheet.
- interfaceFormulaDependencyCellRefsource ↗
-
interface FormulaDependencyCellRefProduct-facing cell coordinate plus A1 reference label.
- interfaceFormulaDependencyStatussource ↗
-
interface FormulaDependencyStatusProduct-facing formula dependency status for one queried cell.
propertycell readonly cell: FormulaDependencyCellRefQueried 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: FormulaCellStatusUnderlying 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 FormulaDependencyStatusCommandInputInput for querying product-facing formula dependency status.
propertycol readonly col: numberColumn index (0-based).
propertyincludeTransitive readonly includeTransitive?: booleanWhether to include transitive dependency/dependent cells beyond direct edges.
propertymaxDepth readonly maxDepth?: numberMaximum traversal depth used when includeTransitive is true. Defaults to 8.
propertyrow readonly row: numberRow index (0-based).
- interfaceFormulaDependencyStatusCommandResultsource ↗
-
interface FormulaDependencyStatusCommandResult extends SheetCommandResultCommand 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: FormulaDependencyStatusProduct-facing dependency snapshot for the queried cell.
propertyeffectsinherited readonly effects?: readonly SheetCommandEffect[]Optional local effects requested after pipeline execution.
propertypipelineinherited readonly pipeline: PipelinePipeline containing transaction, render, interaction and local-action steps.
- interfaceFormulaIdleCommandResultsource ↗
-
interface FormulaIdleCommandResult extends SheetCommandResultResult 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: PipelinePipeline containing transaction, render, interaction and local-action steps.
- interfaceFormulaIdleProvidersource ↗
-
interface FormulaIdleProviderProvider contract used by the deterministic formula-idle command.
methodwaitForIdle waitForIdle(): Promise<void>Resolves after all currently scheduled formula work has completed.
- interfaceFormulaReferenceColorPalettesource ↗
-
interface FormulaReferenceColorPaletteNamed palette entries stay compatible with the reactive configuration engine.
propertyazure azure: stringpropertyblue blue: stringpropertybrown brown: stringpropertycyan cyan: stringpropertyemerald emerald: stringpropertygreen green: stringpropertyindigo indigo: stringpropertyorange orange: stringpropertyrose rose: stringpropertyslate slate: stringpropertyteal teal: stringpropertyviolet violet: string - interfaceFormulaReferenceHighlightConfigsource ↗
-
interface FormulaReferenceHighlightConfigFormula-reference overlay settings used while editing a formula.
propertyactiveReferenceFillOpacity activeReferenceFillOpacity: numberOpacity of the referenced-cell overlay under the formula cursor.
propertyreferenceColors referenceColors: FormulaReferenceColorPaletteStable, high-contrast colors assigned to formula references.
propertyreferenceFillOpacity referenceFillOpacity: numberOpacity of referenced-cell overlays when the cursor is elsewhere.
- interfaceFormulaRegistryOwnershipsource ↗
-
interface FormulaRegistryOwnershipMarks formula registries borrowed from a Workbook owner by a mounted Sheet.
propertyexternalServices readonly externalServices: booleanpropertyfunctions readonly functions: booleanpropertytextServices readonly textServices: boolean - interfaceFormulaResultProviderRegistrationsource ↗
-
interface FormulaResultProviderRegistrationOrdered formula result provider registered for one SheetEditor instance.
- interfaceFormulaRichResultProviderRegistrationsource ↗
-
interface FormulaRichResultProviderRegistrationOrdered rich-result provider registered for one SheetEditor instance.
- interfaceFormulaSchedulerDataSourcesource ↗
-
interface FormulaSchedulerDataSourceNarrow 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): EvalContextBuilds 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): (): voidSubscribes to host-service cache changes that require selected functions to be evaluated again.
handler: FormulaExternalServiceInvalidationHandler
methodonViewportChanged onViewportChanged(handler: FormulaViewportChangeHandler): (): voidSubscribes 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 - interfaceUnregisterFormulaProviderInputsource ↗
-
interface UnregisterFormulaProviderInputpropertykind readonly kind: FormulaProviderKindpropertyregistrationId 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 = nullFormula 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[]): voidCompatibility callback for formula-result change notifications.
- typeFormulaViewportChangeHandlersource ↗
-
type FormulaViewportChangeHandler = (): voidCallback 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: PluginKeyShared 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): stringAssigns a formula reference its Excel-style, position-based palette color.
referenceIndex: numbercolors: FormulaReferenceColorPalette
- functionlockFormulaResultValuesource ↗
-
lockFormulaResultValue(value: FormulaValue): voidLocks a calculated value once when it enters the editor-local result cache.
value: FormulaValue
- functionregisterFormulaStatusCommandssource ↗
-
registerFormulaStatusCommands(commands: SheetCommandBus, provider: IFormulaStatusProvider, idleProvider?: FormulaIdleProvider): voidRegisters 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
Persistent Sheet freeze boundaries and typed command surface.
- classSheetFreezeBoundaryErrorsource ↗
-
class SheetFreezeBoundaryError extends SearErrorPublic invalid-boundary error with stable diagnostics.
constructorconstructor SheetFreezeBoundaryError(input: SheetFreezeState, rowCount: number, columnCount: number): SheetFreezeBoundaryErrorinput: SheetFreezeStaterowCount: numbercolumnCount: number
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_FREEZE_INVALID_BOUNDARY"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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]): SheetFreezeMatrixCreates or restores a freeze matrix.
data: SheetFreezeMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: number | null[]): SheetFreezeMatrixAdds 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): thisAdds a boundary count through the same sparse normalization.
row: numbercolumn: numbervalue: number | null
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: number | null[]): SheetFreezeMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: number | null): number | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: number | null): number | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetFreezeMatrixDeletes 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): SheetFreezeMatrixDeletes 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>[]): SheetFreezeMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: number | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: number | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: number | null, col: number): void
methodfromDenseinherited fromDense(denseArray: number | null[][]): SheetFreezeMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: number | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): number | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: number | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: number | null- The default value to return for missing elements
methodsetItem setItem(row: number, column: number, value: number | null): thisSets a boundary count, removing empty values from sparse storage.
row: numbercolumn: numbervalue: number | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): SheetFreezeMatrixSwaps 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): SheetFreezeMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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]): SheetFreezePluginstate: SheetFreezePluginStateshape: (): readonly [number, number]
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetFreezePluginState, SheetFreezePluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(state: SheetFreezePluginState, transaction: Transaction): SheetFreezePluginState | nullApplies a transaction to plugin-owned state and returns the next state.
state: SheetFreezePluginStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: unknown, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetFreezePluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetFreezePluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetFreezePluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetFreezePluginStatetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetFreezePluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetFreezePluginStatecommitToken: object
- interfaceSheetFreezeCommandSourcesource ↗
-
interface SheetFreezeCommandSourceSupplies current boundaries and sheet dimensions to the command factory.
- interfaceSheetFreezeMatrixDatasource ↗
-
interface SheetFreezeMatrixDataSparse serialization payload accepted by the freeze matrix.
- interfaceSheetFreezePluginStatesource ↗
-
interface SheetFreezePluginStateDocument-owned state for one Sheet editor's freeze boundaries.
propertyfreeze readonly freeze: SheetFreezeMatrixSparse freeze boundary matrix.
- interfaceSheetFreezeStatesource ↗
-
interface SheetFreezeStateNumber of leading rows and columns kept visible while scrolling.
- 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: SheetFreezeStatesource: SheetFreezeCommandSource
- functionreadSheetFreezesource ↗
-
readSheetFreeze(dataEngine: DataEngine): SheetFreezeStateReads freeze boundaries, returning zeroes when the plugin is absent.
dataEngine: DataEngine
Package
@searsuite/sear-plugin-header-highlight
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): SheetHeaderHighlightPluginCreates a SheetHeaderHighlightPlugin instance.
sheetSelectionPlugin: SheetSelectionPluginsheetCornerPlugin: SheetCornerPlugin
propertydepth depth: numberBase render depth for plugin-generated nodes.
The plugin places highlight background atdepth + 1.5and emphasis bars atdepth + 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for SheetHeaderHighlightPlugin.
propertysymbolstatic readonly symbol: symbolDI token for resolving SheetHeaderHighlightPlugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: ISheetHeaderHighlight, _transaction: Transaction): ISheetHeaderHighlightApplies a transaction to SheetHeaderHighlightPlugin state.
pluginState: ISheetHeaderHighlight_transaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(searCore: SearCoreSheet): nullReturns plugin-specific configuration.
This plugin currently reads config directly fromconfigEngineduring render.searCore: SearCoreSheet
methodgetStateinherited getState(): ISheetHeaderHighlightReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: ISheetHeaderHighlight): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: ISheetHeaderHighlight
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: ISheetHeaderHighlighttransaction: 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 fromSheetSelectionPlugin.
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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: ISheetHeaderHighlight, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: ISheetHeaderHighlightcommitToken: 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
Commit-driven Sheet and Doc undo and redo stacks.
- classSheetHistoryPluginsource ↗
-
class SheetHistoryPlugin extends Plugin<SearCoreSheet, CellProperties, null>, SheetLifecycleController, SheetHistoryStatusProviderEditor-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): SheetHistoryPluginplugins: PluginManager<SearCoreSheet, CellProperties>interaction: SheetInteractionStorekeyboard: KeyboardRouterplatform: Platformcommands: SheetCommandBus
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable owner key for the private history state.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the default Sheet history plugin.
memberkeyinherited key: unknownmethodapply apply(_state: null, _transaction: Transaction): nullHistory observes committed commands and owns no transactional sheet projection.
_state: null_transaction: Transaction
methoddestroy destroy(): voidReleases command/status subscriptions owned by this editor instance.
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullHistory has no render-time configuration.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodgetStatus getStatus(): SheetHistoryStatusReturns current undo and redo availability.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidRegisters the host-facing history status observation for this editor.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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(): nullHistory contributes no scene nodes.
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodstart start(_context: SheetLifecycleContext): voidStarts command observation and semantic keyboard shortcuts after Core is ready.
_context: SheetLifecycleContext
methodsubscribe subscribe(listener: (status: SheetHistoryStatus): void): (): voidSubscribes to future history availability changes.
listener: (status: SheetHistoryStatus): void
- classSheetHistoryStatusProvidersource ↗
-
class SheetHistoryStatusProviderEditor-local DI contract used by plugins that render history controls.
constructorconstructor SheetHistoryStatusProvider(): SheetHistoryStatusProviderpropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the active editor's history status provider.
methodgetStatus getStatus(): SheetHistoryStatusReturns the current editor-local history availability.
methodsubscribe subscribe(listener: (status: SheetHistoryStatus): void): (): voidObserves future history availability changes and returns an idempotent disposer.
listener: (status: SheetHistoryStatus): void
- interfaceSheetHistoryEntrysource ↗
-
interface SheetHistoryEntry - interfaceSheetHistorySessionStatesource ↗
-
interface SheetHistorySessionStateIn-memory history retained for one sheet session while a workbook is open.
- interfaceSheetHistoryStatussource ↗
-
interface SheetHistoryStatusImmutable status published whenever one editor's history availability changes.
- 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
Editor-local locale registration and built-in English and Chinese formula locales.
- classSheetI18nLocaleRegistrysource ↗
-
class SheetI18nLocaleRegistryEditor-local registry for built-in and third-party locale contributions.
constructorconstructor SheetI18nLocaleRegistry(): SheetI18nLocaleRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetI18nLocaleRegistry.
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): voidSeals runtime registrations after every plugin has started.
isExecuting: (): booleandispatchRemoval: (id: number): void
methodget get(locale: string): SheetI18nLocaleEntry | undefinedReturns a registered locale contribution, if present.
locale: string
methodhas has(locale: string): booleanReturns 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): (): voidRegisters one locale contribution and returns an idempotent disposer.
registration: SheetI18nLocaleRegistration
methodrequire require(locale: string): SheetI18nLocaleEntryReturns a required locale contribution.
locale: string
methodunregister unregister(id: number): voidRemoves one contribution through the locale owner's command after assembly.
id: number
- classSheetI18nPluginsource ↗
-
class SheetI18nPlugin extends Plugin<SearCoreSheet, CellProperties, null>, IFormulaLocaleProvider, ICellFormatLocaleProviderEditor-local i18n plugin for built-in English and Chinese locale services.
constructorconstructor SheetI18nPlugin(locales: SheetI18nLocaleRegistry): SheetI18nPluginCreates a SheetI18nPlugin instance.
locales: SheetI18nLocaleRegistry
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for SheetI18nPlugin.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetI18nPlugin.
memberkeyinherited key: unknownmethodapply apply(state: null, _transaction: Transaction): nullApplies no document mutations because i18n is local runtime state.
state: null_transaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetCellFormatLocale getCellFormatLocale(): CellFormatLocaleICellFormatLocaleProvider implementation.
methodgetDateTimeLocale getDateTimeLocale(): FormulaDateTimeLocaleIFormulaLocaleProvider implementation.
methodgetLocale getLocale(): stringReturns the active locale.
methodgetPluginConfig getPluginConfig(): nullReturns the plugin config.
methodgetStateinherited getState(): nullReturns the plugin-owned state currently registered with the manager.
methodgetTextLocale getTextLocale(): FormulaTextLocaleIFormulaLocaleProvider implementation.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(context: { container: Container }): voidDiscovers formula scheduling after the formula runtime has registered its services.
context: { container: Container }
methodlockCommittedStateinherited lockCommittedState(state: null): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: null
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: nulltransaction: Transaction
methodregisterCapabilities registerCapabilities(registry: RuntimeCapabilityRegistry): voidPublishes the i18n locale registry for third-party locale contributions.
registry: RuntimeCapabilityRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters language switching commands.
commands: SheetCommandBus
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterObservations registerObservations(observations: ObservationRegistry): voidRegisters the current i18n state observation.
observations: ObservationRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWrites sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetLocale setLocale(locale: string): voidUpdates the active locale and notifies observers.
locale: string
methodsetStateinherited setState(state: null, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: nullcommitToken: object
methodtoggleLocale toggleLocale(): voidToggles between English and Chinese.
methodregisterServicesstatic registerServices(context: { container: Container }): voidPublishes this plugin as the editor-local formula locale provider.
context: { container: Container }
- interfaceSetSheetLocaleInputsource ↗
-
interface SetSheetLocaleInputInput for setting the editor-local language.
propertylocale readonly locale: string - interfaceSheetI18nLocaleEntrysource ↗
-
interface SheetI18nLocaleEntryNormalized locale contribution stored by the editor-local registry.
propertycellFormatLocale readonly cellFormatLocale: CellFormatLocaleSheet cell number and date/time display defaults for this locale.
propertydateTimeLocale readonly dateTimeLocale: FormulaDateTimeLocaleFormula date/time parser and formatter for this locale.
propertydateTimeSymbols readonly dateTimeSymbols?: FormulaDateTimeSymbolsLocale-specific date/time symbols used by the shared Excel parser.
propertydisplayName readonly displayName: stringUser-facing language label supplied by the owner.
propertylocale readonly locale: stringStable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.
propertytextLocale readonly textLocale: FormulaTextLocaleFormula text byte/width strategy for DBCS-compatible functions.
- interfaceSheetI18nLocaleRegistrationsource ↗
-
interface SheetI18nLocaleRegistrationLocale contribution registered with the editor-local i18n registry.
propertycellFormatLocale readonly cellFormatLocale?: CellFormatLocaleSheet cell number and date/time display defaults for this locale.
propertydateTimeLocale readonly dateTimeLocale?: FormulaDateTimeLocaleFormula date/time parser and formatter for this locale.
propertydateTimeSymbols readonly dateTimeSymbols?: FormulaDateTimeSymbolsLocale-specific date/time symbols used by the shared Excel parser.
propertydisplayName readonly displayName: stringUser-facing language label supplied by the owner.
propertylocale readonly locale: stringStable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.
propertytextLocale readonly textLocale?: FormulaTextLocaleFormula text byte/width strategy for DBCS-compatible functions.
- interfaceSheetI18nStatesource ↗
-
interface SheetI18nStateSnapshot published by the sheet i18n observation.
propertylocale readonly locale: string - typeSheetI18nLocalesource ↗
-
type SheetI18nLocale = stringLocale 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): valueReturns whether a value is a non-empty locale id.
value: unknown
- functionregisterBuiltInSheetI18nLocalessource ↗
-
registerBuiltInSheetI18nLocales(registry: SheetI18nLocaleRegistry): voidRegisters the default English and Chinese locale contributions.
registry: SheetI18nLocaleRegistry
Package
@searsuite/sear-plugin-resize
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): SheetResizePluginCreates a SheetResizePlugin instance.
coordEngine: CoordinateEnginecursorEngine: CursorEnginetextShaper: TextShaperdisplayTextRegistry: CellDisplayTextReaderpointerCapture: PointerCapturecommands: SheetCommandBusplatform: PlatformcursorRegistry: CursorRegistrydimensions: SheetResizeDimensions | nullcommandDataEngine: DataEngine
propertydepth depth: numberDraw 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: booleanWhether 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: PluginKeyStable plugin key shared by all resize plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving SheetResizePlugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: ResizeState, transaction: Transaction): ResizeState | nullApplies 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): voidApplies a command-owned resize drag start to local interaction state.
input: SheetBeginResizeDragInput
methoddirtyRect dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | nullMarks 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(): voidClears command-owned resize drag state.
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): unknownReturns the plugin config.
methodgetResizeState getResizeState(): ResizeDragStateReturns a detached view of the local drag session.
methodgetStateinherited getState(): ResizeStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: ResizeState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: ResizeState
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClick onDblClick(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
searCore: SearCoreSheet_event: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDown onMouseDown(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheet_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove onMouseMove(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheet_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: ResizeStatetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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>[] | nullRenders SheetResizePlugin scene output.
searCore: SearCoreSheet
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetResizeDimensions setResizeDimensions(dimensions: SheetResizeDimensions): voidInstalls 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): voidReplaces the plugin-owned state after an apply or runtime transition.
state: ResizeStatecommitToken: object
methodupdateResizeDrag updateResizeDrag(input: SheetUpdateResizeDragInput): voidApplies a command-owned resize drag move to local interaction state.
input: SheetUpdateResizeDragInput
- interfaceSheetBeginResizeDragInputsource ↗
-
interface SheetBeginResizeDragInputPublic input for starting a resize drag session.
propertyaxis readonly axis: SheetResizeAxispropertyinitialSizes readonly initialSizes: readonly SheetResizeDragInitialSize[]propertyprimaryIndex readonly primaryIndex: numberpropertyworld readonly world: { x: number; y: number } - interfaceSheetDimensionResizeInputsource ↗
-
interface SheetDimensionResizeInputOne explicit dimension change used by batch resize commands.
propertyindex readonly index: numberpropertypreviousSize readonly previousSize?: numberpropertysize readonly size: number - interfaceSheetHideColumnsInputsource ↗
-
interface SheetHideColumnsInputPublic input for hiding columns starting at
index. - interfaceSheetHideRowsInputsource ↗
-
interface SheetHideRowsInputPublic input for hiding rows starting at
index. - interfaceSheetResizeColumnsBatchInputsource ↗
-
interface SheetResizeColumnsBatchInputPublic input for resizing arbitrary columns to explicit sizes.
propertysizes readonly sizes: readonly SheetDimensionResizeInput[] - interfaceSheetResizeColumnsRangeInputsource ↗
-
interface SheetResizeColumnsRangeInputPublic input for resizing columns starting at
indexto a shared size. - interfaceSheetResizeDimensionCommandDataSourcesource ↗
-
interface SheetResizeDimensionCommandDataSourceResize-owned data required to create invertible row and column dimension operations.
propertytarget readonly target: PluginKeyPlugin key that owns row and column dimension state.
methodgetColumnCount getColumnCount(): numberCurrent column dimension count.
methodgetDefaultColumnSize getDefaultColumnSize(): numberDefault column width used when no sparse override is stored.
methodgetDefaultRowSize getDefaultRowSize(): numberDefault row height used when no sparse override is stored.
methodgetRowCount getRowCount(): numberCurrent row dimension count.
methodreadColumnSize readColumnSize(index: number): numberReads the current column width at
index.index: number
methodreadRowSize readRowSize(index: number): numberReads the current row height at
index.index: number
- interfaceSheetResizeDimensionssource ↗
-
interface SheetResizeDimensionsResize-owned dimension matrices accepted by SheetResizePlugin during setup.
propertycolumnSizes columnSizes: DimensionsCSRMatrixColumn dimension matrix used for column width state.
propertyrowSizes rowSizes: DimensionsCSRMatrixRow dimension matrix used for row height state.
- interfaceSheetResizeDragCommandControllersource ↗
-
interface SheetResizeDragCommandControllerResize drag-session state controller owned by SheetResizePlugin.
methodbeginResizeDrag beginResizeDrag(input: SheetBeginResizeDragInput): voidinput: SheetBeginResizeDragInput
methodendResizeDrag endResizeDrag(): voidmethodupdateResizeDrag updateResizeDrag(input: SheetUpdateResizeDragInput): voidinput: SheetUpdateResizeDragInput
- interfaceSheetResizeDragInitialSizesource ↗
-
interface SheetResizeDragInitialSizeOne captured size at the start of a resize drag.
- interfaceSheetResizeRowsBatchInputsource ↗
-
interface SheetResizeRowsBatchInputPublic input for resizing arbitrary rows to explicit sizes.
propertysizes readonly sizes: readonly SheetDimensionResizeInput[] - interfaceSheetResizeRowsRangeInputsource ↗
-
interface SheetResizeRowsRangeInputPublic input for resizing rows starting at
indexto a shared size. - interfaceSheetUnhideColumnsInputsource ↗
-
interface SheetUnhideColumnsInputPublic input for unhiding columns starting at
index. - interfaceSheetUnhideRowsInputsource ↗
-
interface SheetUnhideRowsInputPublic input for unhiding rows starting at
index. - interfaceSheetUpdateResizeDragInputsource ↗
-
interface SheetUpdateResizeDragInputPublic 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 | SheetResizeColumnsBatchInputPublic input for resizing columns.
- typeSheetResizeRowsInputsource ↗
-
type SheetResizeRowsInput = SheetResizeRowsRangeInput | SheetResizeRowsBatchInputPublic 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.
- variableSheetColumnSizesFieldKeysource ↗
-
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"DataEngine field for column dimensions 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: SheetHideColumnsInputdataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">
- functioncreateHideRowOperationssource ↗
-
createHideRowOperations(input: SheetHideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]Creates row hide operations from public command input.
input: SheetHideRowsInputdataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">
- functioncreateResizeColumnOperationssource ↗
-
createResizeColumnOperations(input: SheetResizeColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]Creates column resize operations from public command input.
input: SheetResizeColumnsInputdataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">
- functioncreateResizeRowOperationssource ↗
-
createResizeRowOperations(input: SheetResizeRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]Creates row resize operations from public command input.
input: SheetResizeRowsInputdataSource: 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: SheetUnhideColumnsInputdataSource: 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: SheetUnhideRowsInputdataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "getDefaultRowSize" | "readRowHiddenOriginalSize" | "readRowSize">
- functionreadSheetColumnSizessource ↗
-
readSheetColumnSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads column dimensions published by SheetResizePlugin.
dataEngine: DataEngine
- functionreadSheetRowSizessource ↗
-
readSheetRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads row dimensions published by SheetResizePlugin.
dataEngine: DataEngine
- functionregisterSheetResizeCommandssource ↗
-
registerSheetResizeCommands(commands: SheetCommandBus, dataSource: SheetResizeDimensionCommandDataSource, controller: SheetResizeDragCommandController): voidRegisters 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): voidRegisters row and column dimension commands on one sheet command bus.
commands: SheetCommandBusdataSource: SheetResizeDimensionCommandDataSource
- functionregisterSheetResizeDragCommandssource ↗
-
registerSheetResizeDragCommands(commands: SheetCommandBus, controller: SheetResizeDragCommandController): voidRegisters 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
Sheet selection state, navigation, observations, highlights, and commands.
- enumSheetAdditionalSelectionModesource ↗
-
enum SheetAdditionalSelectionModeHow a selection command updates disjoint local selections.
enum memberAppendCurrent AppendCurrent: "append-current"enum memberClear Clear: "clear"enum memberPreserve Preserve: "preserve" - enumSheetHighlightPipelineStepNamesource ↗
-
enum SheetHighlightPipelineStepNameObservable pipeline steps owned by the generic range-highlight host.
enum memberRefresh Refresh: "sheet-highlight.refresh" - enumSheetSelectionInteractionNamesource ↗
-
enum SheetSelectionInteractionNameEnumerates SheetSelectionInteractionName values.
enum memberChanged Changed: "selection-changed" - enumSheetSelectionPipelineNamesource ↗
-
enum SheetSelectionPipelineNameObservable pipeline and step names owned by the Selection module.
enum memberSelectionChange SelectionChange: "selection-change" - enumSheetSelectionPipelineStepNamesource ↗
-
enum SheetSelectionPipelineStepNameEnumerates SheetSelectionPipelineStepName values.
enum memberEnsureSelectionVisible EnsureSelectionVisible: "selection.ensure-selection-visible"enum memberRecordSelectionChange RecordSelectionChange: "selection.record-selection-change"enum memberUpdateSelection UpdateSelection: "selection.update-selection" - enumSheetSelectionPointerActionsource ↗
-
enum SheetSelectionPointerActionPointer-session transitions owned by the Sheet selection plugin.
- enumSheetSelectionSourcesource ↗
-
enum SheetSelectionSourceEnumerates SheetSelectionSource values.
- 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): SheetHighlightPluginCreates a SheetHighlightPlugin instance.
registry: SheetHighlightRegistry
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for SheetHighlightPlugin.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetHighlightPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: Record<string, never>, _transaction: Transaction): Record<string, never> | nullApplies a transaction to SheetHighlightPlugin state.
_state: Record<string, never>_transaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): unknownReturns the plugin config.
methodgetStateinherited getState(): Record<string, never>Returns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: object
- classSheetHighlightRegistrysource ↗
-
class SheetHighlightRegistryRegistry 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): SheetHighlightRegistryplatform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetHighlightRegistry.
methodgetHighlights getHighlights(context: SheetHighlightContext): SheetRangeHighlight[]Returns the highlights.
context: SheetHighlightContext
methodinvalidate invalidate(): voidRequests a new provider evaluation when state read by a provider (for
example selection, search terms, or remote cursors) changes externally.methodregister register(provider: SheetHighlightProvider): (): voidRegisters the value.
provider: SheetHighlightProvider
methodsetEnabled setEnabled(providerKey: string, enabled: boolean): voidUpdates the enabled.
providerKey: stringenabled: boolean
methodsubscribe subscribe(listener: (): void): (): voidSubscribes to state changes and returns an idempotent disposer.
listener: (): void
- classSheetRangeDragsource ↗
-
class SheetRangeDragOwns 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): SheetRangeDragcommands: SheetCommandBusqueries: SheetQueryRegistrycoordinates: CoordinateEnginepointer: PointerCapturekeyboard: KeyboardRoutercursorRules: CursorRegistrycursor: CursorEnginehighlights: SheetHighlightRegistryplatform: Platforminteractions: SheetInteractionStore
propertysymbolstatic readonly symbol: typeof symbolmethodbind bind(core: SearCoreSheet, readSelection: (): Rect, ownerToken: object): voidInstalls editor-local cursor and preview contributions once Core is available.
core: SearCoreSheetreadSelection: (): RectownerToken: object
methoddestroy destroy(ownerToken?: object): voidIdempotently releases preview, cursor, pointer capture and animation resources.
ownerToken: object
methodisActive isActive(): booleanmethodonMouseDown onMouseDown(event: EventWithOffsetAndTarget<CellProperties>): booleanStarts on selection borders or already selected axis headers.
event: EventWithOffsetAndTarget<CellProperties>
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRoutes local pointer and animation inputs through the editor command boundary.
commands: SheetCommandBus
methodsetUserInteraction setUserInteraction(service: UserInteractionService | undefined): voidBinds the optional host-owned confirmation service during assembly.
service: UserInteractionService | undefined
- classSheetRangeMoveErrorsource ↗
-
class SheetRangeMoveError extends SearErrorA range move rejected before any document state was staged.
constructorconstructor SheetRangeMoveError(code: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED", message: string, details: SearErrorDetails): SheetRangeMoveErrorcode: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED"message: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycodeinherited readonly code: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: 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): SheetSelectionPluginCreates a SheetSelectionPlugin instance.
sheetCellMergePlugin: SheetCellMergePluginkeyboardRouter: KeyboardRouterplatform: PlatforminteractionReducers: SheetInteractionReducerRegistrycommands: SheetCommandBusrangeMoves: SheetRangeMoveRegistryrangeDrag: SheetRangeDraghighlights: SheetHighlightRegistry
propertydepth depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for SheetSelectionPlugin.
propertysymbolstatic readonly symbol: symbolDI token for resolving SheetSelectionPlugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: [Rect, Rect], transaction: Transaction): [Rect, Rect] | nullApplies a transaction to SheetSelectionPlugin state.
pluginState: [Rect, Rect]transaction: Transaction
methodbindCore bindCore(core: SearCoreSheet): voidBinds this plugin to the core owned by its editor-local container.
core: SearCoreSheet
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodextendForDownwardEntry extendForDownwardEntry(): voidAdds a destination row only when Enter would otherwise keep the active cell in place.
methodgetPluginConfig getPluginConfig(searCore: SearCoreSheet): nullReturns the plugin config.
searCore: SearCoreSheet
methodgetStateinherited getState(): [Rect, Rect]Returns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodisInMergedCell isInMergedCell(rangeRect: Rect): Rect | nullReturns whether in merged cell.
rangeRect: Rect
methodlockCommittedState lockCommittedState(state: [Rect, Rect]): voidLocks committed selection rectangles while transaction clones remain writable.
state: [Rect, Rect]
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClick onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the dbl click lifecycle event.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroy onEditorDestroy(): voidCancels transient pointer work before this editor is released.
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDown onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the mouse down lifecycle event.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the mouse move lifecycle event.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp onMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the mouse up lifecycle event.
_searCore: SearCoreSheet_event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommitted onTransactionCommitted(transaction: Transaction): voidRebases 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): voidRegisters the commands.
commands: SheetCommandBus
methodregisterConfig registerConfig(): { config: ConfigUnit<{ defaultBorderColor: string }>; key: PluginKey }[]Registers default configuration values owned by this plugin.
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidRegisters the active selection as a typed query rather than a DataEngine field.
queries: SheetQueryRegistry
methodregisterSessionState registerSessionState(registry: SessionStateRegistry): voidRegisters 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: SearCoreSheetoffset: { x: number; y: number }
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: [Rect, Rect], commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: [Rect, Rect]commitToken: object
- interfaceMoveSheetRangeInputsource ↗
-
interface MoveSheetRangeInputMoves a single rectangle to a new top-left coordinate on the same sheet.
- interfaceSelectionChangedInteractionSignalsource ↗
-
interface SelectionChangedInteractionSignal extends SheetInteractionSignalPublic contract for SelectionChangedInteractionSignal.
- interfaceSheetEnsureSelectionVisibleInputsource ↗
-
interface SheetEnsureSelectionVisibleInput extends SheetSelectRangeInputPublic contract for SheetEnsureSelectionVisibleInput.
propertyactiveAnchorinherited readonly activeAnchor?: PointOptional active anchor stored for in-progress pointer or keyboard interactions.
propertyactiveFocusinherited readonly activeFocus?: PointOptional active focus stored for in-progress pointer or keyboard interactions.
propertyadditionalSelectionModeinherited readonly additionalSelectionMode?: SheetAdditionalSelectionModeTransition applied to disjoint local selections at commit.
propertyanchorinherited readonly anchor: PointFinal selected range anchor.
propertyensureVisibleinherited readonly ensureVisible?: booleanWhether the command should also scroll the selection into view.
propertyfocusinherited readonly focus: PointFinal selected range focus.
propertysourceinherited readonly source?: SheetSelectionSourceOrigin of this selection change.
- interfaceSheetFillRangeInputsource ↗
-
interface SheetFillRangeInput - interfaceSheetHighlightContextsource ↗
-
interface SheetHighlightContextRead-only sheet state made available to every range-highlight provider.
propertysearCore searCore: SearCoreSheet - interfaceSheetHighlightProvidersource ↗
-
interface SheetHighlightProviderExtension point for range decorations such as formula precedents, search
results, validation errors, collaboration selections, and audit trails.propertykey key: stringmethodgetHighlights getHighlights(context: SheetHighlightContext): SheetRangeHighlight[]context: SheetHighlightContext
- interfaceSheetRangeHighlightsource ↗
-
interface SheetRangeHighlightA visual-only cell range supplied by an independently registered provider.
propertydepth depth?: numberpropertyedge edge?: SheetHighlightEdgepropertyend end: Pointpropertyfill fill?: stringpropertyinset inset?: numberInsets the visual box from the resolved cell-range boundary.
propertyskipHit skipHit?: booleanpropertystart start: Pointpropertystroke stroke?: stringpropertystrokeWidth strokeWidth?: numberpropertytype type?: string - interfaceSheetSelectionPointerInputsource ↗
-
interface SheetSelectionPointerInputDetached input coordinates for a selection pointer transition.
propertyaction readonly action: SheetSelectionPointerActionpropertyctrlKey readonly ctrlKey?: booleanpropertymetaKey readonly metaKey?: booleanpropertyshiftKey readonly shiftKey?: booleanpropertytarget readonly target?: { endColIndex: number | undefined; endRowIndex: number | undefined; region: CellRegion | undefined; startColIndex: number | undefined; startRowIndex: number | undefined } | nullpropertyview readonly view?: { x: number; y: number } - interfaceSheetSelectRangeInputsource ↗
-
interface SheetSelectRangeInputPublic programmatic input for selecting a rectangular sheet range.
propertyactiveAnchor readonly activeAnchor?: PointOptional active anchor stored for in-progress pointer or keyboard interactions.
propertyactiveFocus readonly activeFocus?: PointOptional active focus stored for in-progress pointer or keyboard interactions.
propertyadditionalSelectionMode readonly additionalSelectionMode?: SheetAdditionalSelectionModeTransition applied to disjoint local selections at commit.
propertyanchor readonly anchor: PointFinal selected range anchor.
propertyensureVisible readonly ensureVisible?: booleanWhether the command should also scroll the selection into view.
propertyfocus readonly focus: PointFinal selected range focus.
propertysource readonly source?: SheetSelectionSourceOrigin 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.
- 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> - 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): voidRegisters the selection query against an editor-local query registry.
queries: SheetQueryRegistryreadSelection: (): SheetRangeBounds | null
- functionregisterSheetSelectionInteractionReducerssource ↗
-
registerSheetSelectionInteractionReducers(registry: SheetInteractionReducerRegistry): voidRegisters Selection's local interaction projection once per DI container.
registry: SheetInteractionReducerRegistry
Package
@searsuite/sear-plugin-sheet-demo
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]): SheetDemoMatrixdata: SheetDemoMatrixDatashape: [number, number]
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: SheetDemoMarker | null[]): SheetDemoMatrixAdds 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): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
row: number- The row index.
column: numbermarker: SheetDemoMarker | null
methodaddListenerinherited addListener(listener: Listener): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: SheetDemoMarker | null[]): SheetDemoMatrixAdds 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(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: SheetDemoMarker | null): SheetDemoMarker | null): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: SheetDemoMarker | null): SheetDemoMarker | null
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetDemoMatrixDeletes 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): SheetDemoMatrixDeletes 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>[]): SheetDemoMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: SheetDemoMarker | null, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: SheetDemoMarker | null, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: SheetDemoMarker | null, col: number): void
methodfromDenseinherited fromDense(denseArray: SheetDemoMarker | null[][]): SheetDemoMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: SheetDemoMarker | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): SheetDemoMarker | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: SheetDemoMarker | null): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: SheetDemoMarker | null- The default value to return for missing elements
methodsetItem setItem(row: number, column: number, marker: SheetDemoMarker | null): thisrow: numbercolumn: numbermarker: SheetDemoMarker | null
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): SheetDemoMatrixSwaps 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): SheetDemoMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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): SheetDemoPluginstate: SheetDemoPluginState
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetDemoPluginState, SheetDemoPluginState>propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply apply(state: SheetDemoPluginState, transaction: Transaction): SheetDemoPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
state: SheetDemoPluginStatetransaction: Transaction
methodconfigureinherited configure(context: SheetPluginSetupContext): voidConfigures the Sheet editor before its Core is created.
context: SheetPluginSetupContext
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
methodgetStateinherited getState(): SheetDemoPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitializeinherited initialize(context: SheetPluginRuntimeContext): voidPrepares behavior that requires initialized Core state but must run before
the first frame and other runtime effects.context: SheetPluginRuntimeContext
methodlockCommittedStateinherited lockCommittedState(state: SheetDemoPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetDemoPluginState
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonEditorDestroyinherited onEditorDestroy(context: SheetPluginRuntimeContext): voidReleases resources owned by this plugin before the Core is destroyed.
This deliberately does not use the namedestroy: 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): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetDemoPluginStatetransaction: Transaction
methodregisterCapabilitiesinherited registerCapabilities(registry: SheetRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this plugin.
registry: SheetRuntimeExtensionRegistry
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidThis is an override because cell fill already has a separate owner.
registry: SheetCellVisualReaderRegistry
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidContributes owner-defined format capture and transfer plans.
registry: SheetFormatTransferRegistry
methodregisterObservationsinherited registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this plugin.
observations: ObservationRegistry
methodregisterQueries registerQueries(queries: SheetQueryRegistry): voidqueries: SheetQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes state-owner planning for same-sheet cell moves.
registry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: SheetRangeReorderRegistry
methodregisterSessionStateinherited registerSessionState(registry: SessionStateRegistry): voidRegisters 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): voidContributes 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetDemoPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetDemoPluginStatecommitToken: object
methodstartinherited start(context: SheetPluginRuntimeContext): voidStarts runtime behavior after the Core has rendered its first frame.
context: SheetPluginRuntimeContext
methodregisterServicesstaticinherited registerServices(context: SheetPluginServiceContext): voidRegisters bindings required before this Sheet plugin is instantiated.
context: SheetPluginServiceContext
- interfaceSetSheetDemoMarkerInputsource ↗
-
interface SetSheetDemoMarkerInput extends SheetDemoCellInput - interfaceSheetDemoCellInputsource ↗
-
interface SheetDemoCellInput - interfaceSheetDemoCommandSourcesource ↗
-
interface SheetDemoCommandSourcepropertytarget readonly target: PluginKeymethodreadMatrix readMatrix(): SheetDemoMatrix - interfaceSheetDemoMatrixDatasource ↗
-
interface SheetDemoMatrixData - interfaceSheetDemoPluginStatesource ↗
-
interface SheetDemoPluginStatepropertymarkers 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 SheetDemoStateTokenThe host binds one state object per Sheet editor before plugin construction.
- functionassertSheetDemoMarkersource ↗
-
assertSheetDemoMarker(value: unknown): valuevalue: unknown
- functionreadSheetDemoMarkerssource ↗
-
readSheetDemoMarkers(dataEngine: DataEngine): SheetDemoMatrix | nulldataEngine: DataEngine
- functionregisterSheetDemoCommandssource ↗
-
registerSheetDemoCommands(commands: SheetCommandBus, source: SheetDemoCommandSource): voidcommands: SheetCommandBussource: SheetDemoCommandSource
- functionregisterSheetDemoQueriessource ↗
-
registerSheetDemoQueries(queries: SheetQueryRegistry, readMatrix: (): SheetDemoMatrix): voidqueries: SheetQueryRegistryreadMatrix: (): SheetDemoMatrix
Package
@searsuite/sear-plugin-sheet-doc-adapter
The default Doc-backed rich-text editor adapter for Sheet cells.
- classSearCoreEditorAdaptersource ↗
-
class SearCoreEditorAdapter extends SheetEmbeddedEditorSheet adapter that owns one lightweight SearCoreDoc for all embedded cells.
constructorconstructor SearCoreEditorAdapter(options?: SearCoreEditorAdapterOptions): SearCoreEditorAdapteroptions: 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: ObservationRegistryTyped editor-local state and event observations exposed to the host.
methodbindTeardownToken bindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
token: object
methodcreateEditSession createEditSession(context: SheetEmbeddedEditorContext): SheetEditSessioncontext: SheetEmbeddedEditorContext
methodcreateRenderSession createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSessioncontext: SheetEmbeddedEditorContext
methoddispose dispose(ownerToken?: object): voidownerToken: object
methodinitialize initialize(context: SheetEmbeddedEditorContext): voidcontext: SheetEmbeddedEditorContext
- classSheetCellContextPluginsource ↗
-
class SheetCellContextPlugin extends SheetEmbeddedEditorPluginAdapts Sheet cell geometry and pointer coordinates for embedded sessions.
constructorconstructor SheetCellContextPlugin(): SheetCellContextPluginpropertykey readonly key: "sheet.cell-context"Stable identity used to reject duplicate registrations.
methodinitialize initialize(context: SheetEmbeddedEditorPluginContext): voidCalled once when the adapter is initialized.
context: SheetEmbeddedEditorPluginContext
methodtoLocalPoint toLocalPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPointcontext: SheetEmbeddedEditorContextpoint: SheetEditorPoint
methodtoSheetPoint toSheetPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPointcontext: SheetEmbeddedEditorContextpoint: SheetEditorPoint
- classSheetClipboardPluginsource ↗
-
class SheetClipboardPlugin extends SheetEmbeddedEditorPluginSheet clipboard codec for the shared rich-document snapshot protocol.
constructorconstructor SheetClipboardPlugin(): SheetClipboardPluginpropertykey readonly key: "sheet.clipboard"Stable identity used to reject duplicate registrations.
methoddeserialize deserialize(value: string): SheetDocumentvalue: string
methodserialize serialize(document: SheetDocument): stringdocument: SheetDocument
- classSheetDocIntegrationPluginsource ↗
-
class SheetDocIntegrationPlugin extends SheetEmbeddedEditorPluginExtension point for Sheet-to-Doc integration policies.
constructorconstructor SheetDocIntegrationPlugin(): SheetDocIntegrationPluginpropertykey readonly key: "sheet.doc-integration"Stable identity used to reject duplicate registrations.
- classSheetEmbeddedEditorPluginRegistrysource ↗
-
class SheetEmbeddedEditorPluginRegistryOrdered registry used by the lightweight Sheet embedded editor.
constructorconstructor SheetEmbeddedEditorPluginRegistry(): SheetEmbeddedEditorPluginRegistrymethoddispose dispose(ownerToken?: object): voidownerToken: object
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidRestricts plugin changes after the embedded editor joins a Sheet command bus.
assertWrite: (): voidteardownToken: object
methodget get(key: string): SheetEmbeddedEditorPlugin | undefinedkey: string
methodgetAll getAll(): readonly SheetEmbeddedEditorPlugin[]methodinitialize initialize(context: SheetEmbeddedEditorPluginContext): voidcontext: SheetEmbeddedEditorPluginContext
methodnotifyCancel notifyCancel(context: SheetEmbeddedEditorPluginContext): voidcontext: SheetEmbeddedEditorPluginContext
methodnotifyCommit notifyCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): voiddocument: SheetDocumentcontext: SheetEmbeddedEditorPluginContext
methodnotifyRender notifyRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): voidupdate: SheetRenderUpdatecontext: SheetEmbeddedEditorPluginContext
methodregister register(plugin: SheetEmbeddedEditorPlugin): voidplugin: SheetEmbeddedEditorPlugin
methodtransformCommit transformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): SheetDocument | nulldocument: SheetDocumentcontext: SheetEmbeddedEditorPluginContext
methodtransformInlineStyle transformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): SheetInlineStyleUpdate | nullupdate: SheetInlineStyleUpdatecontext: SheetEmbeddedEditorPluginContext
methodtransformInput transformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): SheetEditInput | nullinput: SheetEditInputcontext: SheetEmbeddedEditorPluginContext
methodunregister unregister(key: string): voidkey: string
- classSheetFormulaReferencePluginsource ↗
-
class SheetFormulaReferencePlugin extends SheetEmbeddedEditorPluginFinds formula-like references for Sheet overlays without changing document data.
constructorconstructor SheetFormulaReferencePlugin(): SheetFormulaReferencePluginpropertykey readonly key: "sheet.formula-reference"Stable identity used to reject duplicate registrations.
methoddispose dispose(): voidCalled before the adapter releases this plugin.
methodgetReferences getReferences(): readonly string[]methodinitialize initialize(context: SheetEmbeddedEditorPluginContext): voidCalled once when the adapter is initialized.
context: SheetEmbeddedEditorPluginContext
methodonRender onRender(_update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): voidCalled after a render pass has completed.
_update: SheetRenderUpdatecontext: SheetEmbeddedEditorPluginContext
- classSheetOverflowPluginsource ↗
-
class SheetOverflowPlugin extends SheetEmbeddedEditorPluginKeeps overflow sizing as a Sheet concern and requests geometry redraws.
constructorconstructor SheetOverflowPlugin(): SheetOverflowPluginpropertykey readonly key: "sheet.overflow"Stable identity used to reject duplicate registrations.
methoddispose dispose(): voidCalled before the adapter releases this plugin.
methodgetContentSize getContentSize(): { height: number; width: number } | nullmethodonCommit onCommit(_document: SheetDocument, _context: SheetEmbeddedEditorPluginContext): voidCalled after Sheet has committed the edited document.
_document: SheetDocument_context: SheetEmbeddedEditorPluginContext
methodonRender onRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): voidCalled after a render pass has completed.
update: SheetRenderUpdatecontext: SheetEmbeddedEditorPluginContext
- classSheetShortcutPluginsource ↗
-
class SheetShortcutPlugin extends SheetEmbeddedEditorPluginOptional key mapping hook for Sheet hosts that add cell-navigation shortcuts.
constructorconstructor SheetShortcutPlugin(shortcuts?: Readonly<Record<string, SheetEditInput>>): SheetShortcutPluginshortcuts: Readonly<Record<string, SheetEditInput>>
propertykey readonly key: "sheet.shortcuts"Stable identity used to reject duplicate registrations.
methodtransformInput transformInput(input: SheetEditInput, _context: SheetEmbeddedEditorPluginContext): SheetEditInputAllows a plugin to normalize or consume Sheet keyboard/text input.
input: SheetEditInput_context: SheetEmbeddedEditorPluginContext
- interfaceEmbeddedDocConfigsource ↗
-
interface EmbeddedDocConfigConfiguration for the Doc instance embedded inside a Sheet cell.
propertyfontFamily readonly fontFamily: stringDefault font family and fallback list used by the active embedded document editor.
propertyfontSize readonly fontSize: numberDefault font size used by the active embedded document editor.
propertypadding readonly padding: numberPadding between the cell edge and embedded document text.
- interfaceSearCoreEditorAdapterOptionssource ↗
-
interface SearCoreEditorAdapterOptionsConfiguration 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 SheetEmbeddedEditorPluginExtension 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: stringStable identity used to reject duplicate registrations.
methoddispose dispose(): voidCalled before the adapter releases this plugin.
methodinitialize initialize(context: SheetEmbeddedEditorPluginContext): voidCalled once when the adapter is initialized.
context: SheetEmbeddedEditorPluginContext
methodonCancel onCancel(context: SheetEmbeddedEditorPluginContext): voidCalled after an edit is cancelled.
context: SheetEmbeddedEditorPluginContext
methodonCommit onCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): voidCalled after Sheet has committed the edited document.
document: SheetDocumentcontext: SheetEmbeddedEditorPluginContext
methodonRender onRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorPluginContext): voidCalled after a render pass has completed.
update: SheetRenderUpdatecontext: SheetEmbeddedEditorPluginContext
methodtransformCommit transformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): void | SheetDocument | nullAllows a Sheet plugin to normalize the snapshot at the commit boundary.
document: SheetDocumentcontext: SheetEmbeddedEditorPluginContext
methodtransformInlineStyle transformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): void | SheetInlineStyleUpdate | nullAllows a plugin to normalize an inline style update before Doc input runs.
update: SheetInlineStyleUpdatecontext: SheetEmbeddedEditorPluginContext
methodtransformInput transformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): void | SheetEditInput | nullAllows a plugin to normalize or consume Sheet keyboard/text input.
input: SheetEditInputcontext: SheetEmbeddedEditorPluginContext
- interfaceSheetEmbeddedEditorPluginContextsource ↗
-
interface SheetEmbeddedEditorPluginContextContext delivered to Sheet-specific embedded-editor plugins.
- interfaceSheetEmbeddedEditorPluginImplementationsource ↗
-
interface SheetEmbeddedEditorPluginImplementationConstructor form accepted by adapter configuration for stateless plugins.
constructorconstructor SheetEmbeddedEditorPluginImplementation(): SheetEmbeddedEditorPlugin - interfaceSheetEmbeddedInlineStyleObservationControllersource ↗
-
interface SheetEmbeddedInlineStyleObservationController - variabledefaultEmbeddedDocConfigsource ↗
-
defaultEmbeddedDocConfig: EmbeddedDocConfigBuilt-in defaults for a Doc instance embedded inside a Sheet cell.
- functioncreateSheetEmbeddedSearCoreEditorsource ↗
-
createSheetEmbeddedSearCoreEditor(options?: SearCoreEditorAdapterOptions): SearCoreEditorAdapterCreates 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>>): SheetEmbeddedInlineStyleObservationControllerRegisters the selection-derived inline-style state with an embedded editor.
observations: ObservationRegistryinput: DocInputPlugininlineStyles: RichTextInlineStyleRegistryisEditing: (): booleanreadTypingStyle: (): Readonly<Record<string, unknown>>
Package
@searsuite/sear-plugin-sort
Sheet range sorting commands and stable sparse row permutation helpers.
- enumSheetSortDirectionsource ↗
-
enum SheetSortDirectionenum memberAscending Ascending: "ascending"enum memberDescending Descending: "descending" - classSheetSortErrorsource ↗
-
class SheetSortError extends SearErrorBase 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 overridecode.constructorconstructor SheetSortError(message: string, details: Record<string, unknown>): SheetSortErrormessage: stringdetails: Record<string, unknown>
propertycauseinherited cause?: unknownpropertycode readonly code: "SHEET_SORT_INVALID_INPUT"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSheetSortPluginsource ↗
-
class SheetSortPlugin extends Plugin<unknown, CellProperties, Record<string, never>>Stateless command owner for stable range sorting.
constructorconstructor SheetSortPlugin(dependencies: SheetSortDependencies): SheetSortPlugindependencies: SheetSortDependencies
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply 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 | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullReturns 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(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidcommands: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: object
- interfaceSheetSortDependenciessource ↗
-
interface SheetSortDependenciespropertycompareText readonly compareText: (left: string, right: string): numberpropertyplatform readonly platform: Pick<Platform, "toLowerCase">propertyreadMatrix readonly readMatrix: (): CSRMatrix<CellMatrixElement>propertyreadValue readonly readValue: (row: number, column: number): SheetSortValuepropertyreorders readonly reorders: SheetRangeReorderRegistry - interfaceSheetSortKeysource ↗
-
interface SheetSortKey - interfaceSheetSortPermutationsource ↗
-
interface SheetSortPermutationpropertychanged readonly changed: booleanpropertydestinationOf readonly destinationOf: (row: number): numberpropertyrange readonly range: SheetMoveRange - interfaceSheetSortRangeInputsource ↗
-
interface SheetSortRangeInputpropertyfirstRowIsHeader readonly firstRowIsHeader?: booleanpropertykeys 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): SheetSortPermutationSorts occupied key rows; rows with empty keys remain stable at the end without being materialized.
input: SheetSortRangeInputmatrix: CSRMatrix<CellMatrixElement>readValue: (row: number, column: number): SheetSortValueplatform: Pick<Platform, "toLowerCase">compareText: (left: string, right: string): number
Package
@searsuite/sear-plugin-web-doc-toolbar
Web toolbar controls for standalone rich-document commands and observations.
- classSearWebDocToolbarsource ↗
-
class SearWebDocToolbar extends SearToolbarBrowser toolbar adapter for standalone Doc editors.
constructorconstructor SearWebDocToolbar(editor: Pick<DocEditor, "commands" | "observations">): SearWebDocToolbareditor: Pick<DocEditor, "commands" | "observations">
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SearToolbar.
methoddestroy destroy(): voidReleases resources owned by SearToolbar.
methodmount mount(target: unknown): voidAttaches this adapter to its host surface.
target: unknown
Package
@searsuite/sear-plugin-web-sheet-tabbar
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): SearWebBottomBarConstructs a bottom bar adapter bound to one platform.
platform: Platform
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the browser bottom bar adapter.
methoddestroy destroy(): voidmethodmount mount(target: HTMLElement, options?: SearWebBottomBarMountOptions): voidtarget: HTMLElementoptions: 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: symbolmethoddestroy destroy(): voidmethodmount mount(target: TTarget, options?: TOptions): voidtarget: TTargetoptions: TOptions
- classSheetStatusBarAdaptersource ↗
-
class SheetStatusBarAdapter<TTarget>Platform-neutral lifecycle contract for a sheet status-bar renderer.
constructorconstructor SheetStatusBarAdapter<TTarget>(): SheetStatusBarAdapter<TTarget>propertysymbolstatic readonly symbol: symbolmethoddestroy destroy(): voidmethodmount mount(target: TTarget, model: SheetStatusBarModel): voidtarget: TTargetmodel: SheetStatusBarModel
methodupdate update(model: SheetStatusBarModel): voidmodel: SheetStatusBarModel
- classSheetTabBarAdaptersource ↗
-
class SheetTabBarAdapter<TTarget>Platform-neutral lifecycle contract for a sheet tab-bar renderer.
constructorconstructor SheetTabBarAdapter<TTarget>(): SheetTabBarAdapter<TTarget>propertysymbolstatic readonly symbol: symbolmethoddestroy destroy(): voidmethodmount mount(target: TTarget, model: SheetTabBarModel): voidtarget: TTargetmodel: SheetTabBarModel
methodupdate update(model: SheetTabBarModel): voidmodel: SheetTabBarModel
- classWebSheetStatusBarsource ↗
-
class WebSheetStatusBar extends SheetStatusBarAdapter<HTMLElement>Browser DOM adapter for the status and zoom segment of the bottom bar.
constructorconstructor WebSheetStatusBar(): WebSheetStatusBarpropertysymbolstaticinherited readonly symbol: symbolmethoddestroy destroy(): voidmethodmount mount(target: HTMLElement, model: SheetStatusBarModel): voidtarget: HTMLElementmodel: SheetStatusBarModel
methodupdate update(model: SheetStatusBarModel): voidmodel: SheetStatusBarModel
- classWebSheetTabBarsource ↗
-
class WebSheetTabBar extends SheetTabBarAdapter<HTMLElement>Browser DOM adapter for the sheet tabs segment of the bottom bar.
constructorconstructor WebSheetTabBar(): WebSheetTabBarpropertysymbolstaticinherited readonly symbol: symbolmethoddestroy destroy(): voidmethodmount mount(target: HTMLElement, model: SheetTabBarModel): voidtarget: HTMLElementmodel: SheetTabBarModel
methodupdate update(model: SheetTabBarModel): voidmodel: SheetTabBarModel
- interfaceSearWebBottomBarCreateSheetStateInputsource ↗
-
interface SearWebBottomBarCreateSheetStateInputInput passed when the bottom bar needs a new sheet payload.
- interfaceSearWebBottomBarMountOptionssource ↗
-
interface SearWebBottomBarMountOptionsMount options for the browser bottom bar.
propertystatusBar readonly statusBar?: SheetStatusBarAdapter<HTMLElement>Optional status adapter. Hosts may provide a custom implementation.
propertystatusText readonly statusText?: stringStatus text shown at the right edge.
propertytabBar readonly tabBar?: SheetTabBarAdapter<HTMLElement>Optional tabs adapter. Hosts may provide a custom implementation.
propertyworkbook readonly workbook?: SearWebBottomBarWorkbookBindingOptional workbook binding. Without it, the bottom bar renders the static replica.
propertyzoomText readonly zoomText?: stringZoom label shown in the bottom bar.
- interfaceSearWebBottomBarWorkbookBindingsource ↗
-
interface SearWebBottomBarWorkbookBindingWorkbook binding used by SearWebBottomBar.
propertycreateSheetState readonly createSheetState?: (input: SearWebBottomBarCreateSheetStateInput): SheetDocumentStateCreates the initial SheetDocumentState for a newly added sheet.
propertyeditor readonly editor: WorkbookEditorWorkbook editor whose command bus owns sheet-list actions.
- interfaceSheetStatusBarModelsource ↗
-
interface SheetStatusBarModelPlatform-neutral view model for status and zoom controls.
propertyonViewOptionsClick readonly onViewOptionsClick: (): voidpropertyonZoomInClick readonly onZoomInClick: (): voidpropertyonZoomOutClick readonly onZoomOutClick: (): voidpropertystatusText readonly statusText: stringpropertyzoomText readonly zoomText: string - interfaceSheetTabBarItemsource ↗
-
interface SheetTabBarItemStable sheet item data shared by all tab-bar renderers.
- interfaceSheetTabBarModelsource ↗
-
interface SheetTabBarModelPlatform-neutral view model for the sheet tabs segment.
propertyonActivateSheetClick readonly onActivateSheetClick: (sheetId: string): voidpropertyonAddSheetClick readonly onAddSheetClick: (): voidpropertyonSheetsButtonClick readonly onSheetsButtonClick: (): voidpropertysheets 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
Web Sheet toolbar controls built on typed commands and observations.
- classSearWebToolbarsource ↗
-
class SearWebToolbar extends SearToolbarBrowser 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): SearWebToolbarConstructs the toolbar adapter for one sheet editor.
searCore: SearCoreSheetplatform: PlatformembeddedEditor: SheetEmbeddedEditorclipboard: SheetClipboarduserInteraction: UserInteractionServicecommands: SheetCommandBushistory: SheetHistoryStatusProviderqueries: SheetQueryRegistryobservations: ObservationRegistryfileDownload: FileDownload
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the web toolbar adapter.
methoddestroy destroy(): voidRemoves DOM nodes and subscriptions owned by the toolbar.
methodmount mount(target: unknown): voidMounts the toolbar into a host DOM element.
target: unknown
- classWebFormulaBarsource ↗
-
class WebFormulaBar extends SearFormulaBarWeb formula input surface backed by the Sheet editor's own edit session.
constructorconstructor WebFormulaBar(platform: Platform, commands: SheetCommandBus, queries: SheetQueryRegistry, observations: ObservationRegistry, core: SearCoreSheet): WebFormulaBarplatform: Platformcommands: SheetCommandBusqueries: SheetQueryRegistryobservations: ObservationRegistrycore: SearCoreSheet
propertysymbolstatic readonly symbol: typeof symbolmethoddestroy destroy(): voidmethodmount mount(target: unknown): voidtarget: unknown
- classWebSheetClipboardsource ↗
-
class WebSheetClipboard extends SheetClipboardBrowser Clipboard API adapter; DOM events never cross this boundary.
constructorconstructor WebSheetClipboard(): WebSheetClipboardpropertysymbolstaticinherited readonly symbol: typeof symbolmethodread 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): voidEnsures web toolbar hosts receive the official sheet command surface.
commands: SheetCommandBuscore: SearCoreSheet
- functionregisterSheetToolbarCommandssource ↗
-
registerSheetToolbarCommands(commands: SheetCommandBus, core: SearCoreSheet): voidRegisters official sheet commands needed by web toolbar hosts.
commands: SheetCommandBuscore: SearCoreSheet
- classHeadlessToolbarsource ↗
-
class HeadlessToolbar extends SearToolbarToolbar implementation for hosts without a UI surface.
constructorconstructor HeadlessToolbar(): HeadlessToolbarpropertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessToolbar.
methoddestroy destroy(): voidReleases resources owned by SearToolbar.
methodmount mount(_target: unknown): voidAttaches this adapter to its host surface.
_target: unknown
- classSearToolbarsource ↗
-
class SearToolbarPlatform-neutral toolbar lifecycle contract.
constructorconstructor SearToolbar(): SearToolbarpropertysymbolstatic readonly symbol: symbolDI token for resolving SearToolbar.
methoddestroy destroy(): voidReleases resources owned by SearToolbar.
methodmount mount(target: unknown): voidAttaches this adapter to its host surface.
target: unknown
Package
@searsuite/sear-plugin-zoom
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): SheetZoomPluginCreates a SheetZoomPlugin instance.
keyboardRouter: KeyboardRoutercommands: SheetCommandBusplatform: Platform
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for SheetZoomPlugin.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving SheetZoomPlugin.
memberkeyinherited key: unknownmethodapply 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 | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): unknownReturns the plugin config.
methodgetScale getScale(): numberReturns the scale.
methodgetStateinherited getState(): Record<string, never>Returns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: Transaction
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters 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): voidRegisters 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetScale setScale(nextScale: number): voidUpdates the scale.
nextScale: number
methodsetStateinherited setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: 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
Platform-neutral drawing contracts with Web Canvas, SVG, WebGL, and headless adapters.
- classCoordinateTransformersource ↗
-
class CoordinateTransformerSingle authority for host-view, world, and raster coordinate conversion.
constructorconstructor CoordinateTransformer(scrollManager: ScrollManager, renderContext: RenderContext, hitRenderContext: RenderContext): CoordinateTransformerCreates a CoordinateTransformer instance.
scrollManager: ScrollManagerrenderContext: RenderContexthitRenderContext: RenderContext
propertysymbolstatic readonly symbol: symbolDI token for resolving the host-neutral coordinate transformer.
methodgetVisibleWorldRect getVisibleWorldRect(): PositionRect<unknown>Returns the visible world rect.
methodviewToRaster viewToRaster(point: CoordinatePoint): CoordinatePointConverts a host-view point into raster coordinates for pixel reads.
point: CoordinatePoint
methodviewToWorld viewToWorld(point: CoordinatePoint, scroll?: Pick<ScrollManagerState, "x" | "y">): CoordinatePointConverts a host-view point into world coordinates.
point: CoordinatePointscroll: Pick<ScrollManagerState, "x" | "y">
methodworldToView worldToView(point: CoordinatePoint, scroll?: Pick<ScrollManagerState, "x" | "y">): CoordinatePointConverts a world point into host-view coordinates.
point: CoordinatePointscroll: Pick<ScrollManagerState, "x" | "y">
- classHeadlessHitRenderContextsource ↗
-
class HeadlessHitRenderContext extends HeadlessRenderContextHit-test layer marker for a headless render pipeline.
constructorconstructor HeadlessHitRenderContext(): HeadlessHitRenderContextpropertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessHitRenderContext.
methodaddClickEventListenerinherited addClickEventListener(_callback: (event: EventWithOffset): void): voidAttaches a click listener.
_callback: (event: EventWithOffset): void
methodaddEventListenerinherited addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
_type: string_callback: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited addMouseDownEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
_callback: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited addMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
_callback: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited addMouseUpEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
_callback: (event: EventWithOffset): void
methodaddResizeListenerinherited addResizeListener(_callback: (): void): voidAttaches a resize listener for host target size changes.
_callback: (): void
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPathinherited beginPath(): voidBegins a new path.
methodclearRectinherited clearRect(_x: number, _y: number, _width: number, _height: number): voidClears a rectangle from the target.
_x: number_y: number_width: number_height: number
methodclipinherited clip(): voidClips future drawing to the active path.
methodcloneNodeinherited cloneNode(): RenderContextCreates a same-kind render context for an auxiliary render layer.
methodclosePathinherited closePath(): voidCloses the active path.
methodcreateHitNodeinherited createHitNode(): RenderContextCreates a same-kind render context configured for hit testing.
methoddrawImageinherited drawImage(_image: unknown, _x: number, _y: number): voiddrawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number): voiddrawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number, _sx: number, _sy: number, _sWidth: number, _sHeight: number): voidDraws 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(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfillinherited fill(): voidFills the active path with the current fill style.
methodfillTextinherited fillText(_text: string, _x: number, _y: number, _maxWidth?: number): voidDraws text at the given position.
_text: string_x: number_y: number_maxWidth: number
methodgetAttributeinherited getAttribute(name: string): stringReads a host-visible attribute from the backing target.
name: string
methodgetImageDatainherited getImageData(_x: number, _y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
_x: number_y: numberwidth: numberheight: number
methodgetLineWidthinherited getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidthinherited getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScaleinherited getRasterScale(): numberRaster units represented by one host-view unit for this context.
methodgetRenderTargetinherited getRenderTarget(): unknownReturns the native backing target owned by this render context.
methodgetRootinherited getRoot(): unknownReturns the event root associated with this render context.
methodgetViewScaleinherited getViewScale(): numberReturns the current logical view scale.
methodinitializeinherited initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
scale: number
methodlineToinherited lineTo(_x: number, _y: number): voidAdds 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): voidMoves the active path cursor.
_x: number_y: number
methodputImageDatainherited putImageData(_imageData: RenderImageData, _x: number, _y: number): voidWrites raster pixels to the target.
_imageData: RenderImageData_x: number_y: number
methodrectinherited rect(_x: number, _y: number, _width: number, _height: number): voidAdds a rectangle to the active path.
_x: number_y: number_width: number_height: number
methodremoveClickEventListenerinherited removeClickEventListener(_callback: (event: EventWithOffset): void): voidRemoves a click listener.
_callback: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited removeMouseDownEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
_callback: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
_callback: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited removeMouseUpEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
_callback: (event: EventWithOffset): void
methodremoveResizeListenerinherited removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransforminherited resetTransform(): voidResets the current transform to the identity transform.
methodresizeinherited resize(_width: number, _height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
_width: number_height: numberscale: number
methodrestoreinherited restore(): voidRestores the most recently saved drawing state.
methodsaveinherited save(): voidSaves the current drawing state.
methodsetAttributeinherited setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyleinherited setFillStyle(_fillStyle: RenderPaint): voidSets the current fill style.
_fillStyle: RenderPaint
methodsetFontinherited setFont(_font: string): voidSets the active platform-neutral font descriptor.
_font: string
methodsetLineDashinherited setLineDash(_segments: number[]): voidSets the current line dash pattern.
_segments: number[]
methodsetLineWidthinherited setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyleinherited setStrokeStyle(_strokeStyle: RenderPaint): voidSets the current stroke style.
_strokeStyle: RenderPaint
methodsetTransforminherited setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): voidReplaces the current transform matrix.
_a: number_b: number_c: number_d: number_e: number_f: number
methodsetViewScaleinherited setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
scale: number
methodstrokeinherited stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRectinherited strokeRect(_x: number, _y: number, _width: number, _height: number): voidStrokes a rectangle without requiring a separate path.
_x: number_y: number_width: number_height: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslateinherited translate(_x: number, _y: number): voidTranslates the current drawing transform.
_x: number_y: number
- classHeadlessOffScreenRenderContextsource ↗
-
class HeadlessOffScreenRenderContext extends HeadlessRenderContextOff-screen layer marker for a headless render pipeline.
constructorconstructor HeadlessOffScreenRenderContext(): HeadlessOffScreenRenderContextpropertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessOffScreenRenderContext.
methodaddClickEventListenerinherited addClickEventListener(_callback: (event: EventWithOffset): void): voidAttaches a click listener.
_callback: (event: EventWithOffset): void
methodaddEventListenerinherited addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
_type: string_callback: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited addMouseDownEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
_callback: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited addMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
_callback: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited addMouseUpEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
_callback: (event: EventWithOffset): void
methodaddResizeListenerinherited addResizeListener(_callback: (): void): voidAttaches a resize listener for host target size changes.
_callback: (): void
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPathinherited beginPath(): voidBegins a new path.
methodclearRectinherited clearRect(_x: number, _y: number, _width: number, _height: number): voidClears a rectangle from the target.
_x: number_y: number_width: number_height: number
methodclipinherited clip(): voidClips future drawing to the active path.
methodcloneNodeinherited cloneNode(): RenderContextCreates a same-kind render context for an auxiliary render layer.
methodclosePathinherited closePath(): voidCloses the active path.
methodcreateHitNodeinherited createHitNode(): RenderContextCreates a same-kind render context configured for hit testing.
methoddrawImageinherited drawImage(_image: unknown, _x: number, _y: number): voiddrawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number): voiddrawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number, _sx: number, _sy: number, _sWidth: number, _sHeight: number): voidDraws 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(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfillinherited fill(): voidFills the active path with the current fill style.
methodfillTextinherited fillText(_text: string, _x: number, _y: number, _maxWidth?: number): voidDraws text at the given position.
_text: string_x: number_y: number_maxWidth: number
methodgetAttributeinherited getAttribute(name: string): stringReads a host-visible attribute from the backing target.
name: string
methodgetImageDatainherited getImageData(_x: number, _y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
_x: number_y: numberwidth: numberheight: number
methodgetLineWidthinherited getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidthinherited getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScaleinherited getRasterScale(): numberRaster units represented by one host-view unit for this context.
methodgetRenderTargetinherited getRenderTarget(): unknownReturns the native backing target owned by this render context.
methodgetRootinherited getRoot(): unknownReturns the event root associated with this render context.
methodgetViewScaleinherited getViewScale(): numberReturns the current logical view scale.
methodinitializeinherited initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
scale: number
methodlineToinherited lineTo(_x: number, _y: number): voidAdds 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): voidMoves the active path cursor.
_x: number_y: number
methodputImageDatainherited putImageData(_imageData: RenderImageData, _x: number, _y: number): voidWrites raster pixels to the target.
_imageData: RenderImageData_x: number_y: number
methodrectinherited rect(_x: number, _y: number, _width: number, _height: number): voidAdds a rectangle to the active path.
_x: number_y: number_width: number_height: number
methodremoveClickEventListenerinherited removeClickEventListener(_callback: (event: EventWithOffset): void): voidRemoves a click listener.
_callback: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited removeMouseDownEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
_callback: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
_callback: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited removeMouseUpEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
_callback: (event: EventWithOffset): void
methodremoveResizeListenerinherited removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransforminherited resetTransform(): voidResets the current transform to the identity transform.
methodresizeinherited resize(_width: number, _height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
_width: number_height: numberscale: number
methodrestoreinherited restore(): voidRestores the most recently saved drawing state.
methodsaveinherited save(): voidSaves the current drawing state.
methodsetAttributeinherited setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyleinherited setFillStyle(_fillStyle: RenderPaint): voidSets the current fill style.
_fillStyle: RenderPaint
methodsetFontinherited setFont(_font: string): voidSets the active platform-neutral font descriptor.
_font: string
methodsetLineDashinherited setLineDash(_segments: number[]): voidSets the current line dash pattern.
_segments: number[]
methodsetLineWidthinherited setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyleinherited setStrokeStyle(_strokeStyle: RenderPaint): voidSets the current stroke style.
_strokeStyle: RenderPaint
methodsetTransforminherited setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): voidReplaces the current transform matrix.
_a: number_b: number_c: number_d: number_e: number_f: number
methodsetViewScaleinherited setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
scale: number
methodstrokeinherited stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRectinherited strokeRect(_x: number, _y: number, _width: number, _height: number): voidStrokes a rectangle without requiring a separate path.
_x: number_y: number_width: number_height: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslateinherited translate(_x: number, _y: number): voidTranslates the current drawing transform.
_x: number_y: number
- classHeadlessRenderContextsource ↗
-
class HeadlessRenderContext extends RenderContextRender context that preserves engine state while producing no raster output.
constructorconstructor HeadlessRenderContext(): HeadlessRenderContextpropertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving the headless render context.
methodaddClickEventListener addClickEventListener(_callback: (event: EventWithOffset): void): voidAttaches a click listener.
_callback: (event: EventWithOffset): void
methodaddEventListener addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
_type: string_callback: (event: EventWithOffset): void
methodaddMouseDownEventListener addMouseDownEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
_callback: (event: EventWithOffset): void
methodaddMouseMoveEventListener addMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
_callback: (event: EventWithOffset): void
methodaddMouseUpEventListener addMouseUpEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
_callback: (event: EventWithOffset): void
methodaddResizeListener addResizeListener(_callback: (): void): voidAttaches a resize listener for host target size changes.
_callback: (): void
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPath beginPath(): voidBegins a new path.
methodclearRect clearRect(_x: number, _y: number, _width: number, _height: number): voidClears a rectangle from the target.
_x: number_y: number_width: number_height: number
methodclip clip(): voidClips future drawing to the active path.
methodcloneNode cloneNode(): RenderContextCreates a same-kind render context for an auxiliary render layer.
methodclosePath closePath(): voidCloses the active path.
methodcreateHitNode createHitNode(): RenderContextCreates a same-kind render context configured for hit testing.
methoddrawImage drawImage(_image: unknown, _x: number, _y: number): voiddrawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number): voiddrawImage(_image: unknown, _x: number, _y: number, _width: number, _height: number, _sx: number, _sy: number, _sWidth: number, _sHeight: number): voidDraws 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(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfill fill(): voidFills the active path with the current fill style.
methodfillText fillText(_text: string, _x: number, _y: number, _maxWidth?: number): voidDraws text at the given position.
_text: string_x: number_y: number_maxWidth: number
methodgetAttribute getAttribute(name: string): stringReads a host-visible attribute from the backing target.
name: string
methodgetImageData getImageData(_x: number, _y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
_x: number_y: numberwidth: numberheight: number
methodgetLineWidth getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidth getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScale getRasterScale(): numberRaster units represented by one host-view unit for this context.
methodgetRenderTarget getRenderTarget(): unknownReturns the native backing target owned by this render context.
methodgetRoot getRoot(): unknownReturns the event root associated with this render context.
methodgetViewScale getViewScale(): numberReturns the current logical view scale.
methodinitialize initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
scale: number
methodlineTo lineTo(_x: number, _y: number): voidAdds 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): voidMoves the active path cursor.
_x: number_y: number
methodputImageData putImageData(_imageData: RenderImageData, _x: number, _y: number): voidWrites raster pixels to the target.
_imageData: RenderImageData_x: number_y: number
methodrect rect(_x: number, _y: number, _width: number, _height: number): voidAdds a rectangle to the active path.
_x: number_y: number_width: number_height: number
methodremoveClickEventListener removeClickEventListener(_callback: (event: EventWithOffset): void): voidRemoves a click listener.
_callback: (event: EventWithOffset): void
methodremoveMouseDownEventListener removeMouseDownEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
_callback: (event: EventWithOffset): void
methodremoveMouseMoveEventListener removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
_callback: (event: EventWithOffset): void
methodremoveMouseUpEventListener removeMouseUpEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
_callback: (event: EventWithOffset): void
methodremoveResizeListener removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransform resetTransform(): voidResets the current transform to the identity transform.
methodresize resize(_width: number, _height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
_width: number_height: numberscale: number
methodrestore restore(): voidRestores the most recently saved drawing state.
methodsave save(): voidSaves the current drawing state.
methodsetAttribute setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyle setFillStyle(_fillStyle: RenderPaint): voidSets the current fill style.
_fillStyle: RenderPaint
methodsetFont setFont(_font: string): voidSets the active platform-neutral font descriptor.
_font: string
methodsetLineDash setLineDash(_segments: number[]): voidSets the current line dash pattern.
_segments: number[]
methodsetLineWidth setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyle setStrokeStyle(_strokeStyle: RenderPaint): voidSets the current stroke style.
_strokeStyle: RenderPaint
methodsetTransform setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): voidReplaces the current transform matrix.
_a: number_b: number_c: number_d: number_e: number_f: number
methodsetViewScale setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
scale: number
methodstroke stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRect strokeRect(_x: number, _y: number, _width: number, _height: number): voidStrokes a rectangle without requiring a separate path.
_x: number_y: number_width: number_height: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslate translate(_x: number, _y: number): voidTranslates the current drawing transform.
_x: number_y: number
- classRenderContextsource ↗
-
class RenderContextPlatform-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(): RenderContextpropertyisDrawn isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstatic readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstatic readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for the primary visible render layer.
methodaddClickEventListener addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
callBack: (event: EventWithOffset): void
methodaddEventListener addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
type: stringcallBack: (event: EventWithOffset): void
methodaddMouseDownEventListener addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
callBack: (event: EventWithOffset): void
methodaddResizeListener addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
callBack: (): void
methodbeginFrame beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemantics beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPath beginPath(): voidBegins a new path.
methodclearRect clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
x: numbery: numberwidth: numberheight: number
methodclip clip(): voidClips future drawing to the active path.
methodcloneNode cloneNode(): RenderContextCreates a same-kind render context for an auxiliary render layer.
methodclosePath closePath(): voidCloses the active path.
methodcreateHitNode createHitNode(): RenderContextCreates a same-kind render context configured for hit testing.
methoddrawImage drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemantics endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfill fill(): voidFills the active path with the current fill style.
methodfillText fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttribute getAttribute(name: string): stringReads a host-visible attribute from the backing target.
name: string
methodgetImageData getImageData(x: number, y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
x: numbery: numberwidth: numberheight: number
methodgetLineWidth getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidth getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScale getRasterScale(): numberRaster units represented by one host-view unit for this context.
methodgetRenderTarget getRenderTarget(): unknownReturns the native backing target owned by this render context.
methodgetRoot getRoot(): unknownReturns the event root associated with this render context.
methodgetViewScale getViewScale(): numberReturns the current logical view scale.
methodinitialize initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
scale: number
methodlineTo lineTo(x: number, y: number): voidAdds a line from the current path cursor.
x: numbery: 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): voidMoves the active path cursor.
x: numbery: number
methodputImageData putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
imageData: RenderImageDatax: numbery: number
methodrect rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListener removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
callBack: (event: EventWithOffset): void
methodremoveResizeListener removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClear requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuild requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrame resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransform resetTransform(): voidResets the current transform to the identity transform.
methodresize resize(width: number, height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
width: numberheight: numberscale: number
methodrestore restore(): voidRestores the most recently saved drawing state.
methodsave save(): voidSaves the current drawing state.
methodsetAttribute setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyle setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
fillStyle: RenderPaint
methodsetFont setFont(font: string): voidSets the active platform-neutral font descriptor.
font: string
methodsetLineDash setLineDash(segments: number[]): voidSets the current line dash pattern.
segments: number[]
methodsetLineWidth setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyle setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
strokeStyle: RenderPaint
methodsetTransform setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
a: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScale setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
scale: number
methodstroke stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRect strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedraw supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslate translate(x: number, y: number): voidTranslates the current drawing transform.
x: numbery: number
- classWebCanvasRenderContextsource ↗
-
class WebCanvasRenderContext extends RenderContextBrowser 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): WebCanvasRenderContextConstructs a Canvas render context from a host canvas.
renderTarget: unknown- HTMLCanvasElement supplied by the host adapter.
readbackOptimized: booleanplatform: Platform
propertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving the visible canvas render context.
methodaddClickEventListener addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
callBack: (event: EventWithOffset): void
methodaddEventListener addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidRegisters a host pointer event listener on the canvas root.
type: stringcallBack: (event: EventWithOffset): void
methodaddMouseDownEventListener addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
callBack: (event: EventWithOffset): void
methodaddResizeListener addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
callBack: (): void
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPath beginPath(): voidBegins a new path.
methodclearRect clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
x: numbery: numberwidth: numberheight: number
methodclip clip(): voidClips future drawing to the active path.
methodcloneNode cloneNode(): WebCanvasRenderContextClones the backing canvas dimensions into a detached WebCanvasRenderContext.
methodclosePath closePath(): voidCloses the active path.
methodcreateHitNode createHitNode(): WebCanvasRenderContextCreates a detached render context used by hit rendering.
methoddrawImage drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemanticsinherited endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfill fill(): voidFills the active path with the current fill style.
methodfillText fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttribute getAttribute(name: string): stringReads 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: numbery: numberwidth: numberheight: number
methodgetLineWidth getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidth getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScale getRasterScale(): numberReturns the host-view to raster scale, excluding logical sheet zoom.
methodgetRenderTarget getRenderTarget(): HTMLCanvasElementReturns the native backing target owned by this render context.
methodgetRoot getRoot(): HTMLCanvasElementReturns the event root associated with this render context.
methodgetViewScale getViewScale(): numberReturns the logical view scale.
methodinitialize initialize(scale: number): voidInitializes 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): voidAdds a line from the current path cursor.
x: numbery: 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): voidMoves the active path cursor.
x: numbery: number
methodputImageData putImageData(imageData: RenderImageData, x: number, y: number): voidWrites 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): voidAdds a rectangle to the active path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListener removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
callBack: (event: EventWithOffset): void
methodremoveResizeListener removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransform resetTransform(): voidResets the current transform to the identity transform.
methodresize resize(width: number, height: number, scale?: number): voidResizes 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(): voidRestores the most recently saved drawing state.
methodsave save(): voidSaves the current drawing state.
methodsetAttribute setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyle setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
fillStyle: RenderPaint
methodsetFont setFont(font: string): voidSets the active platform-neutral font descriptor.
font: string
methodsetLineDash setLineDash(segments: number[]): voidSets the current line dash pattern.
segments: number[]
methodsetLineWidth setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyle setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
strokeStyle: RenderPaint
methodsetTransform setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidApplies 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: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScale setViewScale(scale: number): voidUpdates the logical view scale used by sheet zoom.
scale: number- New view scale.
methodstroke stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRect strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslate translate(x: number, y: number): voidTranslates the current drawing transform.
x: numbery: number
- classWebHitCanvasRenderContextsource ↗
-
class WebHitCanvasRenderContext extends WebCanvasRenderContextCanvas render context specialization for the hit-test layer.
constructorconstructor WebHitCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebHitCanvasRenderContextConstructs a Canvas render context from a host canvas.
renderTarget: unknown- HTMLCanvasElement supplied by the host adapter.
readbackOptimized: booleanplatform: Platform
propertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving the hit canvas context.
methodaddClickEventListenerinherited addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
callBack: (event: EventWithOffset): void
methodaddEventListenerinherited addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidRegisters a host pointer event listener on the canvas root.
type: stringcallBack: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
callBack: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
callBack: (event: EventWithOffset): void
methodaddResizeListenerinherited addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
callBack: (): void
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPathinherited beginPath(): voidBegins a new path.
methodclearRectinherited clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
x: numbery: numberwidth: numberheight: number
methodclipinherited clip(): voidClips future drawing to the active path.
methodcloneNodeinherited cloneNode(): WebCanvasRenderContextClones the backing canvas dimensions into a detached WebCanvasRenderContext.
methodclosePathinherited closePath(): voidCloses the active path.
methodcreateHitNodeinherited createHitNode(): WebCanvasRenderContextCreates a detached render context used by hit rendering.
methoddrawImageinherited drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemanticsinherited endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfillinherited fill(): voidFills the active path with the current fill style.
methodfillTextinherited fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttributeinherited getAttribute(name: string): stringReads 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: numbery: numberwidth: numberheight: number
methodgetLineWidthinherited getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidthinherited getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScaleinherited getRasterScale(): numberReturns the host-view to raster scale, excluding logical sheet zoom.
methodgetRenderTargetinherited getRenderTarget(): HTMLCanvasElementReturns the native backing target owned by this render context.
methodgetRootinherited getRoot(): HTMLCanvasElementReturns the event root associated with this render context.
methodgetViewScaleinherited getViewScale(): numberReturns the logical view scale.
methodinitializeinherited initialize(scale: number): voidInitializes 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): voidAdds a line from the current path cursor.
x: numbery: 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): voidMoves the active path cursor.
x: numbery: number
methodputImageDatainherited putImageData(imageData: RenderImageData, x: number, y: number): voidWrites 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): voidAdds a rectangle to the active path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListenerinherited removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
callBack: (event: EventWithOffset): void
methodremoveResizeListenerinherited removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransforminherited resetTransform(): voidResets the current transform to the identity transform.
methodresizeinherited resize(width: number, height: number, scale?: number): voidResizes 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(): voidRestores the most recently saved drawing state.
methodsaveinherited save(): voidSaves the current drawing state.
methodsetAttributeinherited setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyleinherited setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
fillStyle: RenderPaint
methodsetFontinherited setFont(font: string): voidSets the active platform-neutral font descriptor.
font: string
methodsetLineDashinherited setLineDash(segments: number[]): voidSets the current line dash pattern.
segments: number[]
methodsetLineWidthinherited setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyleinherited setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
strokeStyle: RenderPaint
methodsetTransforminherited setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidApplies 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: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScaleinherited setViewScale(scale: number): voidUpdates the logical view scale used by sheet zoom.
scale: number- New view scale.
methodstrokeinherited stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRectinherited strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslateinherited translate(x: number, y: number): voidTranslates the current drawing transform.
x: numbery: number
- classWebOffScreenCanvasRenderContextsource ↗
-
class WebOffScreenCanvasRenderContext extends WebCanvasRenderContextCanvas render context specialization for scroll optimization buffers.
constructorconstructor WebOffScreenCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebOffScreenCanvasRenderContextConstructs a Canvas render context from a host canvas.
renderTarget: unknown- HTMLCanvasElement supplied by the host adapter.
readbackOptimized: booleanplatform: Platform
propertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving the off-screen canvas context.
methodaddClickEventListenerinherited addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
callBack: (event: EventWithOffset): void
methodaddEventListenerinherited addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidRegisters a host pointer event listener on the canvas root.
type: stringcallBack: (event: EventWithOffset): void
methodaddMouseDownEventListenerinherited addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListenerinherited addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
callBack: (event: EventWithOffset): void
methodaddMouseUpEventListenerinherited addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
callBack: (event: EventWithOffset): void
methodaddResizeListenerinherited addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
callBack: (): void
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPathinherited beginPath(): voidBegins a new path.
methodclearRectinherited clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
x: numbery: numberwidth: numberheight: number
methodclipinherited clip(): voidClips future drawing to the active path.
methodcloneNodeinherited cloneNode(): WebCanvasRenderContextClones the backing canvas dimensions into a detached WebCanvasRenderContext.
methodclosePathinherited closePath(): voidCloses the active path.
methodcreateHitNodeinherited createHitNode(): WebCanvasRenderContextCreates a detached render context used by hit rendering.
methoddrawImageinherited drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemanticsinherited endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfillinherited fill(): voidFills the active path with the current fill style.
methodfillTextinherited fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttributeinherited getAttribute(name: string): stringReads 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: numbery: numberwidth: numberheight: number
methodgetLineWidthinherited getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidthinherited getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScaleinherited getRasterScale(): numberReturns the host-view to raster scale, excluding logical sheet zoom.
methodgetRenderTargetinherited getRenderTarget(): HTMLCanvasElementReturns the native backing target owned by this render context.
methodgetRootinherited getRoot(): HTMLCanvasElementReturns the event root associated with this render context.
methodgetViewScaleinherited getViewScale(): numberReturns the logical view scale.
methodinitializeinherited initialize(scale: number): voidInitializes 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): voidAdds a line from the current path cursor.
x: numbery: 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): voidMoves the active path cursor.
x: numbery: number
methodputImageDatainherited putImageData(imageData: RenderImageData, x: number, y: number): voidWrites 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): voidAdds a rectangle to the active path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListenerinherited removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListenerinherited removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListenerinherited removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListenerinherited removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
callBack: (event: EventWithOffset): void
methodremoveResizeListenerinherited removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransforminherited resetTransform(): voidResets the current transform to the identity transform.
methodresizeinherited resize(width: number, height: number, scale?: number): voidResizes 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(): voidRestores the most recently saved drawing state.
methodsaveinherited save(): voidSaves the current drawing state.
methodsetAttributeinherited setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyleinherited setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
fillStyle: RenderPaint
methodsetFontinherited setFont(font: string): voidSets the active platform-neutral font descriptor.
font: string
methodsetLineDashinherited setLineDash(segments: number[]): voidSets the current line dash pattern.
segments: number[]
methodsetLineWidthinherited setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyleinherited setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
strokeStyle: RenderPaint
methodsetTransforminherited setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidApplies 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: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScaleinherited setViewScale(scale: number): voidUpdates the logical view scale used by sheet zoom.
scale: number- New view scale.
methodstrokeinherited stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRectinherited strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslateinherited translate(x: number, y: number): voidTranslates the current drawing transform.
x: numbery: number
- classWebRenderContextsource ↗
-
class WebRenderContext extends RenderContextExperimental Web-backed render context used for element-based rendering experiments.
constructorconstructor WebRenderContext(container: HTMLDivElement, platform?: Platform): WebRenderContextCreates a Web render context attached to the provided container.
container: HTMLDivElementplatform: Platform
propertycache cache: Set<HTMLElement>Virtual path cache collected before a fill or stroke commits DOM elements.
propertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyroot root: HTMLDivElementRoot DOM element that receives generated render elements.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving the Web render context.
methodaddClickEventListener addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
callBack: (event: EventWithOffset): void
methodaddEventListener addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
type: stringcallBack: (event: EventWithOffset): void
methodaddMouseDownEventListener addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
callBack: (event: EventWithOffset): void
methodaddResizeListener addResizeListener(): voidAttaches a resize listener for host target size changes.
methodbeginFrameinherited beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPath beginPath(): voidClear timing
1、Virtual Path Again
2、beginPath
3、clearRectmethodclearRect clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
x: numbery: numberwidth: numberheight: number
methodclip clip(): voidClips future drawing to the active path.
methodcloneNode cloneNode(): RenderContextCreates a same-kind render context for an auxiliary render layer.
methodclosePath closePath(): voidCloses the active path.
methodcreateHitNode createHitNode(): RenderContextCreates a same-kind render context configured for hit testing.
methoddrawImage drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemanticsinherited endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfill fill(): voidFills the active path with the current fill style.
methodfillText fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttribute getAttribute(name: string): stringReads 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: numbery: numberwidth: numberheight: number
methodgetLineWidth getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidth getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScale getRasterScale(): numberRaster units represented by one host-view unit for this context.
methodgetRenderTarget getRenderTarget(): unknownReturns the native backing target owned by this render context.
methodgetRoot getRoot(): HTMLDivElementReturns the event root associated with this render context.
methodgetViewScale getViewScale(): numberReturns the current logical view scale.
methodinitialize initialize(): voidInitializes target sizing and adapter-specific state.
methodlineTo lineTo(x: number, y: number): voidAdds a line from the current path cursor.
x: numbery: 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): voidMoves the active path cursor.
x: numbery: number
methodputImageData putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
imageData: RenderImageDatax: numbery: number
methodrect rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListener removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
callBack: (event: EventWithOffset): void
methodremoveResizeListener removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClearinherited requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuildinherited requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransform resetTransform(): voidResets the current transform to the identity transform.
methodresize resize(): voidResizes the backing render target to the host view's logical size and raster scale.
methodrestore restore(): voidRestores the most recently saved drawing state.
methodsave save(): voidSaves the current drawing state.
methodsetAttribute setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyle setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
fillStyle: RenderPaint
methodsetFont setFont(font: string): voidSets the active platform-neutral font descriptor.
font: string
methodsetLineDash setLineDash(segments: number[]): voidSets the current line dash pattern.
segments: number[]
methodsetLineWidth setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyle setStrokeStyle(strokeStyle: string): voidSets the current stroke style.
strokeStyle: string
methodsetTransform setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
a: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScale setViewScale(_scale: number): voidLogical view scale (distinct from device pixel ratio).
_scale: number
methodstroke stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRect strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedrawinherited supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslate translate(x: number, y: number): voidTranslates the current drawing transform.
x: numbery: number
- classWebSvgRenderContextsource ↗
-
class WebSvgRenderContext extends RenderContextProduction 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): WebSvgRenderContextCreates 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: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for resolving the SVG render context.
methodaddClickEventListener addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
callBack: (event: EventWithOffset): void
methodaddEventListener addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
type: stringcallBack: (event: EventWithOffset): void
methodaddMouseDownEventListener addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
callBack: (event: EventWithOffset): void
methodaddMouseMoveEventListener addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
callBack: (event: EventWithOffset): void
methodaddMouseUpEventListener addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
callBack: (event: EventWithOffset): void
methodaddResizeListener addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
callBack: (): void
methodbeginFrame beginFrame(): voidReplaces retained SVG output before a full shared-engine render pass.
methodbeginNodeSemantics beginNodeSemantics(semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
semantics: RenderNodeSemantics
methodbeginPath beginPath(): voidBegins a new path.
methodclearRect clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
x: numbery: numberwidth: numberheight: number
methodclip clip(): voidClips future drawing to the active path.
methodcloneNode cloneNode(): WebSvgRenderContextCreates a same-kind render context for an auxiliary render layer.
methodclosePath closePath(): voidCloses the active path.
methodcreateHitNode createHitNode(): WebSvgRenderContextCreates a same-kind render context configured for hit testing.
methoddrawImage drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemantics endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfill fill(): voidFills the active path with the current fill style.
methodfillText fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttribute getAttribute(name: string): stringReads 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: numbery: numberwidth: numberheight: number
methodgetLineWidth getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidth getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScale getRasterScale(): numberRaster units represented by one host-view unit for this context.
methodgetRenderTarget getRenderTarget(): SVGSVGElementReturns the native backing target owned by this render context.
methodgetRoot getRoot(): SVGSVGElementReturns the event root associated with this render context.
methodgetViewScale getViewScale(): numberReturns the current logical view scale.
methodinitialize initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
scale: number
methodlineTo lineTo(x: number, y: number): voidAdds a line from the current path cursor.
x: numbery: 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): voidMoves the active path cursor.
x: numbery: number
methodputImageData putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
imageData: RenderImageDatax: numbery: number
methodrect rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListener removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
callBack: (event: EventWithOffset): void
methodremoveMouseDownEventListener removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
callBack: (event: EventWithOffset): void
methodremoveMouseMoveEventListener removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
callBack: (event: EventWithOffset): void
methodremoveMouseUpEventListener removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
callBack: (event: EventWithOffset): void
methodremoveResizeListener removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClear requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuild requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrame resetHitFrame(_width: number, _height: number): voidResets the complete hit-test frame using the target's native lifecycle.
_width: number_height: number
methodresetTransform resetTransform(): voidResets the current transform to the identity transform.
methodresize resize(width: number, height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
width: numberheight: numberscale: number
methodrestore restore(): voidRestores the most recently saved drawing state.
methodsave save(): voidSaves the current drawing state.
methodsetAttribute setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyle setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
fillStyle: RenderPaint
methodsetFont setFont(font: string): voidSets the active platform-neutral font descriptor.
font: string
methodsetLineDash setLineDash(segments: number[]): voidSets the current line dash pattern.
segments: number[]
methodsetLineWidth setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyle setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
strokeStyle: RenderPaint
methodsetTransform setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
a: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScale setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
scale: number
methodstroke stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRect strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedraw supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslate translate(x: number, y: number): voidTranslates the current drawing transform.
x: numbery: number
- classWebWebGLRenderContextsource ↗
-
class WebWebGLRenderContext extends RenderContextNative 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.Exampleconst context = new WebWebGLRenderContext(canvas, platform); context.initialize(window.devicePixelRatio);constructorconstructor WebWebGLRenderContext(renderTarget: unknown, platform?: Platform): WebWebGLRenderContextrenderTarget: unknownplatform: Platform
propertyisDrawninherited isDrawn: booleanWhether the target has received at least one draw operation.
propertyhitSymbolstaticinherited readonly hitSymbol: symbolDI token for the hit-test render layer.
propertyoffScreenSymbolstaticinherited readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
propertysymbolstatic readonly symbol: symbolDI token for the primary visible render layer.
methodaddClickEventListener addClickEventListener(callback: (event: EventWithOffset): void): voidAttaches a click listener.
callback: (event: EventWithOffset): void
methodaddEventListener addEventListener(type: string, callback: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
type: stringcallback: (event: EventWithOffset): void
methodaddMouseDownEventListener addMouseDownEventListener(callback: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
callback: (event: EventWithOffset): void
methodaddMouseMoveEventListener addMouseMoveEventListener(callback: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
callback: (event: EventWithOffset): void
methodaddMouseUpEventListener addMouseUpEventListener(callback: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
callback: (event: EventWithOffset): void
methodaddResizeListener addResizeListener(callback: (): void): voidAttaches a resize listener for host target size changes.
callback: (): void
methodbeginFrame beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
methodbeginNodeSemanticsinherited beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
_semantics: RenderNodeSemantics
methodbeginPath beginPath(): voidBegins a new path.
methodclearRect clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
x: numbery: numberwidth: numberheight: number
methodclip clip(): voidClips future drawing to the active path.
methodcloneNode cloneNode(): WebWebGLRenderContextCreates a same-kind render context for an auxiliary render layer.
methodclosePath closePath(): voidCloses the active path.
methodcreateHitNode createHitNode(): WebCanvasRenderContextCreates a same-kind render context configured for hit testing.
methoddrawImage drawImage(image: unknown, x: number, y: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number): voiddrawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
image: unknownx: numbery: numberwidth: numberheight: numbersx: numbersy: numbersWidth: numbersHeight: number
methodendNodeSemanticsinherited endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
methodfill fill(): voidFills the active path with the current fill style.
methodfillText fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
text: stringx: numbery: numbermaxWidth: number
methodgetAttribute getAttribute(name: string): stringReads a host-visible attribute from the backing target.
name: string
methodgetImageData getImageData(x: number, y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
x: numbery: numberwidth: numberheight: number
methodgetLineWidth getLineWidth(): numberReturns the current stroke line width.
methodgetMaxLineWidth getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
methodgetRasterScale getRasterScale(): numberRaster units represented by one host-view unit for this context.
methodgetRenderTarget getRenderTarget(): HTMLCanvasElementReturns the native backing target owned by this render context.
methodgetRoot getRoot(): HTMLCanvasElementReturns the event root associated with this render context.
methodgetViewScale getViewScale(): numberReturns the current logical view scale.
methodinitialize initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
scale: number
methodlineTo lineTo(x: number, y: number): voidAdds a line from the current path cursor.
x: numbery: 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): voidMoves the active path cursor.
x: numbery: number
methodputImageData putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
imageData: RenderImageDatax: numbery: number
methodrect rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
x: numbery: numberwidth: numberheight: number
methodremoveClickEventListener removeClickEventListener(): voidRemoves a click listener.
methodremoveMouseDownEventListener removeMouseDownEventListener(): voidRemoves a pointer-press listener.
methodremoveMouseMoveEventListener removeMouseMoveEventListener(): voidRemoves a pointer-move listener.
methodremoveMouseUpEventListener removeMouseUpEventListener(): voidRemoves a pointer-release listener.
methodremoveResizeListener removeResizeListener(): voidRemoves the active resize listener, if any.
methodrequiresExplicitNodeClear requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
methodrequiresFrameRebuild requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
methodresetHitFrameinherited resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
width: numberheight: number
methodresetTransform resetTransform(): voidResets the current transform to the identity transform.
methodresize resize(width: number, height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
width: numberheight: numberscale: number
methodrestore restore(): voidRestores the most recently saved drawing state.
methodsave save(): voidSaves the current drawing state.
methodsetAttribute setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
name: stringvalue: string
methodsetFillStyle setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
fillStyle: RenderPaint
methodsetFont setFont(font: string): voidSets the active platform-neutral font descriptor.
font: string
methodsetLineDash setLineDash(segments: number[]): voidSets the current line dash pattern.
segments: number[]
methodsetLineWidth setLineWidth(width: number): voidSets the current stroke line width.
width: number
methodsetStrokeStyle setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
strokeStyle: RenderPaint
methodsetTransform setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
a: numberb: numberc: numberd: numbere: numberf: number
methodsetViewScale setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
scale: number
methodstroke stroke(): voidStrokes the active path with the current stroke style.
methodstrokeRect strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
x: numbery: numberwidth: numberheight: number
methodsupportsDirtyRedraw supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
methodtranslate translate(x: number, y: number): voidTranslates the current drawing transform.
x: numbery: number
- interfaceCoordinatePointsource ↗
-
interface CoordinatePointPublic contract for viewport/world/raster coordinate points.
- interfaceEventWithOffsetsource ↗
-
interface EventWithOffset extends RenderPointerEventHost 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?: booleanpropertybuttoninherited readonly button?: numberNormalized button index: zero is the primary pointer button.
propertyclickCount readonly clickCount?: numberConsecutive click count normalized by host adapters when available.
propertyclientXinherited readonly clientX?: numberpropertyclientYinherited readonly clientY?: numberpropertyctrlKeyinherited readonly ctrlKey?: booleanpropertydetailinherited readonly detail?: numberpropertymetaKeyinherited readonly metaKey?: booleanpropertyoffsetXinherited readonly offsetX: numberpropertyoffsetYinherited readonly offsetY: numberpropertyshiftKeyinherited readonly shiftKey?: booleanpropertytargetinherited readonly target?: unknownmethodpreventDefaultinherited preventDefault(): voidmethodstopPropagationinherited stopPropagation(): void - interfaceRenderImageDatasource ↗
-
interface RenderImageData - interfaceRenderNodeSemanticssource ↗
-
interface RenderNodeSemanticsSemantic ownership metadata attached to drawing for retained targets and diagnostics.
- interfaceRenderPointerEventsource ↗
-
interface RenderPointerEventPointer event shape shared by renderers without requiring host-native event types.
propertyaltKey readonly altKey?: booleanpropertybutton readonly button?: numberNormalized button index: zero is the primary pointer button.
propertyclickCount readonly clickCount?: numberpropertyclientX readonly clientX?: numberpropertyclientY readonly clientY?: numberpropertyctrlKey readonly ctrlKey?: booleanpropertydetail readonly detail?: numberpropertymetaKey readonly metaKey?: booleanpropertyoffsetX readonly offsetX: numberpropertyoffsetY readonly offsetY: numberpropertyshiftKey readonly shiftKey?: booleanpropertytarget readonly target?: unknownmethodpreventDefault preventDefault(): voidmethodstopPropagation stopPropagation(): void - typeRenderGradientsource ↗
-
type RenderGradient = objectOpaque paint handles supplied by a concrete renderer.
- typeRenderImageSourcesource ↗
-
type RenderImageSource = unknown - typeRenderPaintsource ↗
-
type RenderPaint = string | RenderGradient | RenderPattern - typeRenderPatternsource ↗
-
type RenderPattern = objectOpaque pattern handles supplied by a concrete renderer.
Package
@searsuite/sear-render-coord
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): CoordinateEngineConstructs 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: numberCoordinate 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key for coordinate state registration.
propertysymbolstatic readonly symbol: symbolDI token for resolving the coordinate engine.
memberkeyinherited key: unknownmethodapply apply(state: CoordinateState, _transaction: Transaction): CoordinateState | nullKeeps 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 | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetCoordinateState getCoordinateState(): CoordinateStateReturns a detached projection of the current input and viewport coordinates.
methodgetCurrentMouseScreen getCurrentMouseScreen(): CoordinatePointReturns the latest pointer position in host-event coordinates.
ReturnsCurrent pointer coordinate as recorded from mouse events.
methodgetCurrentMouseView getCurrentMouseView(): CoordinatePointReturns the latest pointer position in viewport coordinates.
methodgetCurrentMouseWorld getCurrentMouseWorld(): CoordinatePointReturns the latest pointer position in scrolled sheet-world coordinates.
ReturnsCurrent pointer converted through the active scroll transform.
methodgetPluginConfig getPluginConfig(): unknownCoordinateEngine has no plugin-specific configuration.
methodgetStateinherited getState(): CoordinateStateReturns 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(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: CoordinateState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: CoordinateState
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove onMouseMove(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidTracks the latest pointer position from sheet mouse-move events.
_searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>- Pointer event carrying host-view offsets.
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: CoordinateStatetransaction: 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>[] | nullCoordinateEngine does not render scene nodes directly.
methodscreenToView screenToView(screenX: number, screenY: number): CoordinatePointConverts a host-event point into an unscrolled viewport point.
screenX: numberscreenY: number
methodscreenToWorld screenToWorld(screenX: number, screenY: number): CoordinatePointConverts 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: CoordinateState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: CoordinateStatecommitToken: object
methodworldToScreen worldToScreen(worldX: number, worldY: number): CoordinatePointConverts 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 CoordinatePointTwo-dimensional point in the sheet coordinate system returned by this engine.
- interfaceCoordinateStatesource ↗
-
interface CoordinateStateLocal coordinate state tracked by CoordinateEngine.
propertymouseScreenX mouseScreenX: numberLatest pointer x-position in host-event view coordinates.
propertymouseScreenY mouseScreenY: numberLatest pointer y-position in host-event view coordinates.
propertyscrollX scrollX: numberLatest horizontal scroll offset in world coordinates.
propertyscrollY scrollY: numberLatest vertical scroll offset in world coordinates.
- functioncreateDefaultCoordinateStatesource ↗
-
createDefaultCoordinateState(): CoordinateStateCreates the default coordinate plugin state.
ReturnsInitial pointer and scroll coordinates.
Package
@searsuite/sear-render-cursor
Portable cursor policies with Web and headless host adapters.
- classCursorEnginesource ↗
-
class CursorEngineAbstract 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(): CursorEnginepropertysymbolstatic readonly symbol: symbolDI token for resolving CursorEngine.
methodapply apply(token: CursorToken): voidApplies a transaction to CursorEngine state.
token: CursorToken
methodmount mount(target: unknown): voidAttaches this adapter to its host surface.
target: unknown
methodoverride override(token: CursorToken | null): voidLock the cursor to a fixed token (e.g. during cell editing). Pass null to release.
token: CursorToken | null
methodunmount unmount(): voidDetaches this adapter from its host surface.
- classCursorRegistrysource ↗
-
class CursorRegistryStores 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): CursorRegistryCreates a registry and optionally enables position-rule conflict diagnostics.
platform: Platform
propertysymbolstatic readonly symbol: symbolDI token for resolving CursorRegistry.
methodregister register(rule: CursorRule): (): voidRegisters 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">): (): voidRegisters 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
kinddiscriminator.
methodresolve resolve(properties: CellProperties | null, position?: CursorPosition): CursorTokenResolves 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 CursorEngineCursor adapter for environments that have no visible pointer.
constructorconstructor HeadlessCursorEngine(): HeadlessCursorEnginepropertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessCursorEngine.
methodapply apply(_token: CursorToken): voidApplies a transaction to HeadlessCursorEngine state.
_token: CursorToken
methodmount mount(_target: unknown): voidAttaches this adapter to its host surface.
_target: unknown
methodoverride override(_token: CursorToken | null): voidApplies a temporary host cursor override.
_token: CursorToken | null
methodunmount unmount(): voidDetaches 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): SheetCursorPluginCreates a SheetCursorPlugin instance.
cursorRegistry: CursorRegistrycursorEngine: CursorEnginecoordinates: CoordinateEnginerenderContext: RenderContext
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: symbolDI token for resolving SheetCursorPlugin.
memberkeyinherited key: unknownmethodapply apply(_state: ISheetCursorState, _tx: Transaction): ISheetCursorState | nullApplies a transaction to SheetCursorPlugin state.
_state: ISheetCursorState_tx: Transaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): { }Returns the plugin config.
methodgetStateinherited getState(): ISheetCursorStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: ISheetCursorState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: ISheetCursorState
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove onMouseMove(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidReturns 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: ISheetCursorStatetransaction: 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(): nullReturns 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: ISheetCursorState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: ISheetCursorStatecommitToken: object
- classWebCursorEnginesource ↗
-
class WebCursorEngine extends CursorEngineBrowser CSS cursor implementation.
Maps CursorToken to CSS cursor values (including SVG data URI custom cursors).constructorconstructor WebCursorEngine(): WebCursorEnginepropertysymbolstaticinherited readonly symbol: symbolDI token for resolving CursorEngine.
methodapply apply(token: CursorToken): voidApplies a transaction to WebCursorEngine state.
token: CursorToken
methodmount mount(target: unknown): voidAttaches this adapter to its host surface.
target: unknown
methodoverride override(token: CursorToken | null): voidApplies a temporary host cursor override.
token: CursorToken | null
methodregisterToken registerToken(token: string, cssCursor: string): voidAllow third parties to extend or override Token → CSS mapping.
token: stringcssCursor: string
methodunmount unmount(): voidDetaches this adapter from its host surface.
- interfaceCursorPositionsource ↗
-
interface CursorPositionPointer coordinates supplied to a position cursor rule for one pointer event.
propertycore core: SearCoreSheetSheet core whose current data and interaction state may inform the cursor decision.
propertyorigin origin: EventWithOffsetOriginal host pointer event.
propertytarget target: CellProperties | nullHit-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 PositionCursorRuleCursor 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: CursorTokenLogical cursor presented while this rule owns the pointer.
propertykey key: string | symbolStable owner key used for replacement, removal, and conflict diagnostics.
propertykind kind: "position"propertylayer layer: numberPrecedence among position rules; larger values take precedence.
propertytest test: (position: CursorPosition): booleanReturns whether this rule owns the supplied pointer location.
- interfacePredicateCursorRulesource ↗
-
interface PredicateCursorRuleFully 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). - interfaceRegionCursorRulesource ↗
-
interface RegionCursorRuleExact region-match rule (highest priority among structural rules).
- interfaceTypeCursorRulesource ↗
-
interface TypeCursorRuleType-field match rule (secondary match).
- typeCursorRulesource ↗
-
type CursorRule = RegionCursorRule | TypeCursorRule | PredicateCursorRule | PositionCursorRuleType 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
Frame scheduling, dirty-region coordination, and Sheet render orchestration.
- classDataEnginesource ↗
-
class DataEngineBase 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(): DataEnginepropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the abstract data engine singleton.
methodenforceWriteBoundary enforceWriteBoundary(token: object): voidRestricts registered state and view changes to the owning runtime after setup.
token: object
methodgetDataType getDataType<T>(key: PluginKey): T | undefinedRetrieves a plugin-owned data value.
ReturnsRegistered value, or void 0 when absent.
key: PluginKey- Plugin key to read.
methodgetDataTypeOptions getDataTypeOptions(key: PluginKey): DataEngineRegistrationOptions<unknown> | undefinedReads 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 | undefinedResolves 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): booleanReports 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(): voidInitializes engine-owned registries or projections.
methodreadDataViewField readDataViewField<FieldType>(viewKey: string, fieldKey: string): FieldType | undefinedReads 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): voidRegisters 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): voidRegisters 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): voidReplaces a plugin-owned data value.
key: PluginKey- Plugin key owning the data.
value: unknown- New data value.
token: object
- classDataViewFieldDuplicateErrorsource ↗
-
class DataViewFieldDuplicateError extends SearErrorError 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 }): DataViewFieldDuplicateErrorCreates 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?: unknownpropertycode readonly code: "DATA_VIEW_FIELD_DUPLICATE"Stable machine-readable code for duplicate data view field registrations.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classRenderContextFactorysource ↗
-
class RenderContextFactoryFactory registry for render-context implementations.
constructorconstructor RenderContextFactory(): RenderContextFactorymethodcreateContextstatic createContext(type: string | symbol, args: unknown): RenderContextCreates 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): voidRegisters 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: ScrollManagerrenderContext: RenderContextconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerTyperenderStrategyManager: RenderStrategyManager<NodeType>
propertyconfigEngine readonly configEngine: ConfigEnginepropertyrenderContext readonly renderContext: RenderContextpropertyrenderCoordinatorManager readonly renderCoordinatorManager: RenderCoordinatorManagerTypepropertyrenderStrategyManager readonly renderStrategyManager: RenderStrategyManager<NodeType>propertyscrollManager readonly scrollManager: ScrollManagerpropertysymbolstatic readonly symbol: symbolDI token for resolving RenderEngine.
methodinitialize initialize(): voidInitializes RenderEngine.
methodinvalidateScreenCache invalidateScreenCache(): voidDiscard pixel-cache reuse before the next render.
methodmarkDirty markDirty(rect: PositionRect<templateLiteral>): voidMarks a region or the current scene for rendering on the next frame.
rect: PositionRect<templateLiteral>
methodrender render(node: Node<NodeType>): voidRenders RenderEngine scene output.
node: Node<NodeType>
methodresize resize(width: number, height: number, scale: number): voidResizes the render target and invalidates dependent frame state.
width: numberheight: numberscale: number
methodsetViewScale setViewScale(scale: number): voidUpdates the view scale.
scale: number
- classSheetDataEnginesource ↗
-
class SheetDataEngine extends DataEngineData engine specialization for sheet matrix state.
constructorconstructor SheetDataEngine(): SheetDataEnginepropertysymbolstaticinherited readonly symbol: typeof symbolDI token for resolving the abstract data engine singleton.
methodenforceWriteBoundaryinherited enforceWriteBoundary(token: object): voidRestricts registered state and view changes to the owning runtime after setup.
token: object
methodgetDataTypeinherited getDataType<T>(key: PluginKey): T | undefinedRetrieves a plugin-owned data value.
ReturnsRegistered value, or void 0 when absent.
key: PluginKey- Plugin key to read.
methodgetDataTypeOptionsinherited getDataTypeOptions(key: PluginKey): DataEngineRegistrationOptions<unknown> | undefinedReads 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 | undefinedResolves 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): booleanReports 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(): voidInitializes sheet data projections.
methodreadDataViewFieldinherited readDataViewField<FieldType>(viewKey: string, fieldKey: string): FieldType | undefinedReads 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): voidRegisters 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): voidRegisters 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): voidReplaces 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): SheetDataPluginConstructs the sheet data plugin.
state: SheetDataPluginState- Shared sheet data state.
formatCodecs: (): CellFormatTransferRegistry
propertydepthinherited readonly depth: numberDraw 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional 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: falseSheet 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: PluginKeyStable plugin key shared by all sheet data plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the sheet data plugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: SheetDataPluginState, transaction: Transaction): SheetDataPluginState | nullApplies 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 | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: unknowntransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(): nullSheet data has no render-time configuration.
methodgetStateinherited getState(): SheetDataPluginStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: SheetDataPluginState): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: SheetDataPluginState
methodonClickinherited onClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: unknown, cell: unknown, row: number, col: number): voidReceives 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: unknowncell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: unknown): voidCalled after the final cell of the shared startup scan is delivered.
searCore: unknown
methodonMouseDowninherited onMouseDown(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: unknownevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: SheetDataPluginStatetransaction: Transaction
methodregisterConfiginherited registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
methodregisterFormatTransfers registerFormatTransfers(registry: SheetFormatTransferRegistry): voidContributes this owner's cell state to atomic range moves.
registry: SheetFormatTransferRegistry
methodregisterQueries registerQueries(queries: SheetDataQueryRegistry): voidPublishes a live read-only projection for consumers that do not need an export snapshot.
queries: SheetDataQueryRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: SheetDataPluginState, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: SheetDataPluginStatecommitToken: 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>): SheetRenderEngineCreates a SheetRenderEngine instance.
scrollManager: ScrollManagerrenderContext: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextconfigEngine: ConfigEnginerenderCoordinatorManager: SheetRenderCoordinatorManagerrenderStrategyManager: RenderStrategyManager<CellProperties>screenRenderStrategy: ScreenRenderStrategy<CellProperties>dirtyRenderStrategy: DirtyRenderStrategy<CellProperties>stickyRenderStrategy: StickyRenderStrategy<CellProperties>overlayRenderStrategy: OverlayRenderStrategy<CellProperties>
propertyconfigEngineinherited readonly configEngine: ConfigEnginepropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: SheetRenderCoordinatorManagerpropertyrenderStrategyManagerinherited readonly renderStrategyManager: RenderStrategyManager<CellProperties>propertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertysymbolstaticinherited readonly symbol: symbolDI token for resolving RenderEngine.
methodapply apply(operations: MatrixOTOperation<number>[]): voidApplies a transaction to SheetRenderEngine state.
operations: MatrixOTOperation<number>[]
methodgetLayer getLayer(): voidReturns the layer.
methodgetStage getStage(): voidReturns the stage.
methodinitialize initialize(): voidInitializes SheetRenderEngine.
methodinvalidateScreenCache invalidateScreenCache(): voidDrops retained screen content so the next frame repaints it.
methodmarkDirty markDirty(rect: PositionRect<templateLiteral>): voidMarks a region or the current scene for rendering on the next frame.
rect: PositionRect<templateLiteral>
methodonClick onClick(): voidHandles the click lifecycle event.
methodonScroll onScroll(scrollManagerState: ScrollManagerState): voidHandles the scroll lifecycle event.
scrollManagerState: ScrollManagerState
methodrender render(node: Node<CellProperties>): voidRenders SheetRenderEngine scene output.
node: Node<CellProperties>
methodresize resize(width: number, height: number, scale: number): voidResizes every canvas layer and invalidates scroll optimization buffers.
width: numberheight: numberscale: number
methodsetViewScale setViewScale(scale: number): voidUpdates the view scale.
scale: number
- classVisibleRowDimensionssource ↗
-
class VisibleRowDimensions extends DimensionsCSRMatrixDimension view shared by layout, hit testing, and rendering.
constructorconstructor VisibleRowDimensions(source: DimensionsCSRMatrix, visibility: SheetRowVisibility): VisibleRowDimensionssource: DimensionsCSRMatrixvisibility: SheetRowVisibility
propertynameinherited name: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, column: number | null[]): thisInserts a column while omitting values equal to the configured default dimension.
targetIndex: numbercolumn: number | null[]
methodaddIteminherited addItem(row: number, col: number, value: number): thisStores 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): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: number | null[]): thisInserts a row while omitting values equal to the configured default dimension.
targetIndex: numberrow: number | null[]
methodcloneinherited clone(): thisCreates an independent copy of this value and its mutable data.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: number): number): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: number): number
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): VisibleRowDimensionsDeletes 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): VisibleRowDimensionsDeletes 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>[]): VisibleRowDimensionsApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: number, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: number, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: number, col: number): void
methodfromDenseinherited fromDense(denseArray: number | null[][]): VisibleRowDimensionsConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: number | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetDimensionLeftBoundaryByIndexinherited getDimensionLeftBoundaryByIndex(colIndex: number): numberGets 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 onceExample// 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): numberGets 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 onceExample// 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 resultExampleconst matrix = new DimensionsCSRMatrix(...); const map = matrix.getDimensionsMap(); // [10, 30, 60]methodgetItem getItem(row: number, column: number): number | nullRetrieves 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): numberFinds 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): numberFinds 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: number): voidSets 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): voidSums 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): VisibleRowDimensionsSwaps 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): VisibleRowDimensionsSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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: stringField name written into the named view.
propertyrequired readonly required?: booleanWhen false, missing owner state or void field values do not make the containing view unavailable.
propertyselect readonly select: (state: StateType): unknownReads the field value from the current owner state.
propertyviewKey readonly viewKey: stringNamed read model that receives the selected field.
- interfaceSheetCellDataReadersource ↗
-
interface SheetCellDataReaderRead-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): voidstartRow: numberstartColumn: numberendRow: numberendColumn: numbervisit: (cell: CellMatrixElement, row: number, column: number): void
methodgetItem getItem(row: number, column: number): CellMatrixElement | nullrow: numbercolumn: number
- interfaceSheetDataPluginStatesource ↗
-
interface SheetDataPluginStateState owned by SheetDataPlugin.
propertysheetData sheetData: SheetMatrixMain sheet matrix containing persisted cell values.
- interfaceSheetDataQueryRegistrysource ↗
-
interface SheetDataQueryRegistryMinimal query registry surface consumed by SheetDataPlugin.
methodregister register(definition: ReadSheetCellDataQueryDefinition, handler: (input: void): SheetCellDataReader): (): voiddefinition: ReadSheetCellDataQueryDefinitionhandler: (input: void): SheetCellDataReader
- interfaceSheetRowVisibilitysource ↗
-
interface SheetRowVisibilityA Sheet presentation contribution that can suppress rows without changing their stored heights.
propertyactive readonly active: booleanpropertyversion readonly version: numbermethodisRowFiltered isRowFiltered(row: number): booleanrow: number
- typeDataEngineViewFieldSelectorsource ↗
-
type DataEngineViewFieldSelector = { select: unknown }["select"]Selector used to publish one registered state field into a named data view.
- variableReadSheetCellDataQuerysource ↗
-
ReadSheetCellDataQuery: ReadSheetCellDataQueryDefinitionReads 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 | nullReads the persisted cell matrix published by SheetDataPlugin.
dataEngine: DataEngine
- functionreadSheetRawRowSizessource ↗
-
readSheetRawRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads the resize owner's stored row heights, without presentation visibility.
dataEngine: DataEngine
- functionregisterReadSheetCellDataQuerysource ↗
-
registerReadSheetCellDataQuery(queries: SheetDataQueryRegistry, read: (): SheetMatrix): voidRegisters the live, read-only cell-data projection owned by SheetDataPlugin.
queries: SheetDataQueryRegistryread: (): SheetMatrix
- interfaceCellMatrixElementsource ↗
-
interface CellMatrixElementPersisted cell payload stored in the sheet matrix.
propertyformula formula?: stringFormula 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: stringCell type identifier owned by the cell type catalog.
propertyvalue value?: unknownRaw 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>): DocRenderEngineCreates a render engine for one document editor instance.
scrollManager: ScrollManagerrenderContext: RenderContextconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeProperties>renderStrategyManager: RenderStrategyManager<NodeProperties>screenRenderStrategy: ScreenRenderStrategy<NodeProperties>dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>stickyRenderStrategy: StickyRenderStrategy<NodeProperties>overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>
propertyconfigEngineinherited readonly configEngine: ConfigEnginepropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyrenderStrategyManagerinherited readonly renderStrategyManager: RenderStrategyManager<NodeProperties>propertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertysymbolstatic readonly symbol: symbolDI token for resolving DocRenderEngine.
methodgetLastScreenRenderMode getLastScreenRenderMode(): ScreenRenderFrameMode | nullReturns the screen strategy mode used by the last render pass, if it painted.
methodinitialize initialize(): voidInitializes DocRenderEngine.
methodinvalidateScreenCache invalidateScreenCache(): voidInvalidates the off-screen body cache used by the screen strategy.
methodmarkDirty markDirty(rect: PositionRect<templateLiteral>): voidMarks one document-world rectangle dirty for the next dirty pass.
rect: PositionRect<templateLiteral>
methodrender render(node: Node<NodeProperties>): voidRuns the configured document render strategies over the current scene graph.
node: Node<NodeProperties>
methodresize resize(width: number, height: number, scale: number): voidResizes all Doc render layers and invalidates screen-cache reuse.
width: numberheight: numberscale: number
methodsetBlockRasterCopyPlan setBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): voidSupplies one layout-shift raster-copy plan for the next screen render pass.
plan: BlockRasterCopyPlan | null
methodsetViewport setViewport(viewport: DocRenderViewport): voidUpdates the viewport model used by subsequent render frames.
viewport: DocRenderViewport
methodsetViewScale setViewScale(scale: number): voidUpdates the view scale on every render strategy context.
scale: number
- interfaceDocRenderViewportsource ↗
-
interface DocRenderViewportSnapshot of the current document viewport used by render strategies.
propertycontentRect readonly contentRect: PositionRectPropsEditable content rectangle inside the viewport.
propertyheight readonly height: numberVisible viewport height in host-view units.
propertywidth readonly width: numberVisible viewport width in host-view units.
- functionreadSheetColumnSizessource ↗
-
readSheetColumnSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads column dimensions published by SheetResizePlugin.
dataEngine: DataEngine
- functionreadSheetRowSizessource ↗
-
readSheetRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads row dimensions published by SheetResizePlugin.
dataEngine: DataEngine
- 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]): SheetMatrixConstructs 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: stringThe name of the matrix state.
propertyndiminherited readonly ndim: numberNumber 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: unknownmembershapeinherited shape: unknownmethodaddColumninherited addColumn(targetIndex: number, col: CellMatrixElement | null[]): SheetMatrixAdds 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): SheetMatrixAdds 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): voidRegisters a listener for future state changes.
listener: Listener- Callback invoked after notifyListeners().
methodaddRowinherited addRow(targetIndex: number, row: CellMatrixElement | null[]): SheetMatrixAdds 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(): thisCopies stored cell payloads as well as sparse indexes.
methodcloneCommittedViewinherited cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
detachExtra: (value: unknown): unknown
methodcloneDetachedinherited cloneDetached(cloneValue: (value: CellMatrixElement): CellMatrixElement): thisCopies stored values for a detached snapshot without probing empty cells.
cloneValue: (value: CellMatrixElement): CellMatrixElement
methodcloneForStaginginherited cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
cloneValue: <Value>(value: Value): Value
methoddeleteColumnsinherited deleteColumns(targetIndex: number, numDeleteColumns?: number): SheetMatrixDeletes 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): SheetMatrixDeletes 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>[]): SheetMatrixApplies 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>): voidComputes 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): voidIterates 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.Examplelet 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): voidVisits 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): voidVisits stored entries in an inclusive rectangle, skipping empty CSR rows and out-of-range columns.
startRow: numberstartColumn: numberendRow: numberendColumn: numbercallback: (value: CellMatrixElement, row: number, column: number): void
methodforEachStoredInRowinherited forEachStoredInRow(row: number, callback: (value: CellMatrixElement, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
row: numbercallback: (value: CellMatrixElement, col: number): void
methodfromDenseinherited fromDense(denseArray: CellMatrixElement | null[][]): SheetMatrixConverts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArray: CellMatrixElement | null[][]- The dense array to convert.
methodgetColinherited getCol(colIndex: number): voidRetrieves 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 | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
methodgetIteminherited getItem(row: number, col: number): CellMatrixElement | nullRetrieves 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): voidRetrieves 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(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
methodmultiplyinherited multiply<U>(other: SparseMatrix<U>): voidMultiplies 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 | undefinedRemoves 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): voidRemoves a previously registered listener.
listener: Listener- Callback to detach from this state object.
methodsetDefaultValueinherited setDefaultValue(value: CellMatrixElement): voidSets 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.Examplematrix.setDefaultValue(0); // Return 0 for missing cells const value = matrix.getItem(5, 5); // Returns 0 if not setvalue: CellMatrixElement- The default value to return for missing elements
methodsuminherited sum(axis: 0 | 1 | null): voidSums 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): SheetMatrixSwaps 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): SheetMatrixSwaps 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
nullif not set.methodtransposeinherited transpose(): voidTransposes 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.
- 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
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: ScrollManagerrenderContext: RenderContextstageNode: SceneGraph<NodeTypeProperties>configEngine: ConfigEngineeventRenderStrategy: EventRenderStrategy<NodeTypeProperties>hitRenderStrategy: HitRenderStrategy<NodeTypeProperties>eventRegistrar: EventRegistrarcoordinates: CoordinateTransformer
propertyconfigEngine readonly configEngine: ConfigEnginepropertyeventRegistrar readonly eventRegistrar: EventRegistrarpropertyeventRenderStrategy readonly eventRenderStrategy: EventRenderStrategy<NodeTypeProperties>propertyhitRenderStrategy readonly hitRenderStrategy: HitRenderStrategy<NodeTypeProperties>propertyrenderContext readonly renderContext: RenderContextpropertyscrollManager readonly scrollManager: ScrollManagerpropertystageNode readonly stageNode: SceneGraph<NodeTypeProperties>propertysymbolstatic readonly symbol: symbolDI token for resolving the event engine.
methodaddStrategy addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidRegisters a named render strategy used by event handling.
name: string | Symbolstrategy: RenderStrategy<NodeTypeProperties>
methoddestroy destroy(ownerToken?: object): voidClears plugin handlers so a destroyed sheet cannot react to host events.
ownerToken: object
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetStrategy getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefinedReturns a previously registered event render strategy.
name: string | Symbol
methodinitialize initialize(): voidRegisters built-in strategies and attaches render-context listeners.
methodoffinherited off(eventString?: string, handler?: Function): voidRemoves 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): (): voidRegisters a plugin event handler for a normalized event key.
eventKey: stringhandler: (event: Event): void
methodregisterEventListenersToRenderContext registerEventListenersToRenderContext(): voidAttaches platform event listeners to the underlying render context.
methodrender render(node: Node<NodeTypeProperties>): voidRebuilds the hit layer for the given scene graph.
node: Node<NodeTypeProperties>
methodrenderHitOnNextFrame renderHitOnNextFrame(node: Node<NodeTypeProperties>): voidCoalesces scroll-driven hit refreshes to at most one per animation frame.
node: Node<NodeTypeProperties>
methodrenderImmediate renderImmediate(node: Node<NodeTypeProperties>): voidRender the hit canvas immediately, bypassing the debounce timer.
See HitRenderStrategy.renderImmediate() for details.node: Node<NodeTypeProperties>
- classEventRegistrarsource ↗
-
class EventRegistrarBase registry for event names supported by one host event adapter.
constructorconstructor EventRegistrar(): EventRegistrarpropertyregisteredEvents registeredEvents: string[]Normalized event names currently registered for dispatch.
propertysymbolstatic readonly symbol: symbolDI token for resolving the event registrar.
methodenforceCommandBoundary enforceCommandBoundary(assertWrite: (): void): voidPublishes a read-only event-name view after editor assembly.
assertWrite: (): void
methodregister register(eventKey: string): voidRegisters an event name after normalizing platform casing.
eventKey: string- Event name requested by a plugin.
methodunregister unregister(eventKey: string): voidRemoves a registered event name.
eventKey: string- Event name requested by a plugin.
- classHeadlessEventRegistrarsource ↗
-
class HeadlessEventRegistrar extends EventRegistrarEvent registrar for hosts without a native event source.
constructorconstructor HeadlessEventRegistrar(): HeadlessEventRegistrarpropertyregisteredEventsinherited registeredEvents: string[]Normalized event names currently registered for dispatch.
propertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessEventRegistrar.
methodenforceCommandBoundaryinherited enforceCommandBoundary(assertWrite: (): void): voidPublishes a read-only event-name view after editor assembly.
assertWrite: (): void
methodregisterinherited register(eventKey: string): voidRegisters an event name after normalizing platform casing.
eventKey: string- Event name requested by a plugin.
methodunregisterinherited unregister(eventKey: string): voidRemoves a registered event name.
eventKey: string- Event name requested by a plugin.
- classWebEventRegistrarsource ↗
-
class WebEventRegistrar extends EventRegistrarBrowser event registrar with the built-in mouse event surface enabled.
constructorconstructor WebEventRegistrar(): WebEventRegistrarpropertyregisteredEvents registeredEvents: string[]Normalized mouse events supported by the browser registrar.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving the event registrar.
methodenforceCommandBoundaryinherited enforceCommandBoundary(assertWrite: (): void): voidPublishes a read-only event-name view after editor assembly.
assertWrite: (): void
methodregisterinherited register(eventKey: string): voidRegisters an event name after normalizing platform casing.
eventKey: string- Event name requested by a plugin.
methodunregisterinherited unregister(eventKey: string): voidRemoves 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?: numberConsecutive click count for this pointer activation, when known.
propertyorigin origin: EventWithOffsetOriginal host event emitted by the render context.
propertytarget target: Node<NodeTypeProperties> | nullTopmost scene node hit by the event, or null when empty.
- functiongetPluginHandlerNamesource ↗
-
getPluginHandlerName(eventKey: string): stringDerives the plugin handler method name for a given event key.
e.g.mousedown/mouseDown→onMouseDowneventKey: string
- functionnormalizeEventKeysource ↗
-
normalizeEventKey(eventKey: string): stringNormalizes an event key (whether lowercased like
mousedownor camelCased likemouseDown)
to its canonical engine identifier (mouseDown).eventKey: string
- interfaceEventWithOffsetsource ↗
-
interface EventWithOffset extends RenderPointerEventHost 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?: booleanpropertybuttoninherited readonly button?: numberNormalized button index: zero is the primary pointer button.
propertyclickCount readonly clickCount?: numberConsecutive click count normalized by host adapters when available.
propertyclientXinherited readonly clientX?: numberpropertyclientYinherited readonly clientY?: numberpropertyctrlKeyinherited readonly ctrlKey?: booleanpropertydetailinherited readonly detail?: numberpropertymetaKeyinherited readonly metaKey?: booleanpropertyoffsetXinherited readonly offsetX: numberpropertyoffsetYinherited readonly offsetY: numberpropertyshiftKeyinherited readonly shiftKey?: booleanpropertytargetinherited readonly target?: unknownmethodpreventDefaultinherited preventDefault(): voidmethodstopPropagationinherited stopPropagation(): void
Package
@searsuite/sear-render-input
Keyboard, pointer, text-input, and composition routing contracts.
- classHeadlessKeyboardRoutersource ↗
-
class HeadlessKeyboardRouter extends KeyboardRouterKeyboard router for hosts that do not expose a keyboard event source.
constructorconstructor HeadlessKeyboardRouter(): HeadlessKeyboardRouterpropertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessKeyboardRouter.
methodemitinherited emit(eventString: never, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: never- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: undefined, handler?: Function): voidRemoves 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): HeadlessKeyboardRouterRegisters 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(): voidStarts listening to the host input source.
methodstopListener stopListener(): voidStops listening to the host input source.
methodsubscribe subscribe(_handlers: KeyboardRouterHandlers): voidSubscribes to state changes and returns an idempotent disposer.
_handlers: KeyboardRouterHandlers
- classHeadlessPointerCapturesource ↗
-
class HeadlessPointerCapture extends PointerCaptureNo-op pointer capture adapter for hosts without a pointer event source.
constructorconstructor HeadlessPointerCapture(): HeadlessPointerCapturepropertysymbolstaticinherited readonly symbol: symbolDI token for resolving the pointer capture adapter.
methodstart start(_handlers: PointerCaptureHandlers): (): voidStarts one capture session and returns a disposer for that session.
_handlers: PointerCaptureHandlers
methodstop stop(): voidStops the active session without invoking its release callback.
- classHeadlessTextInputsource ↗
-
class HeadlessTextInput extends TextInputText-input adapter that intentionally owns no platform input element.
constructorconstructor HeadlessTextInput(): HeadlessTextInputCreates a TextInput instance.
propertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessTextInput.
methodemitinherited emit(eventString: never, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: never- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: undefined, handler?: Function): voidRemoves 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): HeadlessTextInputRegisters 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(): voidRestores focus to the hidden host text-input surface.
methodsetPositioninherited setPosition(_x: number, _y: number): voidUpdates the position.
_x: number_y: number
methodstartListener startListener(): voidStarts forwarding host text and composition events.
methodstopListener stopListener(): voidStops forwarding host text and composition events.
methodsubscribe subscribe(_handlers: TextInputHandlers): voidSubscribes to state changes and returns an idempotent disposer.
_handlers: TextInputHandlers
methodisTextInputstaticinherited isTextInput<T>(event: T): eventClassifies text events within a typed input-action union.
event: T
- classInputsource ↗
-
class Input extends EventListenerBase 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(): Inputmethodemitinherited emit(eventString: never, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: never- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: undefined, handler?: Function): voidRemoves 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): InputRegisters 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(): voidStarts listening to the host input source.
methodstopListener stopListener(): voidStops listening to the host input source.
- classInputManagersource ↗
-
class InputManagerRegistry for input adapters owned by one editor instance.
constructorconstructor InputManager(textInput: Input): InputManagerConstructs the manager with the configured text input adapter.
textInput: Input- Text input adapter resolved from the host.
propertytextInput readonly textInput: InputText input adapter resolved from the host.
propertysymbolstatic readonly symbol: symbolDI token for resolving the input manager.
methodget get<T>(symbol: symbol): T | undefinedRetrieves an input adapter by symbol.
ReturnsRegistered adapter, or void 0 when absent.
symbol: symbol- Adapter symbol.
methodgetTextInput getTextInput(): TextInput | undefinedReturns the text-input adapter when it has been registered.
methodregister register(symbol: symbol, input: Input): voidRegisters an input adapter.
symbol: symbol- Adapter symbol.
input: Input- Adapter instance.
- classKeyboardRoutersource ↗
-
class KeyboardRouter extends InputAbstract 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. UnlikeTextInput,
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(): KeyboardRouterpropertysymbolstatic readonly symbol: symbolDI token for resolving KeyboardRouter.
methodemitinherited emit(eventString: never, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: never- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: undefined, handler?: Function): voidRemoves 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): KeyboardRouterRegisters 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(): voidStarts listening to the host input source.
methodstopListenerinherited stopListener(): voidStops listening to the host input source.
methodsubscribe subscribe(handlers: KeyboardRouterHandlers): void | (): voidInstalls handlers; implementations may return a disposer that restores the previous handlers.
handlers: KeyboardRouterHandlers
- classPointerCapturesource ↗
-
class PointerCapturePlatform-neutral, editor-local host-wide pointer capture contract.
constructorconstructor PointerCapture(): PointerCapturepropertysymbolstatic readonly symbol: symbolDI token for resolving the pointer capture adapter.
methodstart start(handlers: PointerCaptureHandlers): (): voidStarts one capture session and returns a disposer for that session.
handlers: PointerCaptureHandlers
methodstop stop(): voidStops the active session without invoking its release callback.
- classTextInputsource ↗
-
class TextInput extends InputRoutes host text and composition input through portable subscriptions.
constructorconstructor TextInput(): TextInputCreates a TextInput instance.
propertysymbolstatic readonly symbol: symbolDI token for resolving TextInput.
methodemitinherited emit(eventString: never, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: never- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: undefined, handler?: Function): voidRemoves 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): TextInputRegisters 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(): voidRestores focus to the hidden host text-input surface.
methodsetPosition setPosition(_x: number, _y: number): voidUpdates the position.
_x: number_y: number
methodstartListener startListener(): voidStarts forwarding host text and composition events.
methodstopListener stopListener(): voidStops forwarding host text and composition events.
methodsubscribe subscribe(_handlers: TextInputHandlers): voidSubscribes to state changes and returns an idempotent disposer.
_handlers: TextInputHandlers
methodisTextInputstatic isTextInput<T>(event: T): eventClassifies text events within a typed input-action union.
event: T
- classWebKeyboardRoutersource ↗
-
class WebKeyboardRouter extends KeyboardRouterBrowser implementation of
KeyboardRouter.
Attaches akeydownlistener to the injectedEventTargetin 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.
TheEventTarget(typicallydocument) is injected via DI usingWebKeyboardRouter.eventTargetSymbol, keeping this class free of hard-coded
browser globals and making it straightforward to test with a stub.
The listener is active only betweenstartListener()/stopListener().constructorconstructor WebKeyboardRouter(eventTarget: EventTarget): WebKeyboardRouterCreates a WebKeyboardRouter instance.
eventTarget: EventTarget
propertyeventTargetSymbolstatic readonly eventTargetSymbol: symbolDI token for the keyboard event source, normally
document.propertysymbolstaticinherited readonly symbol: symbolDI token for resolving KeyboardRouter.
methodemitinherited emit(eventString: never, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: never- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: undefined, handler?: Function): voidRemoves 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): WebKeyboardRouterRegisters 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(): voidStarts listening to the host input source.
methodstopListener stopListener(): voidStops listening to the host input source.
methodsubscribe subscribe(handlers: KeyboardRouterHandlers): (): voidInstalls handlers; implementations may return a disposer that restores the previous handlers.
handlers: KeyboardRouterHandlers
- classWebPointerCapturesource ↗
-
class WebPointerCapture extends PointerCaptureBrowser pointer capture adapter that emits render-root view coordinates.
constructorconstructor WebPointerCapture(renderContext: RenderContext, platform: Platform, eventTarget: unknown): WebPointerCaptureCreates one editor-local browser pointer capture adapter.
renderContext: RenderContextplatform: PlatformeventTarget: unknown
propertyeventTargetSymbolstatic readonly eventTargetSymbol: symbolDI token for the host-wide event source, normally
document.propertysymbolstaticinherited readonly symbol: symbolDI token for resolving the pointer capture adapter.
methodstart start(handlers: PointerCaptureHandlers): (): voidStarts one capture session and returns a disposer for that session.
handlers: PointerCaptureHandlers
methodstop stop(): voidStops the active session without invoking its release callback.
- classWebTextInputsource ↗
-
class WebTextInput extends TextInputBrowser 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 toWebKeyboardRouterso 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. Callrefocus()whenever a
pointer event inside the editor area moves focus elsewhere.constructorconstructor WebTextInput(): WebTextInputCreates a WebTextInput instance.
propertyonDelete onDelete?: (): voidHandles the delete lifecycle event.
propertyonTextInput onTextInput?: (event: TextInputEvent): voidHandles the input lifecycle event.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving TextInput.
methodemitinherited emit(eventString: never, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: never- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: undefined, handler?: Function): voidRemoves 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): WebTextInputRegisters 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(): voidRestore focus to the hidden input (e.g. after a canvas click moves focus away).
methodsetPosition setPosition(x: number, y: number): voidMove the hidden input to the cursor's screen position so that the OS
IME candidate window is anchored near the cell being edited.x: numbery: number
methodstartListener startListener(): voidStarts forwarding host text and composition events.
methodstopListener stopListener(): voidStops forwarding host text and composition events.
methodsubscribe subscribe(handlers: TextInputHandlers): voidSubscribes to state changes and returns an idempotent disposer.
handlers: TextInputHandlers
methodisTextInputstaticinherited isTextInput<T>(event: T): eventClassifies text events within a typed input-action union.
event: T
- interfaceKeyboardRouterHandlerssource ↗
-
interface KeyboardRouterHandlersCallbacks 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 ofTextInput).propertyonArrowDown onArrowDown?: (shiftKey: boolean, metaKey: boolean): voidpropertyonArrowLeft onArrowLeft?: (shiftKey: boolean, metaKey: boolean): voidpropertyonArrowRight onArrowRight?: (shiftKey: boolean, metaKey: boolean): voidpropertyonArrowUp onArrowUp?: (shiftKey: boolean, metaKey: boolean): voidpropertyonCopy onCopy?: (): voidCtrl/Cmd + C - copy the active sheet selection.
propertyonCut onCut?: (): voidCtrl/Cmd + X - cut the active sheet selection.
propertyonDelete onDelete?: (): voidBackspace / Delete key.
propertyonEdit onEdit?: (): voidEnters editing while retaining the selected cell's content.
propertyonEnd onEnd?: (): voidMoves to the last occupied cell of the sheet.
propertyonEnter onEnter?: (shiftKey: boolean, primaryModifier?: boolean): voidEnter key – commit the current edit.
propertyonEscape onEscape?: (): voidEscape key – cancel the current edit.
propertyonHome onHome?: (primaryModifier: boolean): voidMoves to the start of the active row, or sheet with a primary modifier.
propertyonPage onPage?: (direction: -1 | 1): voidMoves the active selection by roughly one viewport.
propertyonPaste onPaste?: (): voidCtrl/Cmd + V - paste from the host clipboard.
propertyonRedo onRedo?: (): voidCtrl/Cmd + Shift + Z or Ctrl/Cmd + Y - redo the latest undone mutation.
propertyonSelectAll onSelectAll?: (): voidCtrl/Cmd + A – select all content in the editor.
propertyonSelectColumn onSelectColumn?: (): voidSelects the entire active column.
propertyonSelectRow onSelectRow?: (): voidSelects the entire active row.
propertyonSoftEnter onSoftEnter?: (): voidAlt/Option + Enter – insert a line break (soft enter) inside the cell.
propertyonTab onTab?: (shiftKey: boolean): voidTab / Shift+Tab - move the active sheet selection horizontally.
propertyonToggleBold onToggleBold?: (): voidCtrl/Cmd + B - toggle bold text in the active rich-text editor.
propertyonToggleItalic onToggleItalic?: (): voidCtrl/Cmd + I - toggle italic text in the active rich-text editor.
propertyonToggleReference onToggleReference?: (): voidCycles the reference at the formula caret through relative and absolute modes.
propertyonToggleStrikethrough onToggleStrikethrough?: (): voidCtrl/Cmd + Shift + X - toggle strikethrough text in the active rich-text editor.
propertyonToggleUnderline onToggleUnderline?: (): voidCtrl/Cmd + U - toggle underlined text in the active rich-text editor.
propertyonUndo onUndo?: (): voidCtrl/Cmd + Z - undo the latest sheet mutation.
propertyonZoomIn onZoomIn?: (): voidpropertyonZoomOut onZoomOut?: (): voidpropertyonZoomReset onZoomReset?: (): void - interfacePointerCaptureHandlerssource ↗
-
interface PointerCaptureHandlersCallbacks active for one host-wide pointer capture session.
- interfacePointerCapturePointsource ↗
-
interface PointerCapturePointPointer position normalized to the editor render root's view coordinates.
propertyview readonly view: { x: number; y: number } - interfaceTextInputHandlerssource ↗
-
interface TextInputHandlersPortable text and selection-deletion subscriptions.
propertyonDelete onDelete?: (): voidReceives a clipboard cut as deletion of the current selection.
propertyonTextInput onTextInput?: (event: TextInputEvent): voidReceives 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
Platform-neutral text shaping and glyph measurement contracts.
- classRenderContextTextShapersource ↗
-
class RenderContextTextShaper extends TextShaperPortable fallback backed by the host's render-neutral text measurements.
constructorconstructor RenderContextTextShaper(context: RenderContext): RenderContextTextShapercontext: RenderContext
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving the editor-local text-shaper provider.
methodclearCacheinherited clearCache(): voidClears all cached shaping results owned by this adapter.
methodshapeinherited shape(input: TextShapeInput): TextShapeResultShapes one homogeneous text run, reusing an identical cached request.
input: TextShapeInput
- classTextMeasurementManagersource ↗
-
class TextMeasurementManagerOwns reusable semantic text measurements for one editor runtime.
constructorconstructor TextMeasurementManager(textShaper: TextShaper): TextMeasurementManagertextShaper: TextShaper
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the editor-local text measurement manager.
methodclear clear(): voidClears semantic measurements without taking ownership of the text shaper.
methodmeasureSpace measureSpace(font: string): TextShapeResultMeasures one space for a font and reuses the editor-local result.
font: string
- classTextShapersource ↗
-
class TextShaperAbstract 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(): TextShaperpropertysymbolstatic readonly symbol: symbolDI token for resolving the editor-local text-shaper provider.
methodclearCache clearCache(): voidClears all cached shaping results owned by this adapter.
methodshape shape(input: TextShapeInput): TextShapeResultShapes one homogeneous text run, reusing an identical cached request.
input: TextShapeInput
- classWebTextShapersource ↗
-
class WebTextShaper extends TextShaperBrowser-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 leavingglyphsempty.
CallclearCache()after an asynchronously loaded font becomes available.constructorconstructor WebTextShaper(context: WebTextShaperContext): WebTextShaperCreates a Web text shaper over a host-owned Canvas2D context.
context: WebTextShaperContext
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving the editor-local text-shaper provider.
methodclearCacheinherited clearCache(): voidClears all cached shaping results owned by this adapter.
methodshapeinherited shape(input: TextShapeInput): TextShapeResultShapes one homogeneous text run, reusing an identical cached request.
input: TextShapeInput
- classWebTextShaperErrorsource ↗
-
class WebTextShaperError extends SearErrorError raised when a Web text-shaping request cannot be represented by Canvas2D.
constructorconstructor WebTextShaperError(message: string, details?: SearErrorDetails): WebTextShaperErrorCreates a Web text-shaper error with stable diagnostics.
message: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: "WEB_TEXT_SHAPER_ERROR"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- interfaceFontDescriptorInputsource ↗
-
interface FontDescriptorInputStructured font values supplied by editor configuration and host contexts.
propertyfontFamily readonly fontFamily: stringpropertyfontSize readonly fontSize: number - interfaceShapedCaretStopsource ↗
-
interface ShapedCaretStopA logical caret boundary produced by the shaping implementation.
propertytextOffset readonly textOffset: numberUTF-16 source-text offset for this caret boundary.
propertyx readonly x: numberAdvance position in the shaped run's logical direction.
- interfaceShapedGlyphsource ↗
-
interface ShapedGlyphOne positioned glyph returned by a text-shaping implementation.
propertycluster readonly cluster: numberUTF-16 offset of the source text cluster represented by this glyph.
propertyglyphId readonly glyphId: numberpropertyxAdvance readonly xAdvance: numberpropertyxOffset readonly xOffset: numberpropertyyAdvance readonly yAdvance: numberpropertyyOffset readonly yOffset: number - interfaceShapedTextClustersource ↗
-
interface ShapedTextClusterMapping between source text and the glyph range generated for it.
propertyglyphEnd readonly glyphEnd: numberpropertyglyphStart readonly glyphStart: numberpropertytextEnd readonly textEnd: numberpropertytextStart readonly textStart: number - interfaceTextShapeInputsource ↗
-
interface TextShapeInputInput passed to a text-shaper implementation. Offsets are UTF-16 offsets.
propertydirection readonly direction?: TextShapeDirectionpropertyfeatures readonly features?: Readonly<Record<string, TextShapeFeatureValue>>Explicit OpenType feature settings, for example
{ liga: true, kern: true }.propertyfont readonly font: stringFont descriptor understood by the selected shaping implementation.
propertylanguage readonly language?: stringISO/BCP language tag, when known.
propertyscript readonly script?: stringOpenType script tag, when known.
propertytext readonly text: stringpropertyvariations readonly variations?: Readonly<Record<string, number>>Variation-axis values for variable fonts, keyed by four-character axis tag.
- interfaceTextShapeResultsource ↗
-
interface TextShapeResultEngine-neutral result of shaping one homogeneous text run.
propertycaretStops readonly caretStops: readonly ShapedCaretStop[]propertyclusters readonly clusters: readonly ShapedTextCluster[]propertyfontAscent readonly fontAscent?: numberpropertyfontDescent readonly fontDescent?: numberpropertyfontLineGap readonly fontLineGap?: numberpropertyglyphs readonly glyphs: readonly ShapedGlyph[]propertyheight readonly height: numberTotal vertical advance, normally zero for horizontal text.
propertywidth readonly width: numberTotal horizontal advance of the shaped run.
- interfaceWebTextShaperContextsource ↗
-
interface WebTextShaperContextNative text settings and operations required by the Web adapter.
propertydirection direction: CanvasDirectionpropertyfont font: stringpropertyfontKerning fontKerning?: CanvasFontKerningmethodmeasureText measureText(text: string): TextMetricstext: string
methodrestore restore(): voidmethodsave save(): void - typeTextShapeDirectionsource ↗
-
type TextShapeDirection = "ltr" | "rtl"Direction of a shaped text run in logical document order.
- typeTextShapeFeatureValuesource ↗
-
type TextShapeFeatureValue = boolean | numberOpenType feature value accepted by a text-shaper adapter.
- functioncreateFontDescriptorsource ↗
-
createFontDescriptor(input: FontDescriptorInput): stringCreates the low-level font descriptor consumed by text shaping and rendering.
input: FontDescriptorInput
- functioncreateWebTextShaperContextsource ↗
-
createWebTextShaperContext(renderContext: RenderContext): WebTextShaperContextAdapts the shared render context to the Web shaper contract.
renderContext: RenderContext
Package
@searsuite/sear-render-node
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: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertysticky sticky: booleanAffix nodes render in the sticky strategy instead of the scrolled content layer.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(context: RenderContext): voidClears this node's bounds from a raster context using stroke padding.
context: RenderContext- Render context to clear.
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidDraws the node into the hit-test context unless the node is visual-only.
context: RenderContext- Hit render context.
methoddrawSceneinherited drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws 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[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberText draws above the box background by default.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertysticky sticky: booleanAffix text renders in the sticky strategy together with its parent.
propertyvalueinherited readonly value: string | RichDocNodeText value rendered by this node.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(context: RenderContext): voidText nodes are cleared through their parent box dirty region.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidText nodes do not draw separate hit regions; the parent box owns hit testing.
context: RenderContext
methoddrawSceneinherited drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws 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[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextBlockLayoutProviderMeasures rich-document blocks and produces wrapped rich-text layout lines.
constructorconstructor BlockManager(textShaper: TextShaper, inlineStyleRegistry: RichTextInlineStyleRegistry, runRenderRegistry: RichTextRunRenderRegistry, lineBoxRegistry: RichTextLineBoxRegistry, baseFont?: string, paragraphLayoutDefaults?: RichTextParagraphLayoutDefaults): BlockManagerCreates a block manager from the text-shaping and rich-text services.
textShaper: TextShaperinlineStyleRegistry: RichTextInlineStyleRegistryrunRenderRegistry: RichTextRunRenderRegistrylineBoxRegistry: RichTextLineBoxRegistrybaseFont: stringparagraphLayoutDefaults: RichTextParagraphLayoutDefaults
propertymaxWidth maxWidth: numberMaximum measured unwrapped block width.
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the rich-document block manager.
methodadd add(node: RichDocNode): voidAdds 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(): voidClears all measured blocks and cached size information.
methodcreateDetached createDetached(): BlockManagerCreates an unshared measurement workspace for a read-only layout request.
methodenforceCommandBoundary enforceCommandBoundary(isCommandExecuting: (): boolean): voidCloses direct block writes after the owning editor has assembled.
isCommandExecuting: (): boolean
methodsetBaseFont setBaseFont(font: string): voidSelects 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 withposition: 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: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidClears state owned by BoxNode.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidDraws 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): voidDraws the scene for this node and all its descendants.
This method recursively callsdrawSceneon all child nodes.context: RenderContext- The rendering context used to draw the scene.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberThe maximum number of entries retained by this spatial node.
propertyparentinherited parent: Tree<T> | nullThe parent spatial node, or null at the root.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidRemoves all indexed items.
methodgetBoundary getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
methodinsert insert(data: T): booleanInserts 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): booleanRemoves one item by object identity.
data: T
methodtoJSON toJSON(): objectSerializes debug data for this spatial index.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces 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: PositionRectPropsproperties: Partial<T>layer: CellVisualLayer
propertychildKeysinherited readonly childKeys: string[]Keys of direct child nodes registered via add(), used for recursive cleanup.
propertydepthinherited depth: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidClears state owned by Node.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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(): voidAbstract method to draw the node's hit detection representation.
Must be implemented by subclasses.methoddrawScene drawScene(context: RenderContext): voidAbstract method to draw the node's scene representation.
Must be implemented by subclasses.context: RenderContext- The rendering context.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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(): ContainerCreates a Container instance.
propertyrandomColorKey readonly randomColorKey: templateLiteral | nullUnique random color key for hit detection.
memberchildren children: unknownmethodadd add(child: Container): thisadd(children: Container[]): thisAdds the value.
child: Containerchildren: Container[]
methoddescendants descendants(): never[]Iterates every descendant in scene order.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoffinherited off(eventString?: string, handler?: Function): voidRemoves 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): ContainerRegisters 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(): voidReturns descendants whose boundaries intersect the supplied rectangle.
methodremove remove(): voidRemoves the value.
methodtoJSON toJSON(): { }Serializes this scene structure into diagnostic JSON.
methodupdateBoundary updateBoundary(): voidUpdates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidClears the line bounds with stroke padding.
context: RenderContext- Render context to clear.
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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(): voidDashed lines are visual-only and do not participate in hit testing.
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the dashed line into the render context.
context: RenderContext- Render context receiving draw commands.
clipRegion: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 DirtyTreeDI token placeholder for the dirty-region spatial index.
constructorconstructor DirtyTree(): DirtyTreepropertysymbolstatic readonly symbol: symbolDI 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[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: CustomEventTypes- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodoff off(eventString?: CustomEventTypes, handler?: Function): voidRemoves 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: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidClears this node's bounds from a raster context using stroke padding.
context: RenderContext- Render context to clear.
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidDraws the node into the hit-test context unless the node is visual-only.
context: RenderContext- Hit render context.
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws 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[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 GenerationalDirtyTrackerFrame-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>>): GenerationalDirtyTrackerCreates a GenerationalDirtyTracker instance.
tree: Tree<PositionRect<templateLiteral>>
propertysymbolstatic readonly symbol: symbolDI token for resolving GenerationalDirtyTracker.
methodclear clear(): voidFrame-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>): voidRecords 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: numberThe maximum number of entries retained by this spatial node.
propertyparentinherited parent: Tree<T> | nullThe parent spatial node, or null at the root.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidRemoves all indexed items.
methodgetBoundary getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
methodinsert insert(data: T): booleanInserts 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): booleanRemoves an item by matching rectangle bounds.
data: T
methodtoJSON toJSON(): objectSerializes debug data for this spatial index.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
boundary: PositionRect<templateLiteral>
- classHitColorRegistrysource ↗
-
class HitColorRegistryMaps hit-canvas color keys back to render nodes.
constructorconstructor HitColorRegistry(): HitColorRegistrypropertysymbolstatic readonly symbol: symbolDI token for resolving the hit-color registry.
methodclear clear(): voidClears all registered hit-color mappings.
methoddelete delete(key: templateLiteral): voidRemoves a hit-canvas color key mapping.
key: templateLiteral
methodget get<T>(key: templateLiteral): Node<T> | undefinedResolves the node currently associated with a hit-canvas color key.
key: templateLiteral
methodregister register<T>(key: templateLiteral, node: Node<T>): voidRegisters a node for hit-canvas color lookup.
key: templateLiteralnode: 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: numberThe maximum number of entries retained by this spatial node.
propertyparentinherited parent: Tree<T> | nullThe parent spatial node, or null at the root.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidRemoves all indexed items.
methodgetBoundary getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
methodinsert insert(data: T): booleanInserts 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): booleanRemoves one item by object identity and rebuilds the experimental tree.
data: T
methodtoJSON toJSON(): objectSerializes debug data for this spatial index.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces 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: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(context: RenderContext): voidClears state owned by Node.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidAbstract 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): voidAbstract method to draw the node's scene representation.
Must be implemented by subclasses.context: RenderContext- The rendering context.
clipRegion: ClipRegion- Optional clipping region: a
PositionRectfor axis-aligned rectangular clip,
or aPoint[]polygon (array of[x, y]vertices) for arbitrary shape clip.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertyname name: stringName of the node, defaults to the class name.
propertynodeKey readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKey parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertysticky sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottom bottom: unknownmemberconfigEngine configEngine: unknownmemberfill fill: unknownmemberheight height: unknownmemberhorizontalAlign horizontalAlign: unknownmemberleft left: unknownmemberlineDash lineDash: unknownmemberright right: unknownmemberstroke stroke: unknownmemberstrokeWidth strokeWidth: unknownmembertop top: unknownmemberverticalAlign verticalAlign: unknownmemberwidth width: unknownmemberx x: unknownmembery y: unknownmethodadd 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidClears state owned by Node.
context: RenderContext
methoddispose dispose(): voidDisposes 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): voidDraws 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): voidAbstract 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): voidAbstract method to draw the node's scene representation.
Must be implemented by subclasses.context: RenderContext- The rendering context.
clipRegion: ClipRegion- Optional clipping region: a
PositionRectfor axis-aligned rectangular clip,
or aPoint[]polygon (array of[x, y]vertices) for arbitrary shape clip.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKey getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListener removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTree setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberThe maximum number of entries retained by this spatial node.
propertyparentinherited parent: Tree<T> | nullThe parent spatial node, or null at the root.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidRemoves all indexed items.
methodgetBoundary getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
methodinsert insert(data: T): booleanInserts 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): booleanRemoves one item by object identity.
data: T
methodtoJSON toJSON(): objectSerializes debug data for this spatial index.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces 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): QuadTreeConstructs a QuadTree node.
boundary: PositionRect<templateLiteral>- Node boundary.
capacity: number- Maximum items before subdivision.
propertybottomleft bottomleft: QuadTree | nullBottom-left child node.
propertybottomright bottomright: QuadTree | nullBottom-right child node.
propertycapacityinherited readonly capacity: numberThe maximum number of entries retained by this spatial node.
propertydivided divided: booleanWhether this node has been subdivided into children.
propertyparentinherited parent: Tree<PositionRect<templateLiteral>> | nullThe parent spatial node, or null at the root.
propertyrects rects: PositionRect<templateLiteral>[]Rectangles stored directly in this node.
propertytopleft topleft: QuadTree | nullTop-left child node.
propertytopright topright: QuadTree | nullTop-right child node.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidClears all indexed rectangles and child quadrants.
methodcontains contains(boundary: PositionRect<templateLiteral>, rect: PositionRect<templateLiteral>): booleanReturns 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>): booleanInserts 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>): booleanReturns 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): booleanRemoves 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(): voidSplits this node into four child quadrants and redistributes contained items.
methodtoJSON toJSON(): objectSerializes debug data for this tree.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces 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): QuadTreeCreates 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: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(context: RenderContext): voidClears state owned by Node.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidAbstract 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): voidAbstract method to draw the node's scene representation.
Must be implemented by subclasses.context: RenderContext- The rendering context.
clipRegion: ClipRegion- Optional clipping region: a
PositionRectfor axis-aligned rectangular clip,
or aPoint[]polygon (array of[x, y]vertices) for arbitrary shape clip.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextVisualNodeScene 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 }): RichTextCaretNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext): voidDraws the caret when the blink state says it is visible.
context: RenderContext
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextCaretNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextVisualNodeScene 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 }): RichTextCompositionNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext): voidDraws composing text in world or viewport coordinates.
context: RenderContext
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextCompositionNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextVisualNodeScene 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 }): RichTextContentNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws every included layout line inside this node's clip.
context: RenderContextclipRegion: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextContentNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextLineRendererPaints laid-out rich-text lines by grouping adjacent characters into runs.
constructorconstructor RichTextLineRenderer(inlineStyles: RichTextInlineStyleRegistry, runRenderer: RichTextRunRenderer): RichTextLineRendererCreates a line renderer with domain style comparison and run rendering.
inlineStyles: RichTextInlineStyleRegistryrunRenderer: RichTextRunRenderer
propertysymbolstatic readonly symbol: typeof symbolDI token for resolving the line renderer.
methodpaint paint(context: RenderContext, input: { font?: string; line: RichTextRenderLine; origin: Pick<PositionRectProps, "x" | "y"> }): voidPaints one laid-out line at the supplied world-space origin.
context: RenderContextinput: { font?: string; line: RichTextRenderLine; origin: Pick<PositionRectProps, "x" | "y"> }
- classRichTextRunRenderersource ↗
-
class RichTextRunRendererPaints one contiguous rich-text run using the registered render contributions.
constructorconstructor RichTextRunRenderer(registry: RichTextRunRenderRegistry): RichTextRunRendererCreates a run renderer backed by the render contribution registry.
registry: RichTextRunRenderRegistry
propertysymbolstatic readonly symbol: typeof symbolDI 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; … }): voidPaints one run and restores all renderer state changed by its style plugins.
context: RenderContextinput: { baselineY: number; font: string; fontAscent: number; fontDescent: number; height: number; style: Readonly<Record<string, unknown>> | undefined; text: string; width: number; … }
- classRichTextRunRenderRegistrysource ↗
-
class RichTextRunRenderRegistryRender-layer registry for plugin-owned rich-text run behavior.
constructorconstructor RichTextRunRenderRegistry(): RichTextRunRenderRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the rich-text run render registry.
methodapplyRenderState applyRenderState(context: RenderContext, style: Readonly<Record<string, unknown>> | undefined): voidApplies all registered render-state contributions before text painting.
context: RenderContextstyle: Readonly<Record<string, unknown>> | undefined
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidassertWrite: (): void
methodpaintRun paintRun(input: RichTextRunPaintInput): voidPaints all registered plugin-owned run details.
input: RichTextRunPaintInput
methodregister register(contribution: RichTextRunRenderContribution): (): voidRegisters one render contribution.
contribution: RichTextRunRenderContribution
methodresolveFont resolveFont(font: string, style: Readonly<Record<string, unknown>> | undefined): stringResolves the final font descriptor after all registered contributions run.
font: stringstyle: Readonly<Record<string, unknown>> | undefined
- classRichTextSelectionNodesource ↗
-
class RichTextSelectionNode extends RichTextVisualNodeScene 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 }): RichTextSelectionNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws selection rectangles in world or viewport coordinates.
context: RenderContextclipRegion: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextSelectionNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawSceneinherited drawScene(context: RenderContext, clipRegion?: ClipRegion): voidAbstract method to draw the node's scene representation.
Must be implemented by subclasses.context: RenderContext- The rendering context.
clipRegion: ClipRegion- Optional clipping region: a
PositionRectfor axis-aligned rectangular clip,
or aPoint[]polygon (array of[x, y]vertices) for arbitrary shape clip.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextVisualNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberThe maximum number of entries retained by this spatial node.
propertyparentinherited parent: Tree<T> | nullThe parent spatial node, or null at the root.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidRemoves all indexed items.
methodgetBoundary getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
methodinsert insert(data: T): booleanInserts 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): booleanRemoves one item by object identity.
data: T
methodtoJSON toJSON(): objectSerializes debug data for this spatial index.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
propertysymbolstatic readonly symbol: symbolDI token for resolving the scene graph.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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 }): voidReplaces 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidSceneGraph is cleared through strategy-owned dirty regions.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidSceneGraph is a root container and is not drawn into the hit layer directly.
context: RenderContext
methoddrawScene drawScene(context: RenderContext): voidSceneGraph is a root container and is not drawn directly.
context: RenderContext
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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 }): voidMarks 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): voidRemoves 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 }): voidReconciles 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: stringnode: Node<T> | Node<T>[]options: { markDirty?: boolean; replaceRetainedGeometryChanged?: boolean; replaceRetainedKeys?: ReadonlySet<string>; retainExisting?: boolean; updateRetainedGeometry?: boolean }
methodremoveChildinherited removeChild(child: Node<T>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberThe maximum number of entries retained by this spatial node.
propertyparentinherited parent: Tree<T> | nullThe parent spatial node, or null at the root.
propertysymbolstaticinherited readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidRemoves all indexed items.
methodgetBoundary getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
methodinsert insert(data: T): booleanInserts 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): booleanRemoves one item from its hashed bucket.
data: T
methodtoJSON toJSON(): objectSerializes debug data for this spatial index.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces 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: PositionRectPropsprops: 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(context: RenderContext): voidClears state owned by BoxNode.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidDraws 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): voidDraws the scene for this node and all its descendants.
This method recursively callsdrawSceneon all child nodes.context: RenderContext- The rendering context used to draw the scene.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberText draws above the box background by default.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
propertyvalue readonly value: string | RichDocNodeText value rendered by this node.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidth width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidText nodes are cleared through their parent box dirty region.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidText nodes do not draw separate hit regions; the parent box owns hit testing.
context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws 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[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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: numberThe maximum number of entries retained by this spatial node.
propertyparent parent: Tree<T> | nullThe parent spatial node, or null at the root.
propertysymbolstatic readonly symbol: symbolDI token for resolving Tree.
methodclear clear(): voidClears state owned by Tree.
methodgetBoundary getBoundary(): PositionRect<templateLiteral>Returns the boundary.
methodinsert insert(item: T): booleanInserts 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): booleanRemoves the value.
item: Tpredicate: (rect: PositionRect<templateLiteral>): boolean
methodtoJSON toJSON(): objectSerializes this scene structure into diagnostic JSON.
methodupdateBoundary updateBoundary(boundary: PositionRect<templateLiteral>): voidUpdates the indexed boundary after geometry changes.
boundary: PositionRect<templateLiteral>
- interfaceCellVisualLabelsource ↗
-
interface CellVisualLabelOne text label drawn within a feature-contributed visual layer.
- interfaceCellVisualLayersource ↗
-
interface CellVisualLayerA visual rectangle, icon or sequence of labels within its cell bounds.
propertyfill readonly fill?: string | { end: string; start: string }propertyheight readonly height: numberpropertyicon 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?: CellVisualLayerShapepropertyslot readonly slot: stringpropertywidth readonly width: numberpropertyx readonly x: numberpropertyy readonly y: number - interfaceRichTextRenderCharsource ↗
-
interface RichTextRenderCharMinimal rich-text character shape consumed by render nodes.
- interfaceRichTextRunPaintInputsource ↗
-
interface RichTextRunPaintInputGeometry and render state for one contiguous rich-text run.
propertybaselineY readonly baselineY: numberpropertycontext readonly context: RenderContextpropertyfontAscent readonly fontAscent: numberpropertyfontDescent readonly fontDescent: numberpropertyheight readonly height: numberpropertystyle readonly style: Readonly<Record<string, unknown>> | undefinedpropertytext readonly text: stringpropertywidth readonly width: numberpropertyx readonly x: number - interfaceRichTextRunRenderContributionsource ↗
-
interface RichTextRunRenderContributionPlugin-owned render behavior for one inline text-style concern.
propertykey readonly key: stringStable contribution key used for duplicate detection and unregister.
methodapplyRenderState applyRenderState(input: { context: RenderContext; style: Readonly<Record<string, unknown>> | undefined }): voidApplies renderer state before the text run is painted.
input: { context: RenderContext; style: Readonly<Record<string, unknown>> | undefined }
methodpaintRun paintRun(input: RichTextRunPaintInput): voidPaints plugin-owned details for an already painted text run.
input: RichTextRunPaintInput
methodresolveFont resolveFont(input: { font: string; style: Readonly<Record<string, unknown>> | undefined }): stringResolves the font used by shaping and painting for a styled run.
input: { font: string; style: Readonly<Record<string, unknown>> | undefined }
- interfaceRichTextSelectionRectsource ↗
-
interface RichTextSelectionRectRectangle highlighted as part of a rich-text selection.
- interfaceRichTextVisualNodeInputsource ↗
-
interface RichTextVisualNodeInputShared construction options for visual-only rich-text render nodes.
propertyblockId readonly blockId?: stringpropertyblockIndex readonly blockIndex?: numberpropertydepth readonly depth: numberpropertyisEdit readonly isEdit?: booleanpropertynodeKey readonly nodeKey: stringpropertyrect readonly rect: PositionRectPropspropertyrenderRole 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 = HexColorColor key used only by hit-canvas rendering and pixel-to-node lookup.
- typeNodePropertiessource ↗
-
type NodeProperties = unknownType contract for NodeProperties.
propertybottom bottom?: numberpropertycontentInsetStart contentInsetStart?: numberSpace reserved before projected text for a cell visual.
propertycornerRadius cornerRadius?: [number, number, number, number]propertydepth depth?: numberpropertyfill fill?: stringpropertyfitNumberValue fitNumberValue?: numberRaw General-format number fitted against the actual render width.
propertyhideText hideText?: booleanSuppresses projected text while preserving its underlying value.
propertyhorizontalAlign horizontalAlign?: SheetHorizontalAlignmentpropertyisEdit isEdit?: booleanpropertyleft left?: numberpropertylineDash lineDash?: number[]propertynodeKey nodeKey?: RenderNodeKeyStable 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?: PositionRectPropsOptional 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?: numberpropertysemanticOwner semanticOwner?: stringStable semantic ownership exposed by retained render targets.
propertysemanticRole semanticRole?: stringStable semantic role exposed by retained render targets.
propertyshouldBeClipInDirtyRender shouldBeClipInDirtyRender?: booleanBusiness 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?: booleanVisual-only nodes do not participate in hit canvas.
Background:FixBoxNode.drawHitfills 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.
SettingskipHit: truein properties makesdrawHitskip directly.propertystroke stroke?: stringpropertystrokeWidth strokeWidth?: numberpropertytextColor textColor?: stringForeground color used by text-rendering nodes.
propertytextFillCharacter textFillCharacter?: stringCharacter repeated to fill the remaining inline width of formatted text.
propertytop top?: numberpropertyverticalAlign verticalAlign?: SheetVerticalAlignment - typeRenderNodeKeysource ↗
-
type RenderNodeKey = stringStable key used by SceneGraph, Tree and DataStorage to identify render nodes.
- typeRichTextBlockIdsource ↗
-
type RichTextBlockId = stringStable 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: numberbaselineY: numberwidth: numberheight: numberfontAscent: number
- classRichTextBlockNodesource ↗
-
class RichTextBlockNode extends RichTextVisualNodeScene 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 }): RichTextBlockNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws all visible text runs inside this block.
context: RenderContextclipRegion: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextBlockNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextRenderLineMinimal layout-line shape consumed by rich-text render nodes.
propertychars readonly chars: readonly RichTextRenderChar[]propertycharStartOffset readonly charStartOffset: numberpropertycursorXOffsets readonly cursorXOffsets?: readonly number[]propertyfontAscent readonly fontAscent: numberpropertyheight readonly height: numberpropertytextNodePath readonly textNodePath: readonly number[]propertyx readonly x: numberpropertyy readonly y: number - interfaceRichTextRenderNodePropertiessource ↗
-
interface RichTextRenderNodeProperties extends NodePropertiesRender-node properties used by rich-text scene graphs.
propertyblockId readonly blockId?: stringStable top-level rich-text block id.
propertyblockIndex readonly blockIndex?: numberTop-level rich-text block index.
propertybottominherited bottom?: numberpropertycontentInsetStartinherited contentInsetStart?: numberSpace reserved before projected text for a cell visual.
propertycornerRadiusinherited cornerRadius?: [number, number, number, number]propertydepthinherited depth?: numberpropertyfillinherited fill?: stringpropertyfitNumberValueinherited fitNumberValue?: numberRaw General-format number fitted against the actual render width.
propertyhideTextinherited hideText?: booleanSuppresses projected text while preserving its underlying value.
propertyhorizontalAligninherited horizontalAlign?: SheetHorizontalAlignmentpropertyisEditinherited isEdit?: booleanpropertyleftinherited left?: numberpropertylineDashinherited lineDash?: number[]propertylineIndex readonly lineIndex?: numberLayout line index inside the full rich-text snapshot.
propertynodeKeyinherited nodeKey?: stringStable 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?: PositionRectPropsOptional 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?: numberpropertysemanticOwnerinherited semanticOwner?: stringStable semantic ownership exposed by retained render targets.
propertysemanticRoleinherited semanticRole?: stringStable semantic role exposed by retained render targets.
propertyshouldBeClipInDirtyRenderinherited shouldBeClipInDirtyRender?: booleanBusiness 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?: booleanVisual-only nodes do not participate in hit canvas.
Background:FixBoxNode.drawHitfills 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.
SettingskipHit: truein properties makesdrawHitskip directly.propertystrokeinherited stroke?: stringpropertystrokeWidthinherited strokeWidth?: numberpropertytextColorinherited textColor?: stringForeground color used by text-rendering nodes.
propertytextFillCharacterinherited textFillCharacter?: stringCharacter repeated to fill the remaining inline width of formatted text.
propertytopinherited top?: numberpropertyverticalAligninherited verticalAlign?: SheetVerticalAlignment - classRichTextRunNodesource ↗
-
class RichTextRunNode extends RichTextVisualNodeScene 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>>; … }): RichTextRunNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the text run into the active world-space transform.
context: RenderContextclipRegion: ClipRegion
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): RichTextRunNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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 RichTextVisualNodeViewport 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" }): ViewportOverlayNodeCreates 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: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclearinherited clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
_context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext): voidDraws overlay content; the node owns transform isolation for viewport-space plugins.
context: RenderContext
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<RichTextRenderNodeProperties> | nullFinds 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> | nullFinds 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): voidRemoves 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): ViewportOverlayNodeRegisters 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<RichTextRenderNodeProperties>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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
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): AffixCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: symbolBuilt-in affix cell type symbol.
methodgetDisplayText getDisplayText(): stringReturns 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): BooleanCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: typeof symbolmethodgetDisplayText getDisplayText(): stringReturns 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: TpositionRect: PositionRectPropsproperties: Tcontext: CellContext
propertycontext readonly context: CellContextpropertydata readonly data: TpropertypositionRect readonly positionRect: PositionRectPropspropertyproperties readonly properties: TmethodgetDisplayText getDisplayText(): stringReturns 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): EditorCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: symbolBuilt-in editor cell type symbol.
methodgetDisplayText getDisplayText(): stringExtracts 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: TeditSession: SheetEditSessioneditRenderOptions: SheetEditRenderOptions
propertychildKeysinherited readonly childKeys: string[]Keys of direct child nodes registered via add(), used for recursive cleanup.
propertydepthinherited depth: numberRender and event ordering depth for Node.
propertynameinherited name: stringName of the node, defaults to the class name.
propertynodeKeyinherited readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
propertyparentKeyinherited parentKey: string | nullParent 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 | nullUnique random color key used for hit detection.
propertystickyinherited sticky: booleanWhether this node remains fixed while its scroll container moves.
memberbottominherited bottom: unknownmemberconfigEngineinherited configEngine: unknownmemberfillinherited fill: unknownmemberheightinherited height: unknownmemberhorizontalAligninherited horizontalAlign: unknownmemberleftinherited left: unknownmemberlineDashinherited lineDash: unknownmemberrightinherited right: unknownmemberstrokeinherited stroke: unknownmemberstrokeWidthinherited strokeWidth: unknownmembertopinherited top: unknownmemberverticalAligninherited verticalAlign: unknownmemberwidthinherited width: unknownmemberxinherited x: unknownmemberyinherited y: unknownmethodaddinherited 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): voidAdds 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): voidBinds this node tree to the editor-local services owned by one SceneGraph.
container: Container
methodclear clear(context: RenderContext): voidClears state owned by Node.
context: RenderContext
methoddisposeinherited dispose(): voidDisposes 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): voidDraws 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): voidRich-text content is visual-only; the cell box owns hit detection.
_context: RenderContext
methoddrawScene drawScene(context: RenderContext, clipRegion?: ClipRegion): voidAbstract method to draw the node's scene representation.
Must be implemented by subclasses.context: RenderContext- The rendering context.
clipRegion: ClipRegion- Optional clipping region: a
PositionRectfor axis-aligned rectangular clip,
or aPoint[]polygon (array of[x, y]vertices) for arbitrary shape clip.
methodemitinherited emit(eventString: string, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returnsfalse, dispatch to subsequent handlers stops.
Returningtrue/undefined/voidmeans dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin ondblClick) without direct plugin-to-plugin
state mutation.Returns
falseif a handler actively stopped propagation; otherwisetrue.eventString: string- The name of the event to trigger.
args: unknown[]- Arguments to pass to the event handlers.
methodenforceWriteBoundaryinherited enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
assertWrite: (): voidteardownToken: object
methodgetNodeByNodeKeyinherited getNodeByNodeKey(key: string): Node<T> | nullFinds 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> | nullFinds 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): voidRemoves 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>): voidRemoves a child node from this node and disposes its entire subtree.
child: Node<T>
methodremoveEventListenerinherited removeEventListener(type: string): voidRemoves an event listener for the specified event type.
type: string- The event type to remove.
methodsetStickyTreeinherited setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
sticky: booleanaffix: 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): EmptyCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: symbolBuilt-in empty cell type symbol.
methodgetDisplayText getDisplayText(): stringEmpty 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): FormulaCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: symbolDI token for resolving FormulaCell.
methodgetDisplayText getDisplayText(): stringReturns 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: symbolDI token for resolving the active node factory.
methodcreate create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeTypeCreates 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): (): voidRegisters 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): NumberCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: symbolDI token for resolving NumberCell.
methodgetDisplayText getDisplayText(): stringReturns the display text.
methodrender render(): Node<CellProperties<number>> | Node<CellProperties<number>>[]Renders NumberCell scene output.
- classRenderCoordinatorManagersource ↗
-
class RenderCoordinatorManagerCoordinates cell creation and rendering for a concrete renderer registry.
constructorconstructor RenderCoordinatorManager(): RenderCoordinatorManagerpropertysymbolstatic readonly symbol: symbolDI token for resolving the active render coordinator manager.
methodcreate create<T>(): TCreates a cell instance from registered type metadata.
methodregisterRenderer registerRenderer(): voidRegisters renderer functions supported by the coordinator.
methodregisterType registerType(): voidRegisters 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: symbolDI token for resolving the active renderer registry.
methodregisterRenderer registerRenderer(type: unknown, rendererFn: (input: unknown): Node<RegistryProperties> | Node<RegistryProperties>[]): (): voidRegisters 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): RichTextCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: symbolBuilt-in rich-text cell type symbol.
methodgetDisplayText getDisplayText(): stringExtracts 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 SearErrorPublic error raised for invalid Sheet cell visual-reader contributions.
constructorconstructor SheetCellVisualReaderError(code: SheetCellVisualReaderErrorCode, message: string, details?: SearErrorDetails): SheetCellVisualReaderErrorcode: SheetCellVisualReaderErrorCodemessage: stringdetails: SearErrorDetails
propertycauseinherited cause?: unknownpropertycode readonly code: SheetCellVisualReaderErrorCodeStable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classSheetCellVisualReaderRegistrysource ↗
-
class SheetCellVisualReaderRegistryComposes editor-local, plugin-owned visual properties for Sheet cells.
constructorconstructor SheetCellVisualReaderRegistry(): SheetCellVisualReaderRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for the editor-local registry.
methoddestroy destroy(): voidRemoves all editor-local reader registrations.
methodnextConditionalPriority nextConditionalPriority(): numberAllocates 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): (): voidRegisters one reader and rejects duplicate ids or property ownership.
reader: SheetCellVisualReader
methodregisterConditional registerConditional(reader: SheetCellConditionalVisualReader): (): voidRegisters a rule source whose matches are composed across feature plugins.
reader: SheetCellConditionalVisualReader
methodregisterOverride registerOverride(reader: SheetCellVisualOverride): (): voidRegisters 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(): SheetNodeFactorymethodcreate 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>>): (): voidRegisters 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 SheetRenderCoordinatorManagerCoordinates cell projection and rendering for a Sheet frame.
constructorconstructor SheetRenderCoordinatorManager(nodeFactory: SheetNodeFactory, rendererRegistry: SheetRendererRegistry<CellProperties>, formulaResultProvider: IFormulaResultProvider, platform?: Platform | undefined, cellFormatLocaleProvider?: ICellFormatLocaleProvider): SheetRenderCoordinatorManagerCreates a SheetRenderCoordinatorManager instance.
nodeFactory: SheetNodeFactoryrendererRegistry: SheetRendererRegistry<CellProperties>formulaResultProvider: IFormulaResultProviderplatform: Platform | undefinedcellFormatLocaleProvider: ICellFormatLocaleProvider
propertynodeFactory readonly nodeFactory: SheetNodeFactorypropertyrendererRegistry readonly rendererRegistry: SheetRendererRegistry<CellProperties>propertysymbolstatic readonly symbol: symbolDI token for resolving SheetRenderCoordinatorManager.
methodcreate create<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Cell<T> | undefinedCreates the value.
data: TpositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
methodcreateCellContext createCellContext(row?: number, col?: number): CellContextBuilds the explicit, read-only context shared by render and measurement paths.
row: numbercol: number
methodregisterCell registerCell<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): voidRegisters a cell constructor and its default
Cell.render()adapter together.type: string | symbolctor: (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>[]): (): voidRegisters the renderer.
type: T["type"]renderer: <U>(cell: Cell<U>): Node<CellProperties> | Node<CellProperties>[]
methodregisterStoredValueValidator registerStoredValueValidator(type: string | symbol, validator: (cell: CellProperties): boolean): (): voidRegisters the stored value validator.
type: string | symbolvalidator: (cell: CellProperties): boolean
methodregisterType registerType<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): voidRegisters the type.
type: string | symbolctor: (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: TpositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
- classSheetRendererRegistrysource ↗
-
class SheetRendererRegistry<RegistryProperties> extends RendererRegistry<RegistryProperties>Renderer registry for sheet cell instances.
constructorconstructor SheetRendererRegistry<RegistryProperties>(): SheetRendererRegistry<RegistryProperties>propertysymbolstaticinherited readonly symbol: symbolDI token for resolving the active renderer registry.
methodregisterRenderer registerRenderer(type: string | symbol, rendererFn: <T>(input: Cell<T>): Node<RegistryProperties> | Node<RegistryProperties>[]): (): voidRegisters 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): StringCellCreates a Cell instance.
data: CellPropertiespositionRect: PositionRectPropsproperties: CellPropertiescontext: CellContext
propertycontextinherited readonly context: CellContextpropertydatainherited readonly data: CellPropertiespropertypositionRectinherited readonly positionRect: PositionRectPropspropertypropertiesinherited readonly properties: CellPropertiespropertysymbolstatic readonly symbol: symbolBuilt-in string cell type symbol.
methodgetDisplayText getDisplayText(): stringReturns 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 CellContextCell 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?: CellFormatLocaleSheet-local defaults for formatting numbers and date/time serials.
propertycol col?: numberCurrent cell column index (0-based); optional for non-grid cells.
propertyformulaResultProvider formulaResultProvider?: IFormulaResultProviderRead-only access to derived formula results; optional when formulas are disabled.
propertyrow row?: numberCurrent cell row index (0-based); optional for non-grid cells.
- interfaceSheetCellConditionalVisualsource ↗
-
interface SheetCellConditionalVisualOne matched conditional rule; higher priority wins for overlapping properties and layer slots.
propertyid readonly id: stringpropertylayers readonly layers?: readonly CellVisualLayer[]propertypriority readonly priority: numberpropertyproperties readonly properties?: Readonly<Partial<CellProperties>> - interfaceSheetCellConditionalVisualReadersource ↗
-
interface SheetCellConditionalVisualReaderpropertyid readonly id: stringpropertyproperties readonly properties: readonly "value" | "type" | unknown | "region" | "format" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]methodread read(position: SheetCellVisualReadPosition): readonly SheetCellConditionalVisual[]position: SheetCellVisualReadPosition
methodreadHighestPriority readHighestPriority(): numberReads the owner's current rule order after staged transactions commit.
- interfaceSheetCellVisualOverridesource ↗
-
interface SheetCellVisualOverride extends SheetCellVisualReaderConditional 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: stringpropertypriority readonly priority: numberpropertypropertiesinherited readonly properties: readonly "value" | "type" | unknown | "region" | "format" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]methodreadinherited read(position: SheetCellVisualReadPosition): Readonly<Partial<CellProperties>>position: SheetCellVisualReadPosition
- interfaceSheetCellVisualReadersource ↗
-
interface SheetCellVisualReaderPlugin-owned reader declaring exclusive ownership of base visual properties.
propertyid readonly id: stringpropertyproperties readonly properties: readonly "value" | "type" | unknown | "region" | "format" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]methodread read(position: SheetCellVisualReadPosition): Readonly<Partial<CellProperties>>position: SheetCellVisualReadPosition
- interfaceSheetCellVisualReaderRegistrationContextsource ↗
-
interface SheetCellVisualReaderRegistrationContextMinimal configuration access available while plugins register visual readers.
methodreadDefaultConfig readDefaultConfig(): Readonly<Record<string, unknown>> - interfaceSheetCellVisualReadPositionsource ↗
-
interface SheetCellVisualReadPositionCoordinates supplied to one visual reader for a rendered Sheet cell.
propertycolumnIndex readonly columnIndex: numberpropertyrowIndex 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 = CellVisualLayerA 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): stringExtracts plain text from persisted rich-text content.
value: unknown
- functionformatFormulaValuesource ↗
-
formatFormulaValue(value: unknown): stringFormats formula results consistently for rendering and measurement.
value: unknown
- interfaceIFormulaResultProvidersource ↗
-
interface IFormulaResultProviderRead-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): voidVisits 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: numberstartColumn: numberendRow: numberendColumn: numbervisit: (row: number, column: number): void
methodgetFormulaResult getFormulaResult(row: number, col: number): FormulaValue | undefinedGets 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
Logical scrolling, axis locking, boundary feedback, and host scroller adapters.
- classHeadlessScrollersource ↗
-
class HeadlessScroller extends ScrollerScroller adapter for hosts that have no native scroll surface.
constructorconstructor HeadlessScroller(): HeadlessScrollerConstructs a scroller adapter.
propertyconfigEngineinherited readonly configEngine: ConfigEngineConfiguration engine available to concrete scroller adapters.
propertyContainerSymbolstaticinherited readonly ContainerSymbol: symbolDI token used by hosts that provide a scroller container.
propertysymbolstatic readonly symbol: symbolDI token for resolving HeadlessScroller.
methodgetPublisher getPublisher(): ScrollPublisherReturns the publisher.
- classRubberBandConfigErrorsource ↗
-
class RubberBandConfigError extends SearErrorStable public error raised for invalid rubber-band physics configuration.
constructorconstructor RubberBandConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): RubberBandConfigErrorCreates a SearError instance.
message: stringdetails: SearErrorDetailsoptions: ErrorOptions
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_SCROLL_INVALID_RUBBER_BAND_CONFIG"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classRubberBandControllersource ↗
-
class RubberBandControllerPlatform-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): RubberBandControllerCreates one controller and publishes every visual displacement change.
platform: PlatformpublishOffset: (offset: RubberBandOffset): void
methodconfigure configure(config: Partial<RubberBandConfig>): voidApplies validated host overrides and resets immediately when disabled.
config: Partial<RubberBandConfig>
methodconsume consume(input: RubberBandInput): RubberBandOffsetConsumes 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(): RubberBandOffsetReturns a copy of the current transient visual displacement.
methodrelease release(delay?: number, preserveVelocity?: boolean): voidStarts the boundary return after the configured input-settle delay.
delay: numberpreserveVelocity: boolean
methodreset reset(): voidCancels pending work and restores the exact zero-displacement state.
- classScrollAxisLocksource ↗
-
class ScrollAxisLockLocks a continuous input gesture to its first dominant axis.
constructorconstructor ScrollAxisLock(): ScrollAxisLockmethodconfigure configure(config: Partial<ScrollAxisLockConfig>): voidApplies 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: numbery: number
methodgetAxis getAxis(): ScrollAxis | nullReturns the currently selected axis, or null before activation.
methodgetWheelEndDelay getWheelEndDelay(): numberReturns the configured wheel gesture-end delay.
methodreset reset(): voidEnds the current gesture and clears uncommitted sub-threshold input.
- classScrollAxisLockConfigErrorsource ↗
-
class ScrollAxisLockConfigError extends SearErrorStable public error raised for invalid scroll-axis lock configuration.
constructorconstructor ScrollAxisLockConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): ScrollAxisLockConfigErrorCreates a SearError instance.
message: stringdetails: SearErrorDetailsoptions: ErrorOptions
propertycauseinherited cause?: unknownpropertycode readonly code: "SEAR_SCROLL_INVALID_AXIS_LOCK_CONFIG"Stable machine-readable identifier for this error category.
propertydetailsinherited readonly details: SearErrorDetailspropertymessageinherited message: stringpropertynameinherited name: stringpropertystackinherited stack?: stringpropertystackTraceLimitstaticinherited stackTraceLimit: numberThe
Error.stackTraceLimitproperty specifies the number of stack frames
collected by a stack trace (whether generated bynew Error().stackorError.captureStackTrace(obj)).
The default value is10but 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(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keepsthrow new SearError(...).report()ergonomic.methodcaptureStackTracestaticinherited captureStackTrace(targetObject: object, constructorOpt?: Function): voidcaptureStackTrace(targetObject: object, constructorOpt?: Function): voidCreates a
.stackproperty ontargetObject, which when accessed returns
a string representing the location in the code at whichError.captureStackTrace()was called.
``jsnew Error().stack
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to`${myObject.name}: ${myObject.message}
The first line of the trace will be prefixed with.constructorOpt
The optionalargument accepts a function. If given, all framesconstructorOpt
above, includingconstructorOpt, will be omitted from theconstructorOpt
generated stack trace.
Theargument 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: objectconstructorOpt: Function
methodprepareStackTracestaticinherited prepareStackTrace(err: Error, stackTraces: CallSite[]): anyprepareStackTrace(err: Error, stackTraces: CallSite[]): anyerr: ErrorstackTraces: CallSite[]
- classScrollersource ↗
-
class ScrollerBase class for host scroll adapters.
Concrete scrollers own platform scroll surfaces while ScrollManager owns the
platform-neutral viewport state.constructorconstructor Scroller(): ScrollerConstructs a scroller adapter.
propertyconfigEngine readonly configEngine: ConfigEngineConfiguration engine available to concrete scroller adapters.
propertyContainerSymbolstatic readonly ContainerSymbol: symbolDI token used by hosts that provide a scroller container.
propertysymbolstatic readonly symbol: symbolDI token for resolving the active scroller adapter.
- classScrollerFactorysource ↗
-
class ScrollerFactoryFactory registry for host scroller adapters.
constructorconstructor ScrollerFactory(): ScrollerFactorymethodcreateScrollerstatic createScroller(type: string | symbol, args: unknown): ScrollerCreates 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): voidRegisters a scroller creator.
type: string | symbol- Scroller type key.
scrollerCreator: (args: unknown): Scroller- Factory invoked by createScroller().
- classScrollManagersource ↗
-
class ScrollManagerOwns viewport scroll state and fans updates out to render subscribers.
constructorconstructor ScrollManager(width: number, height: number): ScrollManagerCreates a scroll manager for a viewport of the given dimensions.
width: numberheight: number
propertysymbolstatic readonly symbol: symbolDI token for resolving the scroll manager.
methodaddPublisher addPublisher(publisher: ScrollPublisher): (): voidConnects a scroll-event source and returns an idempotent disposer.
publisher: ScrollPublisher
methodapplyInputScroll applyInputScroll(state: ScrollManagerState): voidApplies platform scroll data within the owning editor's command.
state: ScrollManagerState
methoddestroy destroy(ownerToken?: object): voidDisconnects publishers and subscribers owned by this manager.
ownerToken: object
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean): voidCloses direct viewport writes after the owning editor finishes restoration.
isExecuting: (): boolean
methodenforceTeardownBoundary enforceTeardownBoundary(ownerToken: object): voidReserves 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 | nullReturns the previous committed scroll state.
methodgetRenderScrollState getRenderScrollState(): ScrollManagerStateReturns the scroll state that render strategies should use for viewport
copy planning.deltaXanddeltaYare computed from the last position marked as
rendered to the current committed position. This keeps wheel scrolling and
programmaticscrollTo()jumps on the same delta convention expected byRasterCopyPlan: previous minus current.methodgetShape getShape(): [number, number]Returns the viewport dimensions as
[width, height].methodgetState getState(): ScrollManagerStateReturns the current committed scroll state.
methodhasUnrenderedScroll hasUnrenderedScroll(): booleanReturns whether the current scroll position has not yet been rendered.
methodmarkScrollStateRendered markScrollStateRendered(): voidMarks the current committed scroll position as consumed by a render frame.
methodrequestScrollTo requestScrollTo(x: number, y: number): voidRequests an absolute scroll position through the owning editor.
x: numbery: number
methodresize resize(width: number, height: number): voidUpdates viewport dimensions and clamps the current position without emitting a scroll render.
width: numberheight: number
methodscrollTo scrollTo(x: number, y: number): voidProgrammatically scroll to an absolute position, clamped to the content
boundary, and notify all subscribers so the render pipeline re-draws.x: numbery: number
methodsetContentBoundary setContentBoundary(maxWidth: number, maxHeight: number): voidSet 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): voidRoutes platform-originated viewport input through the host's action boundary.
executor: (state: ScrollManagerState): void
methodsetPosition setPosition(x: number, y: number): voidDirectly 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: numbery: number
methodsetScrollToExecutor setScrollToExecutor(executor: (x: number, y: number): void): voidBinds programmatic scroll requests to the owning editor's command bus.
executor: (x: number, y: number): void
methodsubscribeScroll subscribeScroll(callback: ScrollSubscriber, prepend?: boolean): (): voidSubscribes to scroll-state changes and returns an idempotent disposer.
prependis reserved for updates that must run before render strategies.callback: ScrollSubscriberprepend: boolean
- classWebScrollersource ↗
-
class WebScroller extends ScrollerAdapts a Web scroll surface to logical editor viewport coordinates.
constructorconstructor WebScroller(target: unknown, platform: Platform): WebScrollerCreates a WebScroller instance.
target: unknownplatform: Platform
propertyconfigEngineinherited readonly configEngine: ConfigEngineConfiguration engine available to concrete scroller adapters.
propertyContainerSymbolstaticinherited readonly ContainerSymbol: symbolDI token used by hosts that provide a scroller container.
propertysymbolstatic readonly symbol: symbolDI token for resolving WebScroller.
memberroot root: unknownmethodconfigureAxisLock configureAxisLock(config: Partial<ScrollAxisLockConfig>): voidEnables or tunes Safari-style dominant-axis locking for wheel and touch gestures.
config: Partial<ScrollAxisLockConfig>
methodconfigureRubberBand configureRubberBand(config: Partial<RubberBandConfig>): voidEnables 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): (): voidReturns the publisher.
- interfaceRubberBandConfigsource ↗
-
interface RubberBandConfigHost-tunable parameters for Safari-style boundary resistance and return motion.
propertyenabled enabled: booleanpropertymaxOffset maxOffset: numberSmooth asymptotic maximum visual displacement in viewport pixels.
propertyresistance resistance: numberInitial slope of the rubber-band curve. Lower values reduce sensitivity.
propertyreturnDelay returnDelay: numberDefault delay used when release is called without an explicit delay.
propertyspringDamping springDamping: numberViscous damping used by the damped harmonic return motion.
propertyspringMass springMass: numberSpring mass used by the damped harmonic return motion.
propertyspringStiffness springStiffness: numberSpring stiffness used by the damped harmonic return motion.
- interfaceRubberBandInputsource ↗
-
interface RubberBandInputOne logical input sample consumed by RubberBandController.
propertyboundary readonly boundary: RubberBandOffsetpropertycontinueReturnOnOutwardInput readonly continueReturnOnOutwardInput?: booleanKeeps an already scheduled return alive for same-direction wheel inertia.
propertydisplacement readonly displacement: RubberBandOffsetContent displacement: positive values move the visible surface right/down.
propertyposition readonly position: RubberBandOffsetpropertyviewport readonly viewport: RubberBandOffset - interfaceRubberBandOffsetsource ↗
-
interface RubberBandOffsetTransient visual displacement in viewport pixels.
- interfaceScrollAxisLockConfigsource ↗
-
interface ScrollAxisLockConfigHost-tunable direction-lock parameters for DOM scrolling gestures.
propertyactivationThreshold activationThreshold: numberAccumulated pixels required before selecting the dominant axis.
propertyenabled enabled: booleanpropertywheelEndDelay wheelEndDelay: numberWheel silence in milliseconds that separates two gestures.
- interfaceScrollManagerStatesource ↗
-
interface ScrollManagerStateScroll offset snapshot published to render and coordinate subscribers.
propertydeltaX deltaX: numberHorizontal input delta that produced the update.
propertydeltaY deltaY: numberVertical input delta that produced the update.
propertyx x: numberCurrent horizontal scroll offset in world coordinates.
propertyy y: numberCurrent 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): (): voidPlatform adapter that connects a scroll event source to ScrollManager.
- functioncreateDefaultScrollManagerStatesource ↗
-
createDefaultScrollManagerState(): ScrollManagerStateCreates the default zero-offset scroll state.
- functionrubberBandDistancesource ↗
-
rubberBandDistance(excess: number, viewport: number, resistance?: number, maxOffset?: number): numberSafari-like rubber-band mapping with a smooth maximum visual displacement.
excess: numberviewport: numberresistance: numbermaxOffset: number
Package
@searsuite/sear-render-strategy
Full, dirty-region, retained, and incremental rendering policies.
- classBlockRasterCopyPlansource ↗
-
class BlockRasterCopyPlanRaster-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>[]): BlockRasterCopyPlanviewport: PositionRectPropsclearViewportRects: 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: PositionRectPropsmethodfromLayoutShiftstatic fromLayoutShift(input: BlockRasterCopyPlanInput): BlockRasterCopyPlan | nullinput: 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(): voidClears 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: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContextinherited readonly hitRenderContext: RenderContextpropertyoffScreenRenderContextinherited readonly offScreenRenderContext: RenderContextpropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertystageinherited readonly stage: SceneGraph<NodeTypeProperties>propertytreeinherited readonly tree: Tree<PositionRect<templateLiteral>>propertysymbolstatic readonly symbol: typeof symbolDI token for resolving DirtyRenderStrategy.
methodgetContext getContext(): RenderContextReturns 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: numbery: 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>): voidRedraws 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: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContextinherited readonly hitRenderContext: RenderContextpropertyoffScreenRenderContextinherited readonly offScreenRenderContext: RenderContextpropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertystageinherited readonly stage: SceneGraph<NodeTypeProperties>propertytreeinherited readonly tree: Tree<PositionRect<templateLiteral>>propertysymbolstatic readonly symbol: typeof symbolDI token for resolving EventRenderStrategy.
methodgetContext getContext(): RenderContextReturns 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: numbery: 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>): voidExecutes 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: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTrackerplatform: Platform
propertydirtyTreeinherited readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContextinherited readonly hitRenderContext: RenderContextpropertyoffScreenRenderContextinherited readonly offScreenRenderContext: RenderContextpropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertystageinherited readonly stage: SceneGraph<NodeTypeProperties>propertytreeinherited readonly tree: Tree<PositionRect<templateLiteral>>propertysymbolstatic readonly symbol: typeof symbolDI token for resolving HitRenderStrategy.
methoddebouncedRender debouncedRender(node: Node<NodeTypeProperties>): voidActually performs the hit-canvas rendering after debounce.
node: Node<NodeTypeProperties>- Node to render
methoddestroy destroy(): voidCancels deferred hit-layer work when the owning editor is destroyed.
methodflushPendingScrollRender flushPendingScrollRender(): voidEnsures 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(): RenderContextGet 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): voidDebounced 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>): voidRender 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>): voidSchedules 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 IncrementalRenderPolicyDecides whether an incremental render candidate is worth using for the next frame.
constructorconstructor IncrementalRenderPolicy(): IncrementalRenderPolicypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving IncrementalRenderPolicy.
methodevaluate evaluate(candidate: IncrementalRenderCandidate, limits?: IncrementalRenderPolicyLimits): IncrementalRenderDecisioncandidate: IncrementalRenderCandidatelimits: 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 withisEditafter 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: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContextinherited readonly hitRenderContext: RenderContextpropertyoffScreenRenderContextinherited readonly offScreenRenderContext: RenderContextpropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertystageinherited readonly stage: SceneGraph<NodeTypeProperties>propertytreeinherited readonly tree: Tree<PositionRect<templateLiteral>>propertysymbolstatic readonly symbol: typeof symbolDI token for resolving OverlayRenderStrategy.
methodgetContext getContext(): RenderContextReturns the context.
methodgetNodeByCoordinates getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Returns the node by coordinates.
node: Node<NodeTypeProperties>x: numbery: 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>): voidRenders OverlayRenderStrategy scene output.
node: Node<NodeTypeProperties>
- classRasterCopyExecutorsource ↗
-
class RasterCopyExecutorExecutes 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(): RasterCopyExecutorpropertysymbolstatic readonly symbol: typeof symbolDI token for resolving RasterCopyExecutor.
methodcopy copy(source: RenderContext, destination: RenderContext, copy: RasterCopyRect): voidCopies 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): voidCopies 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 RasterCopyPlanImmutable 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): RasterCopyPlanCreates 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: RasterCopyRectCopy from the cached frame into the visible target.
propertyviewport readonly viewport: PositionRect<templateLiteral>Viewport rectangle in viewport coordinates.
propertyviewportToCacheCopy readonly viewportToCacheCopy: RasterCopyRectCopy from the visible target back into the cache.
methodcreateViewportToCacheCopystatic createViewportToCacheCopy(viewport: PositionRectProps): RasterCopyRectCreates 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): RasterCopyPlanBuilds the scroll-copy plan used by Canvas viewport renderers.
The delta convention followsRenderStrategy:deltais previous minus
current, whiledrawImagesource 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: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<T>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertydirtyTree readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContext readonly hitRenderContext: RenderContextpropertyoffScreenRenderContext readonly offScreenRenderContext: RenderContextpropertyrenderContext readonly renderContext: RenderContextpropertyrenderCoordinatorManager readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManager readonly scrollManager: ScrollManagerpropertystage readonly stage: SceneGraph<T>propertytree readonly tree: Tree<PositionRect<templateLiteral>>methodgetContext getContext(): RenderContextReturns 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: numbery: 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>): voidRenders 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: symbolDI token for resolving RenderStrategyManager.
methodaddStrategy addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidRegisters or replaces a strategy under the provided key.
name: string | Symbolstrategy: RenderStrategy<NodeTypeProperties>
methodaddStrategyAfter addStrategyAfter(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately after an existing strategy.
reference: string | Symbolname: string | Symbolstrategy: RenderStrategy<NodeTypeProperties>
methodaddStrategyBefore addStrategyBefore(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately before an existing strategy.
reference: string | Symbolname: string | Symbolstrategy: RenderStrategy<NodeTypeProperties>
methodenforceCommandBoundary enforceCommandBoundary(isExecuting: (): boolean): voidCloses 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> | undefinedRetrieves a strategy by key.
name: string | Symbol
methodsetViewScale setViewScale(scale: number): voidPropagates 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: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTrackerrasterCopyExecutor: RasterCopyExecutor
propertydirtyTreeinherited readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContextinherited readonly hitRenderContext: RenderContextpropertyoffScreenRenderContextinherited readonly offScreenRenderContext: RenderContextpropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertystageinherited readonly stage: SceneGraph<NodeTypeProperties>propertytreeinherited readonly tree: Tree<PositionRect<templateLiteral>>propertysymbolstatic readonly symbol: typeof symbolDI token for resolving ScreenRenderStrategy.
methodconfigureRuntime configureRuntime(runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>): voidConfigures host-specific viewport, query, and drawing semantics.
runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>
methodgetContext getContext(): RenderContextReturns 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: numbery: 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>): voidRenders 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: RenderContextoffScreenRenderContext: RenderContexthitRenderContext: RenderContextscrollManager: ScrollManagerconfigEngine: ConfigEnginerenderCoordinatorManager: RenderCoordinatorManagerstage: SceneGraph<NodeTypeProperties>tree: Tree<PositionRect<templateLiteral>>dirtyTree: GenerationalDirtyTracker
propertydirtyTreeinherited readonly dirtyTree: GenerationalDirtyTrackerpropertyhitRenderContextinherited readonly hitRenderContext: RenderContextpropertyoffScreenRenderContextinherited readonly offScreenRenderContext: RenderContextpropertyrenderContextinherited readonly renderContext: RenderContextpropertyrenderCoordinatorManagerinherited readonly renderCoordinatorManager: RenderCoordinatorManagerpropertyscrollManagerinherited readonly scrollManager: ScrollManagerpropertystageinherited readonly stage: SceneGraph<NodeTypeProperties>propertytreeinherited readonly tree: Tree<PositionRect<templateLiteral>>propertysymbolstatic readonly symbol: typeof symbolDI token for resolving StickyRenderStrategy.
methodgetContext getContext(): RenderContextReturns 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: numbery: 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>): voidRenders 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 ViewportFrameCacheManages the off-screen viewport frame used by Canvas scroll optimization.
The cache wrapsRenderContext.isDrawnso 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): ViewportFrameCacheCreates 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): voidClears the cached viewport with an identity transform.
viewport: PositionRectProps- Viewport-space rectangle to erase from the cache.
methodinvalidate invalidate(): voidMarks the cached frame invalid so the next render performs a full prime.
methodisReady isReady(): booleanReturns whether the cache already contains a complete base frame.
methodmarkReady markReady(): voidMarks the cached frame ready after a complete frame has been copied in.
methodprimeFromVisibleFrame primeFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): voidPrimes 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): voidRefreshes 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 BlockRasterCopyCandidatepropertydestination readonly destination: PositionRectPropspropertysource readonly source: PositionRectProps - interfaceBlockRasterCopyPlanInputsource ↗
-
interface BlockRasterCopyPlanInputpropertyclearWorldRects 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 DirtyRegionBoundsBoundary represented by four world-space edges.
- interfaceDirtyRegionSourcesource ↗
-
interface DirtyRegionSource<T>Minimal dirty-region storage contract consumed by DirtyRegionCollector.
Sheet usesGenerationalDirtyTracker; 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(): voidClears 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 IncrementalRenderCandidateMeasured cost shape for one proposed incremental render frame.
propertycopiedArea readonly copiedArea: numberTotal destination pixel area copied from the retained/off-screen frame cache.
propertycopyCount readonly copyCount: numberNumber of raster copy rectangles in the candidate plan.
propertyinvalidArea readonly invalidArea: numberTotal world pixel area that still needs redraw after raster reuse.
propertyinvalidRectCount readonly invalidRectCount: numberNumber 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 - interfaceIncrementalRenderPolicyLimitssource ↗
-
interface IncrementalRenderPolicyLimitsGuardrails used to decide whether an incremental render plan is cheaper and safe enough to use.
propertymaxCopiedAreaRatio readonly maxCopiedAreaRatio: numberMaximum total copied pixel area divided by viewport area. Values above 1 allow overlapping or repeated copies.
propertymaxCopyCount readonly maxCopyCount: numberMaximum number of raster copy rectangles allowed in one frame.
propertymaxInvalidAreaRatio readonly maxInvalidAreaRatio: numberMaximum invalid redraw area divided by viewport area after raster copies have been applied.
propertymaxInvalidRectCount readonly maxInvalidRectCount: numberMaximum number of invalid redraw rectangles allowed in one frame.
- interfaceRasterCopyRectsource ↗
-
interface RasterCopyRectSource and destination rectangles for one raster copy.
propertydestination readonly destination: PositionRectPropsDestination pixels inside the destination render target, expressed in viewport coordinates.
propertysource readonly source: PositionRectPropsSource pixels inside the source render target, expressed in viewport coordinates.
- interfaceRenderContextCapabilitiessource ↗
-
interface RenderContextCapabilitiesCapability snapshot used by viewport render coordinators before choosing a raster strategy.
propertyrequiresExplicitNodeClear readonly requiresExplicitNodeClear: booleanpropertyrequiresFrameRebuild readonly requiresFrameRebuild: booleanpropertysupportsDirtyRedraw readonly supportsDirtyRedraw: boolean - interfaceScreenRenderStrategyRuntimesource ↗
-
interface ScreenRenderStrategyRuntime<NodeTypeProperties>propertyconsumeBlockRasterCopyPlan readonly consumeBlockRasterCopyPlan?: (): BlockRasterCopyPlan | nullConsumes 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> }): voidDraws already queried nodes into the visible render context.
propertyforceFullRepaint readonly forceFullRepaint?: (): booleanForces a full visible body repaint even when the off-screen cache is ready.
propertygetScrollState readonly getScrollState?: (): ScrollManagerStateReturns 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): booleanReturns whether the current scroll state requires a scroll-copy frame.
propertyonFrameRendered readonly onFrameRendered?: (mode: ScreenRenderFrameMode): voidCalled 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?: (): booleanReturns 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): voidcontext: RenderContextviewport: PositionRectProps
- functionclearViewportRectsource ↗
-
clearViewportRect(context: RenderContext, rect: PositionRectProps): voidcontext: RenderContextrect: PositionRectProps
- functioncreateViewportFrameCachesource ↗
-
createViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCachecacheContext: RenderContextcopyExecutor: RasterCopyExecutor
- functionreadRenderContextCapabilitiessource ↗
-
readRenderContextCapabilities(context: RenderContext): RenderContextCapabilitiescontext: RenderContext
- functionrequiresViewportExplicitNodeClearsource ↗
-
requiresViewportExplicitNodeClear(context: RenderContext): booleancontext: RenderContext
- functionrequiresViewportFrameRebuildsource ↗
-
requiresViewportFrameRebuild(context: RenderContext): booleancontext: RenderContext
- functionsupportsViewportDirtyRedrawsource ↗
-
supportsViewportDirtyRedraw(context: RenderContext): booleancontext: RenderContext
- functionworldRectToViewportClearRectsource ↗
-
worldRectToViewportClearRect<T>(rect: PositionRect<T>, scrollX: number, scrollY: number, padding: number): PositionRect<templateLiteral>rect: PositionRect<T>scrollX: numberscrollY: numberpadding: number
Package
@searsuite/sear-render
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): SheetCellMergeRendercellVisualReaders: SheetCellVisualReaderRegistry
propertydepth readonly depth: 1Draw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertypluginKeystatic readonly pluginKey: PluginKeypropertysymbolstatic readonly symbol: typeof symbolmemberkeyinherited key: unknownmethodapply 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 | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts 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(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDown onMouseDown(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): voidHandles the start of a pointer press sequence.
_searCore: SearCoreSheet_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseMove onMouseMove(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): voidHandles pointer movement over the host surface.
_searCore: SearCoreSheet_event: EventWithOffsetAndTarget<CellProperties>
methodonMouseUp onMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): voidHandles the end of a pointer press sequence.
_searCore: SearCoreSheet_event: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: 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: SearCoreSheetoffset: { x: number; y: number }
methodsealRuntimeMetadatainherited sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: object
- classSheetColumnLabelPluginsource ↗
-
class SheetColumnLabelPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetColumnLabel>Renders sticky column header cells for the visible viewport range.
constructorconstructor SheetColumnLabelPlugin(): SheetColumnLabelPluginConstructs the column header plugin.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether 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: symbolDI token for resolving the column header plugin.
memberkeyinherited key: unknownmethodapply apply(operations: Operation[]): ISheetColumnLabelReturns unchanged plugin state for every transaction.
operations: Operation[]
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts 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(): ISheetColumnLabelReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(): voidInitializes column header runtime state.
methodlockCommittedStateinherited lockCommittedState(state: ISheetColumnLabel): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: ISheetColumnLabel
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResize onResize(): voidColumn header dimensions are recomputed during render after resize.
methodonScroll onScroll(_scrollManagerState: ScrollManagerState): voidColumn header positions are recomputed during render from scroll state.
_scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: ISheetColumnLabeltransaction: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: ISheetColumnLabel, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: ISheetColumnLabelcommitToken: object
- classSheetCornerPluginsource ↗
-
class SheetCornerPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetCorner>Renders the sticky sheet corner cell where row and column headers meet.
constructorconstructor SheetCornerPlugin(): SheetCornerPluginConstructs the sheet corner plugin.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: symbolDI token for resolving the sheet corner plugin.
memberkeyinherited key: unknownmethodapply apply(operations: Operation[]): ISheetCornerReturns unchanged plugin state for every transaction.
operations: Operation[]
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts 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(): ISheetCornerReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(): voidInitializes sheet corner runtime state.
methodlockCommittedStateinherited lockCommittedState(state: ISheetCorner): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: ISheetCorner
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResize onResize(): voidSheet corner dimensions are recomputed during render after resize.
methodonScroll onScroll(_scrollManagerState: ScrollManagerState): voidSheet corner position is recomputed during render from scroll state.
_scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: ISheetCornertransaction: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: ISheetCorner, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: ISheetCornercommitToken: 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): SheetGridPluginConstructs the grid plugin from its child sheet render plugins.
sheetCornerPlugin: SheetCornerPluginsheetColumnLabelPlugin: SheetColumnLabelPluginsheetRowNumberPlugin: SheetRowNumberPluginsheetGridRender: SheetGridRender
propertydepthinherited readonly depth: numberDraw 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: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: symbolDI token for resolving the composite sheet grid plugin.
memberkeyinherited key: unknownmethodapply apply(pluginState: SheetGridState, transaction: Transaction): SheetGridState | nullKeeps composite state unchanged when data transactions cause a re-render.
pluginState: SheetGridStatetransaction: Transaction
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts state replacement to the owning editor's commit phase.
commitToken: object
methodgetPluginConfig getPluginConfig(searCore: SearCoreSheet): nullComposite grid configuration is delegated to child render plugins.
searCore: SearCoreSheet
methodgetStateinherited getState(): SheetGridStateReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: PluginStateType
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClick onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidForwards double-click handling to the body grid renderer.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: PluginStateTypetransaction: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: PluginStateType, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: PluginStateTypecommitToken: object
- classSheetGridRendersource ↗
-
class SheetGridRender extends Plugin<SearCoreSheet, CellProperties, ISheetGridRender>Renders visible sheet body cells.
constructorconstructor SheetGridRender(cellVisualReaders: SheetCellVisualReaderRegistry): SheetGridRenderConstructs the body grid renderer.
cellVisualReaders: SheetCellVisualReaderRegistry
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether PluginManager should warn when another ordered plugin shares this depth.
propertysymbolstatic readonly symbol: symbolDI token for resolving the body grid renderer.
memberkeyinherited key: unknownmethodapply apply(operations: Operation[]): ISheetGridRenderReturns unchanged renderer state for every operation list.
operations: Operation[]
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts 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(): ISheetGridRenderReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodlockCommittedStateinherited lockCommittedState(state: ISheetGridRender): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: ISheetGridRender
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClick onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidHandles double-click interactions on grid cells.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResizeinherited onResize(): voidOptional hook invoked when the host viewport or sheet dimensions change.
methodonScrollinherited onScroll(scrollManagerState: ScrollManagerState): voidReceives scroll state changes from the active scroll manager.
scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: ISheetGridRendertransaction: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: ISheetGridRender, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: ISheetGridRendercommitToken: object
- classSheetRowNumberPluginsource ↗
-
class SheetRowNumberPlugin extends Plugin<SearCoreSheet, CellProperties, ISheetRowNumber>Renders sticky row header cells for the visible viewport range.
constructorconstructor SheetRowNumberPlugin(): SheetRowNumberPluginConstructs the row header plugin.
propertydepthinherited readonly depth: numberDraw 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 callapplywhen 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 transactionspropertypluginKeyinherited pluginKey: PluginKeyStable plugin key used by PluginManager and SceneGraph ownership maps.
propertytransactionHistoryinherited readonly transactionHistory?: PluginTransactionHistoryAdapterOptional history behavior for transactions owned by this plugin.
propertytransactionOTinherited readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
propertywarnOnDuplicateDepthinherited readonly warnOnDuplicateDepth: booleanWhether 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: symbolDI token for resolving the row header plugin.
memberkeyinherited key: unknownmethodapply apply(operations: Operation[]): ISheetRowNumberReturns unchanged plugin state for every transaction.
operations: Operation[]
methoddirtyRectinherited dirtyRect(searCore: SearCoreSheet, transaction: Transaction): PositionRect<unknown> | null | undefinedOptional. Return the pixel-space dirty rectangle that needs to be
redrawn after this plugin processestransaction.
When implemented,SearCoreSheet.dispatchwill callmarkDirtywith
the returned rect and skip a full-canvas re-render for this plugin.
When omitted (or whennull/undefinedis returned), dispatch falls
back to a full render pass.searCore: SearCoreSheettransaction: Transaction
methodenforceRuntimeWriteBoundaryinherited enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
assertWrite: (): void
methodenforceStateWriteBoundaryinherited enforceStateWriteBoundary(commitToken: object): voidRestricts 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(): ISheetRowNumberReturns the plugin-owned state currently registered with the manager.
methodhasStateWriteBoundaryinherited hasStateWriteBoundary(): booleanReports whether the owning runtime has taken control of state replacement.
methodinitialize initialize(): voidInitializes row header runtime state.
methodlockCommittedStateinherited lockCommittedState(state: ISheetRowNumber): voidOptionally locks a committed plugin-owned local state value against retained handles.
state: ISheetRowNumber
methodonClickinherited onClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidPlugin pointer event handlers.
Return value contract:
- Returnfalseto stop subsequent plugins from handling the same event.
- Returntrue/undefined/voidto 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: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonDblClickinherited onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles a double-click pointer event.
earCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonInitialDataCellinherited onInitialDataCell(searCore: SearCoreSheet, cell: unknown, row: number, col: number): voidReceives 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: SearCoreSheetcell: unknownrow: numbercol: number
methodonInitialDataCompleteinherited onInitialDataComplete(searCore: SearCoreSheet): voidCalled after the final cell of the shared startup scan is delivered.
searCore: SearCoreSheet
methodonMouseDowninherited onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the start of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseMoveinherited onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles pointer movement over the host surface.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonMouseUpinherited onMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the end of a pointer press sequence.
searCore: SearCoreSheetevent: EventWithOffsetAndTarget<CellProperties>
methodonResize onResize(): voidRow header dimensions are recomputed during render after resize.
methodonScroll onScroll(_scrollManagerState: ScrollManagerState): voidRow header positions are recomputed during render from scroll state.
_scrollManagerState: ScrollManagerState
methodonTransactionCommittedinherited onTransactionCommitted(transaction: Transaction): voidRuns 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: ISheetRowNumbertransaction: 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(): voidFixes transaction and export metadata after the editor takes ownership.
methodsealRuntimeMethodsinherited sealRuntimeMethods(): voidPins transaction and render hooks after plugin startup.
methodsealRuntimeWritesinherited sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
methodsetStateinherited setState(state: ISheetRowNumber, commitToken?: object): voidReplaces the plugin-owned state after an apply or runtime transition.
state: ISheetRowNumbercommitToken: object
- interfaceSheetRangePositionContextsource ↗
-
interface SheetRangePositionContextExplicit layout inputs required to convert a sheet range to canvas coordinates.
propertycolumnSizes columnSizes: DimensionsCSRMatrixpropertyoffsetX offsetX: numberpropertyoffsetY offsetY: numberpropertyrowSizes rowSizes: DimensionsCSRMatrix - interfaceViewportRangesource ↗
-
interface ViewportRangeComputed 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). - 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 | nullrowSizes: DimensionsCSRMatrixscrollY: numberfrozenRows: numberoffsetY: number
- functioncomputeViewportRangesource ↗
-
computeViewportRange(scrollManager: ScrollManager, rowSizes: DimensionsCSRMatrix, columnSizes: DimensionsCSRMatrix, offset?: { x: number; y: number }): ViewportRangeCompute 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> | nullConverts 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: Pointend: Pointcontext: SheetRangePositionContext
Package
@searsuite/sear-sheet-editor-contract
Sheet-facing embedded rich-text editor contracts and test fakes without Doc-runtime dependencies.
- namespaceSheetEmbeddedEditorsource ↗
-
SheetEmbeddedEditor: unknownStatic DI token for the Sheet-facing editor abstraction.
variablesymbol symbol: symbol - classFakeSheetEmbeddedEditorsource ↗
-
class FakeSheetEmbeddedEditor extends SheetEmbeddedEditorSmall deterministic editor used by Sheet tests. It intentionally models only
the contract boundary, making no assumptions about a concrete Doc runtime.constructorconstructor FakeSheetEmbeddedEditor(): FakeSheetEmbeddedEditorpropertycancelCount cancelCount: numberpropertycommittedDocuments readonly committedDocuments: Schema[][]propertydisposeCount disposeCount: numberpropertyeditContexts readonly editContexts: SheetEmbeddedEditorContext[]propertyinitializeCount initializeCount: numberpropertyinputs readonly inputs: SheetEditInput[]propertyobservations readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
propertyrenderContexts readonly renderContexts: SheetEmbeddedEditorContext[]propertyrenderSessions readonly renderSessions: FakeRenderSession[]methodbindTeardownToken bindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
token: object
methodcreateEditSession createEditSession(context: SheetEmbeddedEditorContext): SheetEditSessioncontext: SheetEmbeddedEditorContext
methodcreateRenderSession createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSessioncontext: SheetEmbeddedEditorContext
methoddispose dispose(ownerToken?: object): voidownerToken: object
methodinitialize initialize(context: SheetEmbeddedEditorContext): voidcontext: SheetEmbeddedEditorContext
- interfaceSheetCompositionInputsource ↗
-
interface SheetCompositionInputIME composition lifecycle input delivered by the Sheet input adapter.
- interfaceSheetCompositionStatesource ↗
-
interface SheetCompositionStateCurrent IME composition state in editor-local coordinates.
- interfaceSheetCursorStatesource ↗
-
interface SheetCursorStateA cursor rectangle in editor-local coordinates.
- interfaceSheetDeleteInputsource ↗
-
interface SheetDeleteInputText deletion delivered by the Sheet input adapter.
- interfaceSheetDocumentAccessorsource ↗
-
interface SheetDocumentAccessorReads a cell document and commits a new document through the Sheet boundary.
- interfaceSheetEditorGeometrysource ↗
-
interface SheetEditorGeometryCell 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: SheetEditorRectpropertyclipRect readonly clipRect?: SheetEditorRectpropertycontainsPoint readonly containsPoint?: (point: SheetEditorPoint): booleanpropertytoLocalPoint readonly toLocalPoint: (point: SheetEditorPoint): SheetEditorPointpropertytoSheetPoint readonly toSheetPoint: (point: SheetEditorPoint): SheetEditorPoint - interfaceSheetEditorInvalidationsource ↗
-
interface SheetEditorInvalidationA rectangle or semantic reason that should be redrawn by Sheet.
- interfaceSheetEditorPointsource ↗
-
interface SheetEditorPointA point in Sheet or editor-local coordinates.
- interfaceSheetEditorRectsource ↗
-
interface SheetEditorRectA rectangle in Sheet or editor-local coordinates.
- interfaceSheetEditRenderOptionssource ↗
-
interface SheetEditRenderOptionsPer-frame options for painting an active Sheet edit session.
propertycursorVisible readonly cursorVisible?: booleanWhether the caret should be painted during this frame.
- interfaceSheetEditSessionsource ↗
-
interface SheetEditSessionAn active editing session for one Sheet cell document.
methodcancel cancel(): voidmethodcommit commit(): readonly Schema[]methoddispose dispose(): voidmethodgetComposition getComposition(): SheetCompositionState | nullmethodgetCursor getCursor(): SheetCursorState | nullmethodgetDocument getDocument(): readonly Schema[]methodgetSelection getSelection(): SheetTextSelection | nullmethodhandleInput handleInput(input: SheetEditInput): SheetRenderUpdateinput: SheetEditInput
methodhandlePointer handlePointer(input: SheetPointerInput): SheetRenderUpdateinput: SheetPointerInput
methodrender render(renderContext?: RenderContext, options?: SheetEditRenderOptions): SheetRenderUpdatePaints the current edited document, selection, cursor and composition.
renderContext: RenderContextoptions: SheetEditRenderOptions
methodsetInlineStyle setInlineStyle(update: SheetInlineStyleUpdate): SheetRenderUpdateupdate: SheetInlineStyleUpdate
methodsetSelection setSelection(selection: SheetTextSelection): SheetRenderUpdateselection: SheetTextSelection
- interfaceSheetEmbeddedEditorsource ↗
-
interface SheetEmbeddedEditorStable 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: ObservationRegistryTyped editor-local state and event observations exposed to the host.
methodbindTeardownToken bindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
token: object
methodcreateEditSession createEditSession(context: SheetEmbeddedEditorContext): SheetEditSessioncontext: SheetEmbeddedEditorContext
methodcreateRenderSession createRenderSession(context: SheetEmbeddedEditorContext): SheetRenderSessioncontext: SheetEmbeddedEditorContext
methoddispose dispose(ownerToken?: object): voidownerToken: object
methodinitialize initialize(context: SheetEmbeddedEditorContext): voidcontext: SheetEmbeddedEditorContext
- interfaceSheetEmbeddedEditorContextsource ↗
-
interface SheetEmbeddedEditorContextContext in which a Sheet cell editor renders and edits one cell document.
propertydefaultFontFamily readonly defaultFontFamily?: stringHost-selected default font family for read-only Sheet cell rendering.
propertydefaultFontSize readonly defaultFontSize?: numberHost-selected default font size for read-only Sheet cell rendering.
propertydocumentAccessor readonly documentAccessor: SheetDocumentAccessorpropertygeometry readonly geometry: SheetEditorGeometrypropertyinvalidate readonly invalidate?: (invalidation: SheetEditorInvalidation): voidpropertyisCommandExecuting readonly isCommandExecuting?: (): booleanPresent in assembled Sheets to require command dispatch for edit-session mutations.
propertyrenderContext readonly renderContext: RenderContext - interfaceSheetEmbeddedInlineStyleStatussource ↗
-
interface SheetEmbeddedInlineStyleStatusWhether one inline style can be applied, is active, and has a common value.
- interfaceSheetInlineStyleUpdatesource ↗
-
interface SheetInlineStyleUpdateAn inline style patch applied to the active text selection.
propertyattrs readonly attrs: Readonly<Record<string, unknown>> - interfaceSheetInputModifierssource ↗
-
interface SheetInputModifiersModifier keys normalized by the Sheet host.
- interfaceSheetKeyInputsource ↗
-
interface SheetKeyInput extends SheetInputModifiersKeyboard input that the embedded editor may consume for navigation or editing.
propertyaltKeyinherited readonly altKey?: booleanpropertycode readonly code?: stringpropertyctrlKeyinherited readonly ctrlKey?: booleanpropertykey readonly key: stringpropertymetaKeyinherited readonly metaKey?: booleanpropertyshiftKeyinherited readonly shiftKey?: booleanpropertytype readonly type: "keyDown" - interfaceSheetPointerHitsource ↗
-
interface SheetPointerHitResult of pointer hit testing against the embedded document.
- interfaceSheetPointerInputsource ↗
-
interface SheetPointerInput extends SheetInputModifiersPointer input normalized by the Sheet host.
propertyaltKeyinherited readonly altKey?: booleanpropertybuttons readonly buttons?: numberpropertyclickCount readonly clickCount?: numberpropertyctrlKeyinherited readonly ctrlKey?: booleanpropertymetaKeyinherited readonly metaKey?: booleanpropertypoint readonly point: SheetEditorPointpropertyshiftKeyinherited readonly shiftKey?: booleanpropertytype readonly type: "pointerDown" | "pointerMove" | "pointerUp" - interfaceSheetRenderSessionsource ↗
-
interface SheetRenderSessionA retained render session for one Sheet cell document.
- interfaceSheetRenderUpdatesource ↗
-
interface SheetRenderUpdateState returned after a render or edit operation.
propertycomposition readonly composition?: SheetCompositionStatepropertycontentSize readonly contentSize?: { height: number; width: number }propertycursor readonly cursor?: SheetCursorStatepropertyinvalidation readonly invalidation?: SheetEditorInvalidationpropertyneedsRedraw readonly needsRedraw: booleanpropertyselection readonly selection?: SheetTextSelection - interfaceSheetTextInputsource ↗
-
interface SheetTextInputText insertion delivered by the Sheet input adapter.
- interfaceSheetTextPositionsource ↗
-
interface SheetTextPositionA position in the rich document represented by a node path and text offset.
- interfaceSheetTextSelectionsource ↗
-
interface SheetTextSelectionA text selection represented by anchor and head positions.
- typeSheetDocumentsource ↗
-
type SheetDocument = readonly SheetDocumentNode[]A rich-document snapshot owned by the Sheet cell boundary.
- typeSheetDocumentNodesource ↗
-
type SheetDocumentNode = SchemaA document node exchanged between a Sheet cell and an embedded editor.
- typeSheetEditInputsource ↗
-
type SheetEditInput = SheetTextInput | SheetDeleteInput | SheetCompositionInput | SheetKeyInputInput 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,boldorfontSize). 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.
No public exports match that search.