readonly contentSheetIds?: readonly string[]Sheet content restored with this entry; other sheet content stays current.
SearSuite separates editor assembly, document state, optional plugins, rendering, and host services. Start
with sear-assembly-setup to create an
editor. The sections below follow those boundaries; the guide explains how they
work together.
Run Sheet and Doc commands and build the transactions they commit.
interface SheetEditor extends SheetCommandClientHost-facing Sheet business client, independent of its presentation and assembly.
readonly services: RuntimeCapabilityReaderReads explicitly published editor-owned capabilities.
destroy(): voidReleases the runtime and all owned subscriptions.
class SheetPlugin<State> extends Plugin<State>, PluginExtension<SheetCommandBus, ObservationRegistry, SessionStateRegistry, SheetRuntimeExtensionRegistry, SheetQueryRegistry>Sheet business extension independent of Core, input adapters and presentation.
SheetPlugin<State>(__namedParameters: PluginSpec<State>): SheetPlugin<State>Creates a plugin with its stable identity and initial state.
configure(context: SheetPluginSetupContext): voidConnects editor-local capabilities during assembly before startup.
initialize(context: SheetPluginRuntimeContext): voidCompletes setup after command, query and observation registrations are available.
onEditorDestroy(context: SheetPluginRuntimeContext): voidReleases state-owner subscriptions during editor teardown.
registerCapabilities(registry: SheetRuntimeExtensionRegistry): voidPublishes editor-local typed capabilities for other extensions.
registerCellStyles(registry: SheetCellStyleRegistry, defaults: SheetCellStyleDefaults): voidContributes semantic cell styles without supplying drawing nodes or native input.
registerClipboardTransfers(registry: SheetClipboardTransferRegistry): voidContributes feature-owned cell data to clipboard transfers.
registerCommands(commands: SheetCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
registerFormatTransfers(registry: SheetFormatTransferRegistry): voidContributes feature-owned formatting to copy, clear and paste operations.
registerObservations(observations: ObservationRegistry): voidRegisters state or event sources whose subscriptions are owned by this editor.
registerQueries(queries: SheetQueryRegistry): voidRegisters read-only projections without granting mutation authority to callers.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes atomic projections for cell-range moves.
registerSessionState(registry: SessionStateRegistry): voidRegisters detachable local session state separately from durable document content.
registerStructureMoves(registry: SheetStructureMoveRegistry): voidContributes projections for row and column structural changes.
start(context: SheetPluginRuntimeContext): voidStarts lifecycle-owned subscriptions after initialization succeeds.
static registerServices(context: SheetPluginServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
Inherited from Plugin.
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.
Inherited from RuntimeCapabilityRegistry.
Feature-owned, renderer-independent style projection.
registerCellStyles(registry: SheetCellStyleRegistry, defaults: SheetCellStyleDefaults): voidinterface SheetPluginImplementation<TPlugin>Injectable state-plugin implementation selected by an assembly.
SheetPluginImplementation(...args: never[]): TPluginreadonly symbol: symbolDependency injection token for this editor-local implementation.
registerServices(context: SheetPluginServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
interface SheetPluginRuntime extends SheetPluginSetupRuntimeNeutral runtime available after the command dispatcher has been bound.
readonly commands: SheetCommandBusThe owning typed dispatcher through which state mutations are executed.
Inherited from SheetPluginSetupRuntime.
interface SheetPluginRuntimeContext extends SheetPluginSetupContextInitialized context containing a bound dispatcher without exposing its executor.
readonly runtime: SheetPluginRuntimeCapabilities owned by the currently assembled editor instance.
Service registration performed by a plugin's composition root.
Configuration context containing neutral services only.
Editor-local dependency container available only during composition.
readonly runtime: SheetPluginSetupRuntimeCapabilities owned by the currently assembled editor instance.
State, command, query and service contracts available while an owner is configured.
readonly cells: { readonly catalog: CellTypeCatalog }Semantic cell types, validation, display text and clipboard behavior.
readonly config: ConfigEngineEditor-local defaults and configuration contributions.
readonly data: SheetDataEngineSparse Sheet state and neutral data-field projections.
readonly extensions: SheetRuntimeExtensionRegistryEditor-local registry of typed capabilities, without global mutable registrations.
readonly formula: {
readonly externalServices: IFormulaExternalServiceProvider;
readonly functions: IFunctionRegistry;
readonly results: SheetFormulaProviderRegistry<IFormulaResultProvider>;
readonly richResults: SheetFormulaProviderRegistry<IFormulaRichResultProvider>;
readonly sources: SheetFormulaProviderRegistry<IFormulaSourceProvider>;
readonly textServices: IFormulaTextServiceProvider;
readonly webService: WebServiceClient;
readonly xmlXPath: XmlXPathEvaluator;
}Formula functions, sources, results and external data capabilities.
readonly interaction: {
readonly pipelineSteps: PipelineStepExecutorRegistry;
readonly reducers: SheetInteractionReducerRegistry;
readonly store: SheetInteractionStore;
}Local interaction state and its command-owned reducers.
readonly observations: ObservationRegistryTyped state and event subscriptions; listeners receive no mutation authority.
Host-provided timing, scheduling and diagnostic operations.
readonly plugins: PluginManagerBusiness state owners registered in this editor instance.
readonly queries: SheetQueryRegistryRead-only typed queries over the latest committed state.
readonly session: SessionStateRegistryCapture and restoration registry for detachable local state.
readonly styles: SheetCellStyleReaderSemantic cell appearance shared by automation, filtering and views.
type SheetFormulaProviderRegistry = Provider & {
register(registration: {
readonly priority?: number;
readonly provider: Provider;
}): (): void;
}Neutral registration contract; concrete provider ordering belongs to the selected implementation.
Read-only view of editor-local runtime capabilities exposed to hosts.
defineSheetRuntimeCapability<T>(id: string): RuntimeCapability<T>Defines a typed runtime capability token.
ReturnsImmutable capability descriptor.
idStable capability id.
registerSheetPluginCapabilities(plugins: readonly unknown[], registry: SheetRuntimeExtensionRegistry): voidregisterSheetPluginCellStyles(plugins: readonly unknown[], registry: SheetCellStyleRegistry, defaults: SheetCellStyleDefaults): voidregisterSheetPluginCommands(plugins: readonly unknown[], commands: SheetCommandBus): voidregisterSheetPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): voidregisterSheetPluginQueries(plugins: readonly unknown[], queries: SheetQueryRegistry): voidregisterSheetPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): voidReadSheetCellStyleQuery: SheetQueryDefinition<readonly [number, number], Readonly<SheetCellStyle>>Reads composed semantic appearance without constructing a view.
readonly Cells: RuntimeCapability<{ readonly catalog: CellTypeCatalog }>readonly Commands: RuntimeCapability<SheetCommandBus>readonly Config: RuntimeCapability<ConfigEngine<any>>readonly Data: RuntimeCapability<SheetDataEngine>readonly Formula: RuntimeCapability<{
readonly externalServices: IFormulaExternalServiceProvider;
readonly functions: IFunctionRegistry;
readonly results: SheetFormulaProviderRegistry<IFormulaResultProvider>;
readonly richResults: SheetFormulaProviderRegistry<IFormulaRichResultProvider>;
readonly sources: SheetFormulaProviderRegistry<IFormulaSourceProvider>;
readonly textServices: IFormulaTextServiceProvider;
readonly webService: WebServiceClient;
readonly xmlXPath: XmlXPathEvaluator;
}>readonly Interaction: RuntimeCapability<{
readonly pipelineSteps: PipelineStepExecutorRegistry;
readonly reducers: SheetInteractionReducerRegistry;
readonly store: SheetInteractionStore;
}>readonly Observations: RuntimeCapability<ObservationRegistry>readonly Platform: RuntimeCapability<Platform>readonly Plugins: RuntimeCapability<PluginManager>readonly Queries: RuntimeCapability<SheetQueryRegistry>readonly Session: RuntimeCapability<SessionStateRegistry>readonly Styles: RuntimeCapability<SheetCellStyleReader>registerSheetDisplayedValueCommands(commands: SheetCommandBus, changes: SheetDisplayedValueChanges): voidPublishSheetDisplayedValueChangesCommand: SheetCommandDefinition<readonly SheetDisplayedValueCoordinate[], SheetCommandResult>Publishes derived display changes through the owning Sheet command bus.
A host or input handler requests a change by running a feature-owned command. The command definition identifies the operation; the registered handler builds the state owner's operations. The Sheet core stages those operations and commits them as one change. Rendering and observers then see the committed result rather than a partial step.
SheetCommandDispatcher and DocCommandBus are dispatch contracts, not alternate state stores. Use the typed
command exported by the feature that owns the behavior. For selection, SelectRangeCommand changes the selected
range and GetSelection reads it afterward.
Use when: changing editor state from application code or wiring a host event. Read-only questions belong to a query; ongoing notifications belong to observations. Neither should mutate committed state.
Per-editor entry point for typed document commands.
Features register a definition and a factory during editor setup. A host or
input handler calls run with that definition and typed input; the bus
creates the command, dispatches it, and emits started, completed, or failed
events. The bus must be bound to an editor context before commands can run.
DocCommandBus(platform?: Platform): DocCommandBusCreates a command bus that reports boundary diagnostics through the host platform.
bind(context: DocCommandContext): voidBinds the command bus to the runtime services for one editor instance.
destroy(): voidClears editor binding, listeners, and command registrations during teardown.
enforceRegistrationBoundary(assertWrite: (): void): voidCloses setup-time command registration after the editor is assembled.
getRegisteredCommandIds(): readonly string[]Returns a stable snapshot of all document commands exposed by this editor instance.
getRegisteredCommands(): readonly DocCommandDefinition<unknown, DocCommandResult>[]Returns the typed definitions registered on this editor instance.
has(definition: string | DocCommandDefinition<unknown, DocCommandResult>): booleanReturns whether this editor instance currently exposes a document command id.
isExecuting(): booleanWhether this editor's command bus is currently dispatching a command.
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.
run<Definition>(definition: Definition, input: DocCommandInput<Definition>): DocCommandDefinitionResult<Definition>Creates and executes the command registered for a typed definition.
ReturnsThe result returned by the command after its pipeline and effects run.
ThrowsSearError if the definition is unregistered, the bus is unbound, or the factory creates a command with a different id. Command failures propagate.
runWithoutMutationAuthority<Value>(callback: (): Value): ValueInvokes external observers without inheriting this editor's command write authority.
subscribe(listener: DocCommandListener): (): voidSubscribes to document command lifecycle events and returns an unsubscribe function.
static readonly symbol: typeof symbolDI token for resolving the command bus bound to one document editor instance.
Applies one document command result through an editor-supplied context.
It validates the command's result, delegates its pipeline to the document core, and applies local effects only after that call succeeds. The command bus handles registration and lifecycle notifications around this dispatch.
execute<Result>(context: DocCommandContext, command: DocEditorCommand<Result>): ResultRuns the command and applies its pipeline followed by its local effects.
ReturnsThe result produced by the command after the context calls finish.
ThrowsSearError if the command returns no result or no pipeline. Errors from command execution, the pipeline, or an effect propagate to the caller.
Optional consumers of command effects; a state-only host need not install a view.
DocCommandEffectRegistry(platform: Platform): DocCommandEffectRegistrydestroy(): voiddispatch(effect: DocCommandEffect): voidDelivers host effects after commit; consumer failures cannot undo committed state.
register<Kind>(kind: Kind, handle: (effect: Extract<{ readonly type: "focus-document" }, { type: Kind }> | Extract<{ readonly type: "reset-caret-blink" }, { type: Kind }>): void): (): voidstatic readonly symbol: typeof symbolThe only supported execution entry point for sheet user and program actions. Hosts bind it to one editor instance after the Core has been created.
SheetCommandBus(platform?: Platform): SheetCommandBusCreates a command bus that reports boundary diagnostics through the host platform.
bind(context: SheetCommandContext): voidBinds the command bus to the runtime services for one editor instance.
destroy(): voidClears editor binding, listeners and command registrations during teardown.
enforceRegistrationBoundary(assertWrite: (): void): voidCloses setup-time command registration after the editor is assembled.
getRegisteredCommandIds(): readonly string[]Returns a stable snapshot of all commands exposed by this editor instance.
getRegisteredCommands(): readonly SheetCommandDefinition<unknown, SheetCommandResult>[]Returns the typed definitions registered on this editor instance.
has(definition: string | SheetCommandDefinition<unknown, SheetCommandResult>): booleanReturns whether this editor instance currently exposes a command id.
isExecuting(): booleanWhether this editor's command bus is currently dispatching a command.
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.
run<Definition>(definition: Definition, input: SheetCommandInput<Definition>): SheetCommandDefinitionResult<Definition>Executes a registered command through its feature-owned typed definition.
runWithoutMutationAuthority<Value>(callback: (): Value): ValueInvokes external observers without inheriting this editor's command write authority.
subscribe(listener: SheetCommandListener): (): voidSubscribes to command lifecycle events and returns an unsubscribe function.
static readonly symbol: typeof symbolDI token for resolving the command bus bound to one editor instance.
Applies one Sheet command result through an editor-supplied context.
The dispatcher calls the command, checks that it returned a result with a pipeline, then runs that pipeline before its local effects. It does not own Sheet state; the context supplies the transaction boundary.
execute<Result>(context: SheetCommandContext, command: SheetCommand<Result>): ResultRuns the command and applies its pipeline followed by its local effects.
ReturnsThe result produced by the command after the context calls finish.
ThrowsSearError if the command returns no result or no pipeline. Errors from command execution, the pipeline, or an effect propagate to the caller.
Optional consumers of command effects; a state-only host need not install a view.
destroy(): voiddispatch(effect: SheetCommandEffect): voidDelivers host effects after commit; consumer failures cannot undo committed state.
register<Kind>(kind: Kind, handle: (effect: Extract<{
readonly anchor: readonly [number, number];
readonly focus: readonly [number, number];
readonly kind: "ensure-selection-visible";
}, { kind: Kind }> | Extract<{ readonly kind: "focus-editor" }, { kind: Kind }>): void): (): voidstatic readonly symbol: typeof symbolThe active document editor's execution boundary for a command result.
A document command prepares a pipeline and optional local effects. The dispatcher passes the pipeline here first, then applies effects after it returns. Implementations commit document state before rendering it.
applyEffect(effect: DocCommandEffect): voidApplies a local UI/runtime effect after the operation has been committed.
executePipeline(pipeline: Pipeline): voidExecutes command-owned work through the document core's shared pipeline boundary. Implementations commit document state before rendering.
interface DocCommandEvent extends CommandExecutionEventLifecycle event emitted by the document command bus for diagnostics and host UI.
readonly result?: DocCommandResultResult returned by a completed command.
Work produced by a document command for the editor to apply.
The pipeline carries document mutation and rendering work. Optional effects are local actions, such as moving focus or restarting the caret blink, and do not become document state.
readonly effects?: readonly DocCommandEffect[]Optional local effects requested after operation execution.
Command-owned pipeline containing mutation, render and local-action steps.
interface DocEditorCommand<Result>Executable unit behind a typed document command definition.
readonly id: stringStable, domain-owned command identifier for observability and automation.
execute(context: DocCommandContext): ResultRuns command logic and returns a pipeline-backed result.
interface SheetCommand<Result>Executable unit created from a feature-owned typed command definition.
Its execute method prepares a result; the dispatcher applies that result
through the editor context. The command does not commit state itself.
readonly id: stringStable, domain-owned command identifier for observability and automation.
execute(context: SheetCommandContext): ResultRuns command logic and returns a pipeline-backed result.
The command, query and subscription protocol of an independently owned Sheet.
readonly commands: SheetCommandBusreadonly observations: ObservationRegistryreadonly queries: SheetQueryRegistryThe active Sheet editor's execution boundary for a command result.
A command produces a pipeline and optional local effects. The dispatcher passes them to this context after the command has returned.
applyEffect(effect: SheetCommandEffect): voidApplies a local UI/runtime effect after pipeline execution.
executePipeline(pipeline: Pipeline): voidApplies the command-produced pipeline through the owning kernel transaction boundary.
interface SheetCommandEvent extends CommandExecutionEventLifecycle event emitted by the command bus for diagnostics and host UI.
readonly result?: SheetCommandResultResult returned by a completed command.
Work produced by a Sheet command for the editor to apply.
The pipeline carries the state and render work. Effects are local runtime actions such as focusing the editor or revealing the selection; they run only after the pipeline call succeeds.
readonly completion?: Promise<unknown>Optional asynchronous completion of a command-owned external effect.
readonly effects?: readonly SheetCommandEffect[]Optional local effects requested after pipeline execution.
readonly historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}Optional identifier for combining two committed commands into one undo entry.
Pipeline containing transaction, render, interaction and local-action steps.
Public string union for command lifecycle event phases.
| Member | Value |
|---|---|
Started |
"started" |
Completed |
"completed" |
Failed |
"failed" |
type DocCommandDefinition = CommandDefinition<"doc", Input, Result>Stable doc command identifier carrying its input and result contract.
type DocCommandDefinitionResult = conditionalExtracts the result contract from a typed document command definition.
type DocCommandEffect = { readonly type: "focus-document" } | { readonly type: "reset-caret-blink" }Local runtime effects that document commands can request outside document state.
type DocCommandFactory = (input: DocCommandInput<Definition>): DocEditorCommand<DocCommandDefinitionResult<Definition>>Factory installed by a document feature plugin to create a command from typed input.
type DocCommandInput = conditionalExtracts the input contract from a typed document command definition.
type DocCommandListener = (event: DocCommandEvent): voidObserver invoked when document command execution starts, completes, or fails.
type SheetCommandDefinition = CommandDefinition<"sheet", Input, Result>Stable sheet command identifier carrying its input and result contract.
type SheetCommandDefinitionResult = conditionalExtracts the result contract from a typed command definition.
type SheetCommandFactory = (input: SheetCommandInput<Definition>): SheetCommand<SheetCommandDefinitionResult<Definition>>Factory installed by a feature plugin to create a command from typed input.
type SheetCommandInput = conditionalExtracts the input contract from a typed command definition.
type SheetCommandListener = (event: SheetCommandEvent): voidObserver invoked when command execution starts, completes or fails.
type SheetCommandRangeDimensions = Pick<SheetRangeCommandDataSource, "getRowCount" | "getColumnCount">Current Sheet dimensions used to check command ranges.
defineDocCommand<Input, Result>(id: string): DocCommandDefinition<Input, Result>Creates an immutable, feature-owned document command contract.
defineSheetCommand<Input, Result>(id: string): SheetCommandDefinition<Input, Result>Creates an immutable, feature-owned command contract.
A command can stage several owner-specific operations in one pipeline. If preparation or staging fails, the transaction does not publish a partial document. Successful commits advance history and collaboration through the owning feature's adapters; local interaction and render updates follow the commit boundary.
Command definitions, transaction factories, and handlers work together: definitions provide typed inputs and results, handlers decide which operations to make, and state owners define how those operations change their own data. This is why an optional plugin can add a command without expanding a central command switch.
class EffectCommand extends SheetCommand<SheetCommandResult>Command that emits local effects without mutating OT state.
EffectCommand(effects: readonly SheetCommandEffect[]): EffectCommandCreates an effect-only command.
readonly id: "effect.apply"Stable id for effect-only command execution.
execute(_context: SheetCommandContext): SheetCommandResultReturns an empty pipeline plus the local effects to apply.
class LocalActionCommand extends SheetCommand<SheetCommandResult>Runs a local, command-owned action that does not produce an OT transaction.
LocalActionCommand(id: string, run: (): void): LocalActionCommandCreates a command that schedules one local action in a pipeline.
readonly id: stringStable, domain-owned command identifier for observability and automation.
execute(_context: SheetCommandContext): SheetCommandResultReturns a pipeline containing only the local action step.
class PipelineExecutionCommand extends SheetCommand<SheetCommandResult>Executes a complete, named pipeline through the command bus.
PipelineExecutionCommand(id: string, pipeline: Pipeline, historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}): PipelineExecutionCommandCreates a command around an existing named pipeline.
readonly id: stringStable, domain-owned command identifier for observability and automation.
execute(_context: SheetCommandContext): SheetCommandResultReturns the provided pipeline unchanged.
class TransactionPipelineCommand extends SheetCommand<SheetCommandResult>Executes an already-created transaction through the pipeline command boundary.
TransactionPipelineCommand(id: string, transaction: Transaction, historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}): TransactionPipelineCommandCreates a command around an existing transaction.
readonly id: stringStable, domain-owned command identifier for observability and automation.
execute(_context: SheetCommandContext): SheetCommandResultConverts the provided transaction into a pipeline result.
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.
Input required to extend a sheet selection by keyboard navigation.
readonly cursor: SelectionPointCurrent moving edge before this navigation step.
readonly direction: SelectionMoveDirectionDirection requested by the user.
readonly findMerge: (point: SelectionPoint): {
end: SelectionPoint;
start: SelectionPoint;
} | undefinedLookup for merged ranges that should be selected as a whole.
readonly jumpTarget?: SelectionPointData-aware destination resolved by the selection owner.
readonly jumpToEdge?: booleanWhether navigation should jump to the sheet edge.
readonly lastCol: numberLast valid column index.
readonly lastRow: numberLast valid row index.
readonly origin: SelectionPointFixed selection anchor where extension began.
readonly direction: SelectionMoveDirectionreadonly findMerge: (point: SheetPoint): SheetMergedCellRange | undefinedreadonly focus: SheetPointreadonly jumpToEdge?: booleanreadonly lastCol: numberreadonly lastRow: number| Member | Value |
|---|---|
Up |
"up" |
Down |
"down" |
Left |
"left" |
Right |
"right" |
extendSelection(input: ExtendSelectionCommandInput): {
readonly anchor: [number, number];
cursor: [number, number];
readonly focus: [number, number];
}Extends a selection by one keyboard navigation step.
ReturnsNormalized selection range and updated moving cursor.
inputCurrent selection extension state.
Resolves navigation as a sheet interaction, including merged-range boundaries.
Normalizes pointer or test-provided ranges so intersected merged cells are selected whole.
Insert, delete, and move commands create row or column operations that the editor can commit together.
class SheetAxisMoveBoundsError extends SearErrorA requested block or insertion boundary falls outside its axis.
SheetAxisMoveBoundsError(input: SheetMoveAxisInput, size: number): SheetAxisMoveBoundsErrorreadonly code: "SHEET_AXIS_MOVE_BOUNDS"Stable machine-readable identifier for this error category.
Public input for deleting columns starting at index.
Public input for deleting rows starting at index.
Public input for inserting columns before index.
readonly count?: numberreadonly historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}readonly index: numberPublic input for inserting rows before index.
readonly count?: numberreadonly historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}readonly index: numberMoves a contiguous block before a boundary in the original axis (0 through size).
interface SheetStructureCommandDataSource<Cell>Sheet matrix access used by structure commands without depending on a concrete data package.
getColumnCount(): numberCurrent column count.
getRowCount(): numberCurrent row count.
readColumn(index: number): Cell | null[]Reads a dense column payload for invertible column deletion.
readRow(index: number): Cell | null[]Reads a dense row payload for invertible row deletion.
createDeleteColumnOperations(input: SheetDeleteColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount" | "readColumn">): DeleteColOTOperation<unknown>[]Creates ColDelete operations from public command input, ordered from right to left.
createDeleteRowOperations(input: SheetDeleteRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount" | "readRow">): DeleteRowOTOperation<unknown>[]Creates RowDelete operations from public command input, ordered from bottom to top.
createInsertColumnOperations(input: SheetInsertColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount">): InsertColOTOperation<unknown>[]Creates ColInsert operations from public command input.
createInsertRowOperations(input: SheetInsertRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount">): InsertRowOTOperation<unknown>[]Creates RowInsert operations from public command input.
createMoveColumnsOperations(input: SheetMoveAxisInput, size: number): MoveColOTOperation<unknown>[]Creates column swaps implementing insertion at an original column boundary.
createMoveRowsOperations(input: SheetMoveAxisInput, size: number): MoveRowOTOperation<unknown>[]Creates row swaps implementing insertion at an original row boundary.
registerSheetStructureCommands(commands: SheetCommandBus, dataSource: SheetStructureCommandDataSource, moves?: SheetStructureMoveRegistry): voidRegisters the default sheet row/column structure commands.
Deletes one or more columns starting at the requested column index.
Deletes one or more rows starting at the requested row index.
Inserts one or more columns before the requested column index.
Inserts one or more rows before the requested row index.
Reorders complete columns without overwriting their neighbors.
Reorders complete rows without overwriting their neighbors.
interface SheetClearRangeContentsCommandDataSource<Cell>Sheet cell data required to create clear-contents operations.
getColumnCount(): numberCurrent column count.
getRowCount(): numberCurrent row count.
includeCell(row: number, column: number): booleanOptionally excludes cells from this clear operation.
readCell(row: number, column: number): Cell | nullReads the current cell value at row, column.
validateClearCell(row: number, column: number): {
readonly message?: string;
readonly reject: boolean;
}Optional protection check before clearing an occupied cell.
interface SheetClearRangeContentsInput extends SheetRangeInputPublic input for clearing persisted contents in a range.
Normalized rectangular sheet range bounds expressed as inclusive cell coordinates.
readonly end: SheetCellPointInclusive bottom-right cell coordinate.
readonly start: SheetCellPointInclusive top-left cell coordinate.
Common range input accepted by explicit range commands.
readonly anchor: SheetCellPointOne corner of the target range.
readonly focus: SheetCellPointOpposite corner of the target range.
type SheetCellPoint = readonly [number, number]A zero-based sheet cell coordinate expressed as [row, column].
Data source for the built-in clear-contents command.
createClearRangeContentsOperations<Cell>(input: SheetClearRangeContentsInput, dataSource: SheetClearRangeContentsCommandDataSource<Cell>): UpdateCellOTOperation<Cell>[]Creates UpdateCell operations that clear non-empty cells inside a range.
forEachSheetCommandCell(range: SheetRangeBounds, callback: (row: number, column: number): void): voidVisits every cell in a normalized inclusive range.
normalizeSheetCommandRange(input: SheetRangeInput, dimensions: SheetCommandRangeDimensions): SheetRangeBoundsNormalizes an inclusive range and validates both endpoints.
registerSheetRangeCommands(commands: SheetCommandBus, dataSource: SheetRangeCommandDataSource): voidRegisters the built-in range commands on one sheet command bus.
Clears persisted cell contents in an explicit rectangular range.
Queries read the current editor state through the command surface without committing a change.
class DocQueryRegistry extends QueryRegistryDocument-local typed query registry sharing the guarded read mechanism with Sheet.
static readonly symbol: symbolInherited from QueryRegistry.
Editor-local registry for typed, side-effect-free queries.
destroy(): voidenforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for registration changes after assembly.
getRegisteredQueryIds(): readonly string[]has(definition: string | QueryDefinition<unknown, unknown>): booleanregister<Definition>(definition: Definition, handler: QueryHandler<QueryInput<Definition>, QueryResult<Definition>>): (): voidrun<Definition>(definition: Definition, input: QueryInput<Definition>): QueryResult<Definition>static readonly symbol: symbolclass SheetQueryBus extends QueryRegistrySheet-local typed query registry with detached read results.
static readonly symbol: symbolInherited from QueryRegistry.
class SheetQueryRegistry extends QueryRegistrySheet-local typed query registry with detached read results.
static readonly symbol: symbolInherited from QueryRegistry.
interface DocQueryDefinition<Input, Result> extends QueryDefinition<Input, Result>Stable typed query contract owned by a document feature.
interface QueryDefinition<Input, Result>A stable query identifier carrying its input and result contract.
readonly __input?: Inputreadonly __result?: Resultreadonly id: stringreadonly resultMode?: "reader"Reader queries return a live, read-only projection instead of a data snapshot.
interface SheetQueryDefinition<Input, Result>A stable query identifier carrying its input and result contract.
readonly __input?: Inputreadonly __result?: Resultreadonly id: stringreadonly resultMode?: "reader"Reader queries return a live, read-only projection instead of a data snapshot.
type DocQueryInput = conditionaltype DocQueryResult = conditionaltype QueryInput = conditionaltype QueryResult = conditionaltype SheetQueryHandler = (input: Input): Resulttype SheetQueryInput = conditionaltype SheetQueryResult = conditionaltype QueryHandler = (input: Input): ResultdefineDocQuery<Input, Result>(id: string): DocQueryDefinition<Input, Result>Creates a document query returning a detached result.
defineQuery<Input, Result>(id: string): QueryDefinition<Input, Result>Creates an immutable, feature-owned query contract.
defineReaderQuery<Input, Result>(id: string): QueryDefinition<Input, Result>Defines a live reader whose methods own detached values at their read boundary.
defineSheetQuery<Input, Result>(id: string): SheetQueryDefinition<Input, Result>Creates an immutable, feature-owned query contract.
defineSheetReaderQuery<Input, Result>(id: string): SheetQueryDefinition<Input, Result>Defines a live reader whose methods own detached values at their read boundary.
Editor-local configuration storage, defaults, and typed configuration access.
Configuration owned by a standalone Doc editor.
readonly devicePixelRatio: numberreadonly docFontFamily: stringreadonly docFontSize: numberreadonly docLineHeightMultiplier: numberDefault paragraph line-height multiplier used by standalone Doc.
readonly docParagraphSpacingAfter: numberDefault paragraph spacing after each non-final block.
readonly docVerticalAlign: "top" | "center"Guardrails for accepting an incremental document render plan.
readonly maxCopiedAreaRatio: numberreadonly maxCopyCount: numberreadonly maxInvalidAreaRatio: numberreadonly maxInvalidRectCount: numberConfiguration owned by a standalone Sheet editor.
readonly cellPadding: numberreadonly defaultCellAlign: SheetHorizontalAlignmentreadonly defaultColumnSize: numberreadonly defaultRowSize: numberreadonly devicePixelRatio: numberreadonly sheetCellFontFamily: stringreadonly sheetCellFontSize: numberreadonly sheetOffsetX: numberreadonly sheetOffsetY: numbertype EditorDefaultConfigOverrides = Partial<TConfig> & Record<string, unknown>Host-provided overrides for one editor-owned configuration object.
Built-in defaults for standalone Doc editors.
Built-in defaults for ordinary Sheet cells and Sheet viewport services.
class ConfigEngine<TConfig>Registry and merger for one editor-owned configuration scope.
ConfigEngine<TConfig>(defaults?: TConfig, initialConfig?: EditorDefaultConfigOverrides<TConfig>): ConfigEngine<TConfig>Creates the engine for one composition-root-owned default configuration object.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidSeals retained configuration handles after editor initialization.
getCombinedConfig<T>(): ConfigUnit<T> & TGet merged config of all plugins
ReturnsMerged config
getConfig<T>(pluginKey: ConfigKey): ConfigUnit<T> & T | undefinedGet config of specified plugin
ReturnsPlugin configuration
pluginKeyStable key whose configuration should be returned.
getDefaultConfig(): TConfigReturns this editor's defaults merged with its host/runtime overrides.
registerConfig<T>(pluginKey: ConfigKey, pluginConfig: T): voidRegister plugin config
pluginKeyStable key that owns the configuration.
pluginConfigPlugin config
updateDefaultConfigOverrides(overrides: EditorDefaultConfigOverrides<TConfig>): voidMerges host/runtime default overrides into future default-config reads.
static readonly symbol: symbolDI token for resolving the shared configuration engine.
class ConfigUnit<T>Mutable configuration unit registered by a plugin or assembly module.
ConfigUnit<T>(initialConfig?: T): ConfigUnit<T>Creates a config unit by copying the provided initial values.
Visual Sheet sessions and the document input, layout and presentation runtime.
SheetKernel from sear-assembly-sheet-kernel owns Sheet state, transaction staging and commit publication.
SearCoreSheet attaches view extensions, native input and retained rendering to that independent kernel.
SearCoreDoc coordinates document input, layout and presentation. Hosts normally create these through editor
assemblies; business plugins receive neutral plugin and command contracts rather than a Core instance.
A command produces a Pipeline. The owning state runtime stages its transactions and interaction changes,
then publishes a successful commit. Independent visual subscribers read committed state to update the scene.
A failed staged step never publishes a partial document update.
Owns the visual Sheet session attached to an independent transactional kernel.
SearCoreSheet(stage: SceneGraph<CellProperties>, kernel: SheetKernel, render: SheetRenderEngine, events: EventEngine<CellProperties>, lifecycle: SheetLifecycleCoordinator, platform: Platform, views: ViewExtensionRegistry<SearCoreSheet, CellProperties>): SearCoreSheetreadonly configEngine: ConfigEnginereadonly dataEngine: SheetDataEnginereadonly eventEngine: EventEngine<CellProperties>readonly pluginManager: PluginManagerreadonly renderEngine: SheetRenderEnginebeginTeardown(token?: object): voidDetaches visual subscriptions before editor-owned view resources are released.
destroy(token?: object): voidReleases the visual subscriber and the kernel owned by this editor.
destroyView(token?: object): voidReleases native adapters and subscriptions while retaining the business runtime.
enforceCommandBoundary(isExecuting: (): boolean): voidInstalls the command authority shared by the kernel and its attached presentation.
enforceTeardownBoundary(token: object): voidReserves presentation and state teardown for the owning editor.
enforceViewTeardownBoundary(token: object): voidReserves view teardown without changing ownership of the attached business kernel.
executePipeline(pipeline: Pipeline): voidDispatches a typed command's pipeline to the state kernel.
Reads the latest state publication metadata.
Returns the Sheet data reader used by this view.
Reads committed state owned by the supplied identity.
Returns the renderer owned by this visual session.
Returns the retained scene graph.
Returns independently registered view extensions.
initialize(): voidInitializes the shared state kernel before attaching views and native events.
previewTransactionStates(transactions: readonly Transaction<Operation>[]): ReadonlyMap<PluginKey, unknown>Reads staged transaction results without publishing them.
refreshContentBoundary(): voidRecomputes logical viewport limits from committed dimensions.
refreshViewport(): voidRebuilds viewport-culled scene output.
requestRender(...views: Pick<ViewExtension<SearCoreSheet, CellProperties>, "key">[]): voidRequests a scene update without introducing a business plugin hook.
start(): voidStarts native adapters and presentation controllers.
subscribeCommits(listener: (snapshot: SheetCommitSnapshot): void): (): voidObserves committed state without receiving scene references.
static readonly symbol: typeof symbolSubscribes document presentation to an independent business runtime.
SearCoreDoc(blockManager: BlockManager, docCursorManager: DocCursorManager, docCompositionManager: DocCompositionManager, docLayoutEngine: DocLayoutEngine, kernel: DocKernel, runtimeLayers: SearCoreDocRuntimeLayers, views: ViewExtensionRegistry<SearCoreDoc, NodeProperties>): SearCoreDocconfigEngine: ConfigEngine<any> | nullConfiguration layer used by standalone document hosts when configured by assembly.
eventEngine: EventEngine<NodeProperties> | nullEvent pipeline and hit-testing facade used by standalone document hosts.
readonly pluginManager: PluginManagerPlugin manager for document runtime service plugins.
renderEngine: DocRenderEngine | nullRender engine used by standalone document hosts when configured by assembly.
renderStage: SceneGraph<NodeProperties> | nullScene graph used by standalone document rendering when configured by assembly.
bindDocRenderRequestHandler(handler: DocRenderRequestHandler): voidBinds the document render scheduler used by hosts that execute document commands.
clearDocRenderRequests(): voidClears diagnostic document render request history.
destroy(ownerToken?: object): voidDetaches the view subscriber before releasing its owned business runtime.
destroyView(ownerToken?: object): voidDetaches presentation while the independent document kernel remains alive.
enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidInstalls the same command authority in the independent business kernel and its view.
enforceTeardownBoundary(ownerToken: object): voidReserves presentation and kernel teardown for the owning editor.
enforceViewCommandBoundary(isCommandExecuting: (): boolean): voidProtects local presentation services without taking ownership of business commands.
enforceViewTeardownBoundary(ownerToken: object): voidReserves only the visual subscriber for its presentation owner.
executePipeline(pipeline: Pipeline): voidDelegates document commands to the independently owned business kernel.
getDocRenderLayoutState(): DocRenderLayoutState | nullReturns the layout state consumed by DocPlugin.render().
getDocRenderRequests(): readonly DocRenderRequest[]Returns a diagnostic snapshot of document render requests seen by this core.
getLayoutSnapshot(): LayoutSnapshot | nullReads the latest derived document layout.
Reads committed state from the document kernel.
getPluginInstance(pluginKey: PluginKey): Plugin<any> | undefinedGet a plugin instance by key (for calling plugin-specific methods).
Returns independent document presentation contributions.
initialize(): voidmaterializeSnapshot(snapshot: readonly Schema[]): RichDocNode[]Materializes detached layout input without owning document state.
Prepares presentation geometry from the business owner's document snapshot.
registerPlugin<T>(plugin: Plugin<T>): (): voidRegisters a state owner in the document kernel.
requestDocRender(pluginKey?: PluginKey): voidRequests view-only work without owning a business state transaction.
resolveCursorFromPoint(x: number, y: number, snapshot: LayoutSnapshot): DocCursorPosResolves presentation geometry into a semantic document cursor.
setDocRenderLayoutState(state: DocRenderLayoutState | null): voidSets the layout state consumed by DocPlugin.render().
start(): voidStarts standalone document runtime layers after initial plugin-node construction.
unregisterPlugin(pluginKey: PluginKey): voidRemoves a business state owner without changing independently registered views.
static readonly pluginManagerSymbol: symbolDI token for resolving the Doc-owned PluginManager without colliding with Sheet managers.
static readonly runtimeLayersSymbol: symbolDI token for resolving the Doc runtime layers owned by this Core instance.
static readonly symbol: symbolDI token for resolving SearCoreDoc.
Starts and disposes the runtime controllers owned by one sheet instance.
beginTeardown(token: object): voidPermits cleanup only for the owning editor.
destroy(): voidReleases resources owned by SheetLifecycleCoordinator.
enforceCommandBoundary(assertCommandWrite: (): void, teardownToken: object): voidCloses runtime registration after editor assembly.
register(controller: SheetLifecycleController): (): voidAdds a controller. Controllers registered after startup begin immediately, so applications can add lifecycle behavior without changing SearCoreSheet.
start(context: SheetLifecycleContext): voidStarts SheetLifecycleCoordinator.
static readonly symbol: typeof symbolDI token for resolving SheetLifecycleCoordinator.
Runtime layers owned by one SearCoreDoc instance.
readonly configEngine?: ConfigEngine<any> | nullConfiguration layer used by standalone document hosts.
readonly eventEngine?: EventEngine<NodeProperties> | nullEvent pipeline and hit-testing facade used by standalone document hosts.
readonly nodes?: DocNodeRegistryPlatform diagnostics adapter used by document core guard clauses.
readonly renderEngine?: DocRenderEngine | nullRender engine used by standalone document hosts.
readonly renderStage?: SceneGraph<NodeProperties> | nullScene graph used by standalone document rendering.
Shared context supplied to lifecycle controllers for one sheet instance.
readonly core: SearCoreSheetrefreshSheetBoundaries(): voidA startable and disposable runtime concern owned by a sheet instance.
destroy(): voidstart(context: SheetLifecycleContext): voidPipelineStepKind.Transaction stages an OT transaction for the document. Interaction changes editor-local
interaction state, while Invalidate marks derived projections for committed consumers. PreparedAction can roll back local
preparation if staging fails; PostCommit publishes local state only after the document commit succeeds.
Use the command layer to request an edit. Use these step contracts when implementing a command or plugin that contributes ordered work to the state runtime.
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)
📝 commit-cell-value → set R0C0 = {richtext}
✅ commit-cell-value
📝 exit-edit-mode → clear editor
✅ exit-edit-mode
🏁 Pipeline committed
This is the only place that touches console — the execution engine and caller code are fully decoupled from logging.
onComplete(_pipeline: Pipeline): voidHandles the complete lifecycle event.
Handles the start lifecycle event.
onStepComplete(step: PipelineStep, _pipeline: Pipeline): voidHandles the step complete lifecycle event.
onStepStart(step: PipelineStep, _pipeline: Pipeline, detail: string): voidHandles the step start lifecycle event.
class DocCompositionManager extends DocCompositionProviderOwns optional IME composition state independently from cursor and selection state.
DocCompositionManager(textShaper: TextShaper): DocCompositionManagerclear(teardownToken?: object): voidClears all composing state.
enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken?: object): voidCloses direct composition writes after editor assembly.
getCaretOffset(): numberReturns the logical caret offset inside the composing text.
getCaretPixelOffset(): numberReturns the latest measured caret pixel offset.
getFont(): stringReturns the font used to measure the current composition for painting.
getText(): stringReturns the current composing text.
measure(font?: string): DocCompositionLayoutMeasures current composing text and records the caret pixel offset for rendering.
setText(text: string, caretOffset?: number): voidUpdates the active composing text and logical caret offset.
static readonly symbol: symbolDI token for resolving DocCompositionManager.
Injectable singleton that bridges document input state and render-node drawing.
setCursor() before triggering a rerender.getCursor() and draw the cursor bar if set.clearCursor(teardownToken?: object): voidClear cursor and selection state (call on edit-session end).
enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken: object): voidSeals assembled cursor writes while preserving command-owned rendering.
getCursor(): CursorRenderInfo | nullRead the cursor render info. Returns null when no edit session is active.
Read the selection highlight rectangles.
setCursor(info: CursorRenderInfo): voidSet (or update) the cursor render info for the upcoming draw call.
setSelectionRects(rects: SelectionRect[]): voidSet selection highlight rectangles for the upcoming draw call.
static readonly symbol: symbolDI token for resolving DocCursorManager.
Derives layout, selection and caret geometry without constructing business state or plugins.
DocEditorLayout(blockManager: BlockManager, cursor: DocCursorManager, composition: DocCompositionManager, layout: DocLayoutEngine, nodes: DocNodeRegistry, onLayout?: (snapshot: LayoutSnapshot): void): DocEditorLayoutreadonly blockManager: BlockManagerdestroy(token?: object): voidenforceCommandBoundary(isExecuting: (): boolean): voidProtects derived view caches without granting business-state authority.
enforceTeardownBoundary(token: object): voidgetLayoutSnapshot(): LayoutSnapshot | nullReturns the latest document layout snapshot prepared by Core.
materializeSnapshot(snapshot: readonly Schema[]): RichDocNode[]Converts a shared snapshot into detached runtime nodes without changing Core state.
Prepares the current editable document frame through the Doc-owned layout path used by standalone document hosts and embedded editors.
resolveCursorFromPoint(x: number, y: number, snapshot: LayoutSnapshot): DocCursorPosResolves a point inside the editable document frame to the closest document cursor position.
Shared painter for embedded rich-document content and transient viewport output.
DocImmediateRenderPainter(cursorManager: DocCursorManager, scrollManager: ScrollManager, lineRenderer: RichTextLineRenderer, compositionManager?: DocCompositionManager | null): DocImmediateRenderPainterCreates a painter over the document cursor and scroll services.
drawContent(context: RenderContext, input: DocImmediateRenderPainterContentInput): voidDraws text lines from a layout snapshot in the caller's current transform.
drawSelectionRectsInViewport(context: RenderContext): voidDraws selection rectangles in viewport coordinates under an identity transform.
drawSelectionRectsInWorld(context: RenderContext): voidDraws selection rectangles using the caller's current world transform.
drawTextCursorOverlayInViewport(context: RenderContext): voidDraws IME composing text and caret in viewport coordinates.
class DocRenderEngine extends RenderEngine<NodeProperties>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.
DocRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, stage: SceneGraph<NodeProperties>, renderStrategyManager: RenderStrategyManager<NodeProperties>, screenRenderStrategy: ScreenRenderStrategy<NodeProperties>, dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>, stickyRenderStrategy: StickyRenderStrategy<NodeProperties>, overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>): DocRenderEnginegetLastScreenRenderMode(): ScreenRenderFrameMode | nullReturns the screen strategy mode used by the last render pass, if it painted.
initialize(): voidInitializes DocRenderEngine.
invalidateScreenCache(): voidInvalidates the off-screen body cache used by the screen strategy.
markDirty(rect: PositionRect<templateLiteral>): voidMarks one document-world rectangle dirty for the next dirty pass.
render(node: Node<NodeProperties>): voidRuns the configured document render strategies over the current scene graph.
resize(width: number, height: number, scale: number): voidResizes all Doc render layers and invalidates screen-cache reuse.
setBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): voidSupplies one layout-shift raster-copy plan for the next screen render pass.
setViewport(viewport: DocRenderViewport): voidUpdates the viewport model used by subsequent render frames.
setViewScale(scale: number): voidUpdates the view scale on every render strategy context.
static readonly symbol: symbolDI token for resolving DocRenderEngine.
Inherited from RenderEngine.
class NoopDocCompositionProvider extends DocCompositionProviderNull provider used when no composition plugin is installed.
measure(_font: string): DocCompositionLayoutMeasures no composing text.
Pre-computed pixel cursor state set by document layout before each render.
Layout contribution from an in-flight IME composition.
readonly active: booleanWhether there is active composing text to render.
readonly caretPixelOffset: numberPixel offset from the composing-text start to the IME caret.
readonly text: stringCurrent in-flight composing text.
readonly textWidth: numberFull composing text width in pixels.
Provider used by layout code to account for optional IME composition.
measure(font: string): DocCompositionLayoutMeasures the active composing text against the current render font.
Input used by SearCoreDoc to initialize one editable document frame.
readonly compositionFont?: stringResolved insertion font used by both IME measurement and its overlay.
readonly compositionProvider?: DocCompositionProviderOptional IME composition provider installed by a feature plugin or embedded host.
readonly cursorVisible?: booleanWhether the transient text cursor should be visible in this frame.
readonly document: RichDocNode[]Rich-document content to lay out and render.
readonly fitContentWidth?: booleanWhether the editable frame may grow horizontally to fit unwrapped content.
readonly font?: stringFont descriptor used by the text shaper for this layout.
readonly minContentWidth?: numberOptional minimum width needed to preserve pre-edit overflow sizing.
readonly minHeight: numberMinimum editor height supplied by the host surface.
readonly minWidth: numberMinimum editor width supplied by the host surface.
readonly origin: Pick<PositionRectProps, "x" | "y">Editor origin in world coordinates.
readonly padding?: numberPadding inside the editable frame.
readonly selection: DocSelectionCurrent document selection.
readonly verticalAlign?: DocVerticalAlignVertical positioning inside the editable frame. Defaults to center for embedded cell editors.
Input for immediate rendering of laid-out document content lines.
readonly blockIndexes?: readonly number[]Optional block indexes to draw; omitted means all blocks.
readonly clipRect?: PositionRect<templateLiteral>Optional world-coordinate clipping rectangle.
readonly font?: stringBase font selected by the host for this document frame.
readonly origin: Pick<PositionRectProps, "x" | "y">Content origin in world coordinates.
readonly snapshot: LayoutSnapshotLayout snapshot whose lines are relative to the content origin.
Doc-owned layout result consumed by host render surfaces.
readonly composingCaretPixelOffset: numberPixel offset from composing-text start to the IME caret.
readonly contentWidth: numberWidth available to document content after padding.
readonly cursorRelative: {
height: number;
x: number;
y: number;
}Cursor point relative to the editor frame.
readonly positionRect: PositionRectPropsFinal editor frame in world coordinates.
readonly snapshot: LayoutSnapshotLayout snapshot owned by the Doc input/render session.
Layout and viewport state exposed to document plugins during render().
readonly blockLayoutDiff: DocBlockLayoutDiffBlock-level diff between the previous and current layout caches.
readonly blockRender?: DocBlockRenderDebugSnapshotDebug and performance stats for the most recent block-render frame.
readonly contentRect: PositionRectPropsEditable content rectangle in viewport coordinates.
readonly documentRect: PositionRectPropsCurrent document layout rectangle in world coordinates.
readonly font: stringFont selected by the host for this document render layout.
readonly layoutCache: DocLayoutCacheLatest full-document layout cache.
readonly scroll: {
readonly x: number;
readonly y: number;
}Current viewport scroll offset.
readonly viewport: {
readonly height: number;
readonly width: number;
}Visible viewport dimensions.
readonly visibleBlocks: readonly DocBlockLayout[]Laid-out blocks selected for the current viewport.
Render-facing operation derived from a RichDoc OT operation.
readonly ot: RichDocOTOperationreadonly type: DocRenderOperationTypeOne queued render request targeting plugin-owned document render nodes.
readonly projectionKey?: PluginKeyPlugin whose render nodes should be refreshed. Omitted means every document plugin may refresh.
readonly renderOperations?: DocRenderOperationsRender-facing operations derived from committed RichDoc OT, or null when they cannot be converted safely.
Snapshot of the current document viewport used by render strategies.
readonly contentRect: PositionRectPropsEditable content rectangle inside the viewport.
readonly height: numberVisible viewport height in host-view units.
readonly width: numberVisible viewport width in host-view units.
Layout work selected by the presentation consumer after a document commit.
| Member | Value |
|---|---|
Reflow |
"reflow" |
Repaint |
"repaint" |
type DocRenderDirtyBlockIds = ReadonlySet<DocNodeId> | nullDirty block ids extracted from document render operations, or null when reflow cannot be localized safely.
type DocRenderOperations = readonly DocRenderOperation[] | nullRender operations derived from document transactions, or null when they cannot be converted safely.
type DocRenderRequestHandler = (requests: readonly DocRenderRequest[]): voidFunction that handles committed document render requests.
collectDocReflowBlockIds(renderOperations: DocRenderOperations, document: readonly RichDocNode[]): DocRenderDirtyBlockIdsCollects blocks whose layout cache must be refreshed for reflow operations.
collectDocRenderOperations(transactions: readonly Transaction<Operation>[]): DocRenderOperationsCollects render operations derived from committed RichDoc OT transactions.
collectDocRepaintBlockIds(renderOperations: DocRenderOperations, document: readonly RichDocNode[]): ReadonlySet<DocNodeId>Collects blocks whose render nodes must be repainted without invalidating layout cache.
class SheetViewportResizeController extends SheetLifecycleControllerKeeps rendering, scrolling, and viewport-culled plugin nodes in sync with viewport size.
SheetViewportResizeController(subscriptionManager: SubscriptionManager): SheetViewportResizeControllerapplyViewportResize(width: number, height: number): voidApplies a resize inside the command dispatched by the owning editor.
destroy(): voidReleases resources owned by SheetViewportResizeController.
setResizeExecutor(executor: (size: {
height: number;
width: number;
}): void): voidRoutes platform resize notifications through the owning editor's command bus.
start(context: SheetLifecycleContext): voidStarts SheetViewportResizeController.
static readonly symbol: typeof symbolDI token for resolving SheetViewportResizeController.
A single selection highlight rectangle in canvas coordinates.
Document business state, transactions and committed publications independent of presentation.
Owns rich-document session state and host-facing document snapshots.
Creates a document session coordinator.
Returns a detached host-facing snapshot from the committed document state.
getDocument(): RichDocNode[]Returns a clone of the current rich-document content.
getText(): stringReturns a plain-text view of the current document.
loadDocument(document: RichDocNode[]): voidReplaces the active document and resets transient cursor/session state.
subscribe(listener: (change: DocEditorChange): void): (): voidSubscribes to committed document projection changes.
static readonly symbol: typeof symbolDI token for resolving the session coordinator.
Owns document state reduction and committed publications without rendering or native input.
DocKernel(manager: PluginManager, steps: PipelineStepExecutorRegistry, config?: ConfigEngine<any> | null, platform?: Platform | null): DocKernelCreates the state owner over editor-local business services.
readonly configEngine: ConfigEngine<any> | nullreadonly pluginManager: PluginManagerdestroy(token?: object): voidReleases subscribers and state owners without invoking a view lifecycle.
enforceCommandBoundary(isExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidInstalls the editor's command authority before mutable services become observable.
enforceTeardownBoundary(token: object): voidReserves kernel teardown for its owning runtime.
executePipeline(pipeline: Pipeline): voidStages every transaction and prepares every owner before publishing the batch.
Reads the latest detached commit metadata.
getOwnerState<State>(key: PluginKey): State | undefinedReads one committed state owner.
initialize(): voidInitializes and protects the document's registered state owners.
registerPlugin<T>(plugin: Plugin<T>): (): voidRegisters one business state owner without constructing a presentation service.
subscribeCommits(listener: (snapshot: DocCommitSnapshot): void): (): voidObserves commit metadata without inheriting command mutation authority.
subscribePublications(listener: (publication: DocKernelPublication): void): (): voidAttaches an independent, assembly-owned state publication consumer.
unregisterPlugin(key: PluginKey): voidRemoves one state owner through its editor-owned registry boundary.
static readonly symbol: typeof symbolinterface CaptureDocSessionStateCommandResult extends DocCommandResultResult of capturing editor-local state for an in-memory document remount.
readonly sessionState: DocSessionStateDetached metadata exposed to document hosts through a typed observation.
readonly changedOwners: readonly string[]readonly revision: numberPersisted document content, independent of layout and local input sessions.
readonly document: RichDocNode[]Detached committed document projection available to every host.
readonly document: RichDocNode[]readonly text: stringWhether one inline style can be applied, is active, and has a common selected value.
Assembly-owned lifecycle shared by document hosts without exposing a service locator to callers.
Inputs for a document runtime requiring no renderer, font measurement or input adapter.
readonly adapters: DocRuntimeAdaptersreadonly defaultPlugins?: false | readonly DocPluginImplementation<DocPlugin<unknown>>[]readonly documentState: DocDocumentStatereadonly plugins?: readonly DocPluginImplementation<DocPlugin<unknown>>[]readonly sessionState?: Readonly<Record<string, unknown>>onCreated(editor: DocKernelEditor): voidHost-neutral document facade shared by Headless and presentation composition.
readonly commands: DocCommandBusreadonly observations: ObservationRegistryreadonly queries: DocQueryRegistryreadonly services: RuntimeCapabilityReaderdestroy(): voidgetDocument(): RichDocNode[]getText(): stringloadDocument(document: RichDocNode[]): voidNeutral projection identities invalidated by one successful document pipeline.
readonly projections: readonly PluginKey[]readonly transactions: readonly Transaction<Operation>[]Host services required by document business state and plugin lifecycles.
readonly platform: (...args: never[]): PlatformregisterEnvironment(container: Container): voidinterface ExportDocStateCommandResult extends DocCommandResultResult of exporting detached document-owned state for an in-memory remount.
readonly documentState: DocDocumentStatetype DocInlineStyleState = Readonly<Record<string, DocInlineStyleStatus>>Inline style state consumed by document toolbars and other host controls.
type DocKernelPublication = StateKernelCommit<Plugin<unknown>, Transaction, DocProjectionInvalidation>Internal state publication consumed by business services and independent views.
Opaque local plugin state captured for in-memory remounts.
Creates an independent document editor with no scene, text shaper or native input.
prepareDocKernel(container: Container, lifecycle: EditorLifecycleStack, options: DocKernelConfiguration, configOverrides?: EditorDefaultConfigOverrides<DocConfig>): DocKernelAssemblyComposes the single document business runtime before optional presentation is attached.
registerDefaultDocFeatures(container: Container, manager: PluginManager, implementations: false | readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]Registers the default document feature plugins selected for one editor instance.
registerDocConfigCommands(commands: DocCommandBus, config: ConfigEngine<DocConfig>): voidRegisters Doc configuration changes on the owning command bus.
registerDocDocumentObservation(observations: ObservationRegistry, document: DocDocumentSessionCoordinator): voidRegisters the document-owned read projection with the editor observation registry.
registerDocFeaturePlugins(container: Container, manager: PluginManager, implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]Registers document feature plugin instances with the kernel-owned PluginManager.
registerDocInlineStyleObservation(observations: ObservationRegistry, input: DocInputPlugin, inlineStyles: RichTextInlineStyleRegistry): voidRegisters the selection-derived inline-style state with the editor observation registry.
registerDocKernelServices(container: Container, adapters: DocRuntimeAdapters, overrides?: EditorDefaultConfigOverrides<DocConfig>): voidRegisters only document business services; presentation is never a prerequisite.
registerDocSessionStateCommands(commands: DocCommandBus, session: SessionStateRegistry): voidRegisters the in-memory document session capture command.
registerDocStateSnapshotCommands(commands: DocCommandBus, document: DocDocumentSessionCoordinator): voidRegisters the document-owned state snapshot command.
sealDocPluginTeardownWrites(plugins: readonly DocPlugin<unknown>[], assertWrite: (): void): voidKeeps retained Doc plugins from releasing a live editor's session and listeners.
Captures every registered local document session contributor.
DefaultDocFeaturePlugins: readonly [typeof ParagraphPlugin, typeof TextInputPlugin, typeof SelectionPlugin, typeof DocNavigationPlugin, typeof RichTextLineBoxPlugin, typeof FontFamilyTextStylePlugin, typeof FontSizeTextStylePlugin, typeof BoldTextStylePlugin, typeof ItalicTextStylePlugin, typeof UnderlineTextStylePlugin, typeof StrikethroughTextStylePlugin, typeof TextColorStylePlugin, typeof TablePlugin, typeof HistoryPlugin]Default document state and semantic command owners.
Revision and owner identities from the latest successful document publication.
Committed document content exposed as an editor-local typed state observation.
DocInlineStyleObservation: StateObservationDefinition<Readonly<Record<string, DocInlineStyleStatus>>>Current inline-style availability and activation for the document selection.
Exports the current document-owned state without local session values.
Reads a detached committed document without native input or layout services.
Reads detached document selection coordinates.
ReadDocTextQuery: DocQueryDefinition<void, string>Reads plain text from the committed document.
UpdateDocDefaultConfigCommand: DocCommandDefinition<EditorDefaultConfigOverrides<DocConfig>, DocCommandResult>Updates editor-local Doc defaults without changing document state.
Composable rich-document plugins for nodes, layout, inline styles, commands, and observations.
Owns one editable document, selection, composition, inline style and OT history without a view.
DocEditModel(document: readonly RichDocNode[], assertWrite?: (): void, onListenerError?: (error: unknown): void): DocEditModelcancel(): voidRestores the original draft document without changing committed Sheet content.
commit(): readonly RichDocNode[]Finishes the draft and returns its detached document for atomic Sheet commit planning.
dispose(): voidReleases draft listeners and prevents further model access.
getComposition(): {
active: boolean;
text: string;
} | nullReturns the transient composition text, or null outside composition.
getDocument(): readonly RichDocNode[]Returns a detached snapshot of the current editable document.
getHistoryStatus(): {
canRedo: boolean;
canUndo: boolean;
editing: boolean;
}Reports undo and redo availability for the active edit draft.
Returns detached anchor and head positions within the editable document.
getTypingStyle(): Readonly<Record<string, unknown>>Returns detached inline attributes to apply to subsequently inserted text.
handleInput(input: SheetEditInput): DocEditModelUpdateApplies one semantic editing input under the owning command authority.
Applies inline attributes to selected text or the active typing style.
setSelection(selection: SheetTextSelection): DocEditModelUpdateUpdates the editable document selection under the owning command authority.
subscribe(listener: (change: DocEditModelChange): void): (): voidObserves future changes and returns an idempotent subscription disposer.
class HistoryPlugin extends DocPlugin<null>Tracks committed document snapshots and contributes transaction-safe undo/redo commands.
HistoryPlugin(input: DocInputPlugin, platform?: Platform): HistoryPluginapply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
configure(context: DocPluginSetupContext): voidRegisters document undo and redo shortcuts with the composed keyboard adapter.
initialize(): voidAligns the history baseline with state restored before Core initialization.
onEditorDestroy(): voidReleases subscriptions and resources owned by this plugin during teardown.
onTransactionCommitted(transaction: Transaction): voidUpdates history only after Core has committed the owning document transaction.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
registerSessionState(registry: SessionStateRegistry): voidRegisters local state that must survive an in-memory editor remount.
registerState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
subscribe(listener: (status: HistoryStatus): void): (): voidstatic readonly symbol: typeof symbolDI token for resolving HistoryPlugin.
Inherited from DocPlugin.
class SelectionPlugin extends DocPlugin<null>Owns document selection commands, select-all shortcut, and pointer drag selection.
SelectionPlugin(input: DocInputPlugin): SelectionPluginapply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
onEditorDestroy(): voidReleases subscriptions and resources owned by this plugin during teardown.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
registerObservations(observations: ObservationRegistry): voidRegisters the host-facing selection observation.
registerSessionState(registry: SessionStateRegistry): voidRegisters selection-owned local remount state.
registerState(): {
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
static readonly symbol: typeof symbolDI token for resolving SelectionPlugin.
Inherited from DocPlugin.
class TextInputPlugin extends DocPlugin<null>Owns printable text input and delete bindings.
apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
onEditorDestroy(): voidReleases subscriptions and resources owned by this plugin during teardown.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
registerState(): {
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
static readonly symbol: typeof symbolDI token for resolving TextInputPlugin.
static registerServices(context: DocPluginServiceContext): voidRegisters text node model support owned by this plugin.
Inherited from DocPlugin.
Semantic draft change delivered without a rendering lifecycle.
readonly kind: "selection" | "content" | "composition"readonly composition?: {
readonly active: boolean;
readonly text: string;
}readonly selection: SheetTextSelectionDetached before/after snapshots for one committed document mutation.
readonly afterDocument: RichDocNode[]readonly afterSelection: DocSelectionreadonly beforeDocument: RichDocNode[]readonly beforeSelection: DocSelectionreadonly operations?: readonly RichDocOTOperation[]RichDoc OT operations committed by the document mutation.
Document-local undo and redo stacks retained during editor remounts.
readonly redoStack: readonly DocHistoryEntry[]readonly undoStack: readonly DocHistoryEntry[]Input accepted by SetDocSelectionCommand.
readonly selection: DocSelectionSelection to make active in the document editor.
type DocHistoryStatus = HistoryStatusCurrent document undo/redo availability.
createDocDocumentFormatting(): {
apply: (document: readonly RichDocNode[], format: Readonly<Record<string, unknown>>): Schema[];
capture: (document: readonly RichDocNode[]): Readonly<Record<string, unknown>>;
}Stable session-state identity owned by document history.
Undo/redo availability exposed as an editor-local state observation.
Current document selection exposed as an editor-local typed observation.
Independent identities for semantic document command owners.
Stable identity for local document selection retained during remounts.
Sets the active document selection without changing content.
class SheetClipboardPlugin extends SheetEmbeddedEditorPluginSheet clipboard codec for the shared rich-document snapshot protocol.
readonly key: "sheet.clipboard"deserialize(value: string): SheetDocumentserialize(document: SheetDocument): stringOrdered registry used by the lightweight Sheet embedded editor.
dispose(ownerToken?: object): voidenforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidRestricts plugin changes after the embedded editor joins a Sheet command bus.
get(key: string): SheetEmbeddedEditorPlugin | undefinedgetAll(): readonly SheetEmbeddedEditorPlugin[]initialize(context: SheetEmbeddedEditorPluginContext): voidnotifyCancel(context: SheetEmbeddedEditorPluginContext): voidnotifyCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): voidnotifyDocumentChanged(context: SheetEmbeddedEditorPluginContext): voidregister(plugin: SheetEmbeddedEditorPlugin): voidtransformCommit(document: SheetDocument, context: SheetEmbeddedEditorPluginContext): SheetDocument | nulltransformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): SheetInlineStyleUpdate | nulltransformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): SheetEditInput | nullunregister(key: string): voidclass SheetFormulaReferencePlugin extends SheetEmbeddedEditorPluginFinds formula-like references for Sheet overlays without changing document data.
readonly key: "sheet.formula-reference"dispose(): voidgetReferences(): readonly string[]initialize(context: SheetEmbeddedEditorPluginContext): voidonDocumentChanged(context: SheetEmbeddedEditorPluginContext): voidclass SheetShortcutPlugin extends SheetEmbeddedEditorPluginOptional key mapping hook for Sheet hosts that add cell-navigation shortcuts.
SheetShortcutPlugin(shortcuts?: Readonly<Record<string, SheetEditInput>>): SheetShortcutPluginreadonly key: "sheet.shortcuts"transformInput(input: SheetEditInput, _context: SheetEmbeddedEditorPluginContext): SheetEditInputIME composition lifecycle input delivered by the Sheet input adapter.
Text deletion delivered by the Sheet input adapter.
Semantic editing policy independent of its host, Core and presentation.
readonly key: stringdispose(): voidinitialize(context: SheetEmbeddedEditorPluginContext): voidonCancel(context: SheetEmbeddedEditorPluginContext): voidonCommit(document: readonly Schema[], context: SheetEmbeddedEditorPluginContext): voidonDocumentChanged(context: SheetEmbeddedEditorPluginContext): voidtransformCommit(document: readonly Schema[], context: SheetEmbeddedEditorPluginContext): void | readonly Schema[] | nulltransformInlineStyle(update: SheetInlineStyleUpdate, context: SheetEmbeddedEditorPluginContext): void | SheetInlineStyleUpdate | nulltransformInput(input: SheetEditInput, context: SheetEmbeddedEditorPluginContext): void | SheetEditInput | nullImmutable document data available to embedded editing policies.
Constructor selected by the embedded editor composition.
An inline style patch applied to the active text selection.
readonly attrs: Readonly<Record<string, unknown>>Modifier keys normalized by the Sheet host.
interface SheetKeyInput extends SheetInputModifiersKeyboard input that the embedded editor may consume for navigation or editing.
Text insertion delivered by the Sheet input adapter.
A position in the rich document represented by a node path and text offset.
A text selection represented by anchor and head positions.
readonly anchor: SheetTextPositionreadonly head: SheetTextPositionInput accepted by an active Sheet edit session.
A Doc assembly chooses plugins for paragraphs, tables, inline styles, and line layout. For example,
ParagraphPlugin handles paragraph behavior and BoldTextStylePlugin contributes a bold inline style.
The Doc plugin contracts define what those plugins receive from the editor runtime; the node and selection values
they act on live in @searsuite/sear-domain-doc.
Import a feature plugin when composing the editor. Host controls should call its registered commands instead of changing document nodes directly.
class DocPlugin<StateType> extends Plugin<StateType>, PluginExtension<DocCommandBus, ObservationRegistry, SessionStateRegistry, DocRuntimeExtensionRegistry>Convenience base class for a Plugin targeting createDocEditor().
DocPlugin<StateType>(__namedParameters: PluginSpec<StateType>): DocPlugin<StateType>Creates a plugin with its stable identity and initial state.
configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
initialize(context: DocPluginRuntimeContext): voidPrepares behavior that requires initialized state before runtime effects.
onEditorDestroy(context: DocPluginRuntimeContext): voidReleases subscriptions and resources owned by this plugin during teardown.
registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registerCapabilities(registry: DocRuntimeExtensionRegistry): voidPublishes typed runtime services owned by this document plugin.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registerObservations(observations: ObservationRegistry): voidRegisters typed state and event observations owned by this document plugin.
registerQueries(queries: DocQueryRegistry): voidRegisters typed, side-effect-free queries owned by this document plugin.
registerSessionState(registry: SessionStateRegistry): voidRegisters local state that must survive an in-memory editor remount.
start(context: DocPluginRuntimeContext): voidStarts lifecycle-owned behavior after document initialization.
static registerServices(context: DocPluginServiceContext): voidRegisters bindings required before this Doc plugin is instantiated.
Inherited from Plugin.
class DocRuntimeExtensionRegistry extends RuntimeCapabilityRegistryRegistry of extension capabilities available to document plugins.
static readonly symbol: typeof symbolDI token for resolving the document runtime extension registry.
Inherited from RuntimeCapabilityRegistry.
interface DocPluginImplementation<TPlugin>Injectable DocPlugin class accepted by createDocEditor().
DocPluginImplementation(...args: never[]): TPluginreadonly symbol: symbolregisterServices(context: DocPluginServiceContext): voidState and command capabilities available to document feature owners.
readonly commands: DocCommandBusreadonly document: {
readonly blockFlows: RichTextBlockFlowRegistry;
readonly inlineStyles: RichTextInlineStyleRegistry;
readonly input: DocInputPlugin;
readonly layout: DocLayoutEngine;
readonly lineBoxes: RichTextLineBoxRegistry;
readonly nodes: DocNodeRegistry;
}readonly extensions: DocRuntimeExtensionRegistryreadonly observations: ObservationRegistryreadonly plugins: PluginManagerreadonly queries: DocQueryRegistryreadonly session: SessionStateRegistryinterface DocPluginRuntimeContext extends DocPluginSetupContextInitialized document capabilities with commands and subscriptions.
Services available while createDocEditor() registers document plugins.
Neutral services available while document plugins are configured.
DI container used by the document assembly root.
readonly runtime: DocPluginRuntimeRuntime services available to document plugins.
Read-only view of editor-local document runtime capabilities exposed to hosts.
type DocRuntimeCapabilityToken = RuntimeCapability<T>Typed token used to publish and consume document runtime capabilities.
readonly Commands: DocRuntimeCapability<DocCommandBus>readonly Document: DocRuntimeCapability<{
readonly blockFlows: RichTextBlockFlowRegistry;
readonly inlineStyles: RichTextInlineStyleRegistry;
readonly input: DocInputPlugin;
readonly layout: DocLayoutEngine;
readonly lineBoxes: RichTextLineBoxRegistry;
readonly nodes: DocNodeRegistry;
}>readonly LineBoxes: DocRuntimeCapability<RichTextLineBoxRegistry>readonly Observations: DocRuntimeCapability<ObservationRegistry>readonly Platform: DocRuntimeCapability<Platform>readonly Plugins: DocRuntimeCapability<PluginManager>readonly Queries: DocRuntimeCapability<DocQueryRegistry>readonly Session: DocRuntimeCapability<SessionStateRegistry>class DocInputPlugin extends Plugin<DocInputState>Plugin that applies rich-document text input and cursor navigation commands.
DocInputPlugin(docLayoutEngine: DocLayoutEngine, nodes: DocNodeRegistry, platform?: Platform): DocInputPluginConstructs the document input plugin with editor-session state only.
readonly transactionOT: {
readonly definition: TransactionOTDefinition<RichDocOTOperation>;
readonly ownerId: "doc.input";
readonly relations: readonly [OTTransformRelation<RichDocOTOperation, RichDocOTOperation>];
}All document data mutations use the shared RichDoc OT operation family.
Current document input session state.
apply(state: DocInputState, transaction: Transaction): DocInputState | nullApplies rich-document OT transactions owned by the document input plugin.
clearSession(): voidClears the current edit session state.
createArrowTransaction(direction: DocCursorDirection, shiftKey: boolean): TransactionBuilds a transaction for arrow-key cursor navigation.
Builds a transaction for Backspace deletion.
createInputTransaction(text: string): TransactionBuilds a transaction for committed text input.
createReplaceDocumentTransaction(document: RichDocNode[], selection?: DocSelection): TransactionBuilds a RichDoc OT transaction that replaces the active document session.
Builds a transaction that selects all content in the current document session.
Builds a transaction for soft-enter paragraph splitting.
createTransaction(command: DocCommand, docTransaction?: DocTransaction): TransactionBuilds a workspace transaction from a rich-document domain command.
enforceSessionWriteBoundary(isCommandExecuting: (): boolean, commitToken: object, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidBinds the owning editor's command and commit boundary after initial state registration.
getLastSnapshot(): LayoutSnapshot | nullReturns the derived layout snapshot used for vertical cursor movement.
handleArrow(direction: DocCursorDirection, shiftKey: boolean): DocInputDispatchResultHandles arrow-key cursor navigation.
Handles Backspace deletion.
handleInput(text: string): DocInputDispatchResultHandles committed text input.
Selects all content in the current document session.
Handles soft-enter paragraph splitting.
onTransactionCommitted(transaction: Transaction): voidPublishes committed document and selection projections after Core commits this plugin's transaction.
registerState(): {
key: PluginKey;
state: DocInputState;
}Registers document input state under the plugin key.
resetSession(doc: RichDocNode[], selection?: DocSelection): voidReplaces the current edit session document and selection.
restoreSelection(selection: DocSelection): voidReplaces local selection during session restoration without changing document content.
sealSessionRestoration(): voidCloses the document initialization and session restoration phase.
setLastSnapshot(snapshot: LayoutSnapshot | null): voidStores the last layout snapshot for cursor navigation.
subscribeDocument(listener: (): void): (): voidSubscribes to committed document projection changes.
subscribeSelection(listener: (): void): (): voidSubscribes to committed selection projection changes.
Result of applying one domain input command to the active document input session.
readonly contentChanged: booleanWhether the command produced document OT operations.
readonly selection: DocSelectionSelection after all command steps have been applied and mapped.
readonly selectionOnly: booleanWhether the command only changed selection/caret state.
State for an active rich-document input session.
Current rich-document selection.
Pending document content owned by the current edit session.
preferredX: number | nullPreferred x-position for repeated vertical cursor movement.
Detaches subclass-private slots from committed nodes while reusing unchanged document data.
lockCommittedDocInputState(state: DocInputState): voidKeeps retained document and selection handles immutable after a Doc input commit.
Transaction metadata key containing selection mapping for DocInputPlugin.
readonly ChangedInlineStyles: "docInput.changedInlineStyles"Inline style keys changed by a semantic document command.
readonly PreferredX: "docInput.preferredX"Preferred x-position after cursor navigation.
readonly ReplaceSelection: "docInput.replaceSelection"Replacement selection payload for whole-session document commands.
readonly SelectionOnly: "docInput.selectionOnly"Whether the command changed selection only.
readonly Steps: "docInput.steps"Ordered selection mapping steps produced by a rich-document command.
Use DocNodeRegistry for document node creation, RichTextInlineStyleRegistry for inline style behavior,
RichTextLineBoxRegistry for line layout, and RichTextBlockFlowRegistry for block flow. A Doc plugin registers
its own contributions at assembly time. DocRuntimeExtensionRegistry exposes editor-local capabilities needed
by plugins and hosts without sharing one global runtime.
createDocCommand(id: string, createTransaction?: (): Transaction, effects?: readonly DocCommandEffect[] | undefined, localAction?: (): void): DocEditorCommandCreates a pipeline-backed document command with an optional transaction or local action.
defineDocRuntimeCapability<T>(id: string): DocRuntimeCapability<T>Creates a typed document runtime capability token.
registerDocPluginBlockFlows(plugins: readonly unknown[], registry: RichTextBlockFlowRegistry): (): voidRegisters every top-level block flow contribution owned by document plugins.
registerDocPluginCapabilities(plugins: readonly unknown[], registry: DocRuntimeExtensionRegistry): voidPublishes every typed runtime capability contributed by document plugins.
registerDocPluginCommands(plugins: readonly unknown[], commands: DocCommandBus): (): voidregisterDocPluginInlineStyles(plugins: readonly unknown[], registry: RichTextInlineStyleRegistry): (): voidRegisters every inline text-style contribution owned by document plugins.
registerDocPluginLineBoxes(plugins: readonly unknown[], registry: RichTextLineBoxRegistry): (): voidRegisters every rich-text line box contribution owned by document plugins.
registerDocPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): voidRegisters every typed observation source contributed by document plugins.
registerDocPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): voidRegisters every local session-state adapter contributed by document plugins.
class ParagraphPlugin extends DocPlugin<null>Registers paragraph and text node model support plus block-level commands.
apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
onEditorDestroy(): voidReleases subscriptions and resources owned by this plugin during teardown.
registerBlockFlows(registry: RichTextBlockFlowRegistry): voidRegisters plugin-owned top-level block flow resolvers.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registerState(): {
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
static readonly symbol: typeof symbolDI token for resolving ParagraphPlugin.
static registerServices(context: DocPluginServiceContext): voidRegisters paragraph node model support owned by this plugin.
Inherited from DocPlugin.
class TablePlugin extends DocPlugin<null>Contributes table model and insertion command without adding table knowledge to Core.
apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
onEditorDestroy(): voidReleases subscriptions and resources owned by this plugin during teardown.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
registerState(): {
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
static readonly symbol: typeof symbolDI token for resolving TablePlugin.
static registerServices(context: DocPluginServiceContext): voidRegisters table node model support owned by this plugin.
Inherited from DocPlugin.
class RichTextLineBoxPlugin extends DocPlugin<null>Registers rich-text line box resolution for document layout.
apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
registerLineBoxes(registry: RichTextLineBoxRegistry): voidRegisters plugin-owned rich-text line box resolvers.
registerState(): {
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
static readonly symbol: typeof symbolDI token for resolving RichTextLineBoxPlugin.
Inherited from DocPlugin.
Input accepted by InsertDocTableCommand.
Input accepted by SetDocLineSpacingCommand. Null clears the paragraph override.
readonly lineSpacing: RichTextLineSpacing | nullInput accepted by SetDocParagraphSpacingAfterCommand. Null clears the paragraph override.
readonly spacingAfter: number | nullInserts a table block at the current document position.
Sets or clears line-spacing overrides on the selected paragraphs.
SetDocParagraphSpacingAfterCommand: DocCommandDefinition<SetDocParagraphSpacingAfterInput, DocCommandResult>Sets or clears after-spacing overrides on the selected paragraphs.
Splits the current paragraph at the current document selection.
Style keys identify the attributes stored on inline text runs.
class BoldTextStylePlugin extends InlineTextStylePluginBaseContributes bold rendering and bold document commands.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
static readonly symbol: typeof symbolDI token for resolving BoldTextStylePlugin.
Inherited from InlineTextStylePluginBase.
class FontFamilyTextStylePlugin extends InlineTextStylePluginBaseContributes font-family rendering and the set-font-family document command.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
static readonly symbol: typeof symbolDI token for resolving FontFamilyTextStylePlugin.
Inherited from InlineTextStylePluginBase.
class FontSizeTextStylePlugin extends InlineTextStylePluginBaseContributes font-size rendering and the set-font-size document command.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
static readonly symbol: typeof symbolDI token for resolving FontSizeTextStylePlugin.
Inherited from InlineTextStylePluginBase.
class InlineTextStylePluginBase extends DocPlugin<null>Shared lifecycle helper for concrete inline style plugins.
apply(_state: null, _transaction: unknown): nullApplies a transaction to plugin-owned state and returns the next state.
configure(context: DocPluginSetupContext): voidConfigures the document editor before runtime start.
onEditorDestroy(): voidReleases subscriptions and resources owned by this plugin during teardown.
registerInlineStyles(registry: RichTextInlineStyleRegistry): voidRegisters plugin-owned inline text style readers and mutation policies.
registerState(): {
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
Inherited from DocPlugin.
class ItalicTextStylePlugin extends InlineTextStylePluginBaseContributes italic rendering, mutation, and keyboard commands.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
static readonly symbol: typeof symbolInherited from InlineTextStylePluginBase.
class StrikethroughTextStylePlugin extends InlineTextStylePluginBaseContributes strikethrough rendering, mutation, and keyboard commands.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
static readonly symbol: typeof symbolInherited from InlineTextStylePluginBase.
class TextColorStylePlugin extends InlineTextStylePluginBaseContributes text-color rendering and mutation for text nodes.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
static readonly symbol: typeof symbolDI token for resolving TextColorStylePlugin.
Inherited from InlineTextStylePluginBase.
class UnderlineTextStylePlugin extends InlineTextStylePluginBaseContributes underline rendering, mutation, and keyboard commands.
registerCommands(commands: DocCommandBus): voidRegisters every stable command id owned by this document plugin.
static readonly symbol: typeof symbolInherited from InlineTextStylePluginBase.
Persisted style key owned by the bold text-style plugin.
| Member | Value |
|---|---|
Bold |
"bold" |
Persisted style key owned by the font-family text-style plugin.
| Member | Value |
|---|---|
FontFamily |
"fontFamily" |
Persisted style key owned by the font-size text-style plugin.
| Member | Value |
|---|---|
FontSize |
"fontSize" |
| Member | Value |
|---|---|
Italic |
"italic" |
| Member | Value |
|---|---|
Strikethrough |
"strikethrough" |
Persisted style key owned by the text-color style plugin.
| Member | Value |
|---|---|
Color |
"color" |
| Member | Value |
|---|---|
Underline |
"underline" |
Input accepted by SetDocBoldCommand. A null or false value clears bold.
readonly bold: boolean | nullInput accepted by SetDocFontFamilyCommand. A null or empty value clears the font family.
readonly fontFamily: string | nullInput accepted by SetDocFontSizeCommand. A null or empty value clears the font size.
readonly fontSize: number | nullreadonly italic: boolean | nullreadonly strikethrough: boolean | nullInput accepted by SetDocTextColorCommand. A null or empty value clears the text color.
readonly color: string | nullreadonly underline: boolean | nullSets whether the selected document text is bold.
Sets the font family on the selected document text.
Sets the font size in pixels on the selected document text.
Sets the text color on the selected document text.
Toggles bold on the selected document text.
Creates the shared bold inline style contribution.
Creates the shared font-family inline style contribution.
Creates the shared font-size inline style contribution.
Creates the shared text-color inline style contribution.
Input accepted by InsertDocTextCommand.
readonly text: stringText to insert at the current document selection.
Input accepted by LoadDocumentCommand.
readonly document: RichDocNode[]Rich-document content to load into the document editor.
Input accepted by MoveDocCursorCommand.
readonly direction: DocCursorDirectionDirection for cursor movement.
readonly shiftKey?: booleanWhether the movement should extend the current selection.
Input accepted by SetDocCompositionCommand.
readonly caretOffset: numberCaret offset inside the composing text.
readonly text: stringCurrent composing text emitted by the host input method.
Clears the active IME composition preview text.
Deletes content before the current document selection.
Focuses the host text-input adapter for the document editor.
Inserts text at the current document selection.
Replaces the active document content.
Moves the current document cursor.
Re-applies the most recently undone document mutation.
Selects all document content.
Sets the active IME composition preview text.
Reverts the most recent committed document mutation.
Headless Sheet composition for tests, servers, and runtimes without a visual host.
class NodeXmlDocumentParser extends XmlDocumentParserNode XML parser backed by xmldom.
parse(xml: string): Documentstatic readonly symbol: symbolclass NodeXmlXPathEngine extends XmlXPathEngineNode XPath engine backed by the xpath package.
evaluate(document: unknown, xpath: string, options: XmlXPathOptions): XmlXPathEvaluationstatic readonly symbol: symbolclass NodeXmlXPathEvaluator extends XmlXPathEvaluatorNode XML/XPath evaluator for standalone use.
static readonly symbol: symbolDI token for resolving the editor-local XML/XPath adapter.
Node-owned clock and calculation settings shared by Sheet and Workbook hosts.
readonly currentDateTime?: (): numberreadonly dateSystem?: FormulaDateSystemreadonly iteration?: FormulaIterationSettingsinterface HeadlessHostOptions extends HeadlessCalculationOptionsOptional Node host capabilities; omitted collaboration installs no channel or transport.
readonly collabTransport?: (...args: never[]): CollabTransporttype HeadlessDocEditor = DocKernelEditorThe same independent document facade used by other hosts.
type HeadlessDocEditorOptions = Omit<DocKernelConfiguration, "adapters">Document business configuration with Node-owned platform services.
type HeadlessEditor = SheetEditorThe neutral Sheet business facade returned by the Node assembly.
type HeadlessEditorOptions = Omit<SheetKernelConfiguration, "adapters"> & HeadlessHostOptionsBusiness-only Sheet options with Node host services supplied by this assembly.
The neutral Workbook business facade returned by the Node assembly.
type HeadlessWorkbookEditorOptions = Omit<WorkbookRuntimeConfiguration, "adapters"> & HeadlessHostOptionsBusiness-only Workbook options with Node host services supplied by this assembly.
Creates a document business runtime without injecting empty presentation services.
createHeadlessEditor(options: HeadlessEditorOptions): SheetEditorCreates a Sheet business kernel without allocating a scene, renderer or native input adapter.
Creates a Workbook whose mounted Sheets use business kernels directly.
Plugin lifecycle, runtime capabilities, state contributions, and extension registries.
An observable, ordered conduit for state changes and projection notifications.
The Pipeline is not a batch-optimisation — it is a monitoring and debugging tool. Every operation (transaction dispatch, projection-only refresh, editor input, cell selection…) should be pushed through a Pipeline so that the full lifecycle is logged and traceable.
Lifecycle hooks (PipelineLifecycle) can be registered via use().
The execution engine calls these hooks at each stage, keeping the
Pipeline itself decoupled from any specific logging or metrics logic.
Usage:
// A single-transaction dispatch (selection, collab, etc.)
const p = Pipeline.fromTransaction('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.invalidate(featureRefreshStepName, selectionPluginKey);
searCore.executePipeline(p);
readonly name: stringreadonly steps: PipelineStep[]Ordered steps that will be executed by the pipeline executor.
add(stepName: string, transaction: Transaction): thisAppend a transaction step (shorthand).
addCustom(stepName: string, kind: string, data?: unknown): thisAdd a step handled by an executor registered by the host or an extension.
addInteraction(stepName: string, interaction: SheetInteractionSignal): thisAppend a local interaction-state transition.
addLocalAction(stepName: string, localAction: (): void): thisAppend a command-owned local action step.
addPostCommit(stepName: string, postCommit: (): void): thisAppend a local state publication deferred until all steps have staged successfully.
addPreparedAction(stepName: string, prepare: (): (): void): thisPrepare an editor-local resource that is released if later staging fails.
addTransaction(stepName: string, transaction: Transaction): thisAppend a transaction step.
emitComplete(): voidNotify all hooks that the pipeline has completed.
emitStart(): voidNotify all hooks that the pipeline is starting.
emitStepComplete(step: PipelineStep): voidNotify all hooks that a step has completed.
emitStepStart(step: PipelineStep): voidNotify all hooks that a step is starting. Provides auto-derived detail.
invalidate(stepName: string, pluginKey: PluginKey): thisPublishes an invalidated projection after the pipeline commits.
use(hook: PipelineLifecycle): thisRegister a lifecycle hook (middleware). Hooks fire in registration order.
static fromInvalidation(name: string, pluginKey: PluginKey): PipelineCreates a pipeline containing one projection invalidation.
static fromTransaction(name: string, transaction: Transaction): PipelineCreates a pipeline containing one transaction step.
Per-container registry of Pipeline step executors.
The sheet core owns frame flushing; executors only perform their local work through PipelineStepExecutionContext. This keeps custom steps extensible without allowing them to bypass dirty-region or render-frame boundaries.
get(kind: string): PipelineStepExecutor | undefinedregister(executor: PipelineStepExecutor): (): voidRegisters the value.
static readonly symbol: typeof symbolDI token for resolving PipelineStepExecutorRegistry.
class SearContractViolationError extends SearErrorError thrown when an internal assembly contract is violated.
SearContractViolationError(message: string, details?: SearErrorDetails): SearContractViolationErrorreadonly code: "SEAR_CONTRACT_VIOLATION"Stable machine-readable error code.
class SearDocParseError extends SearErrorError thrown when document input cannot be parsed.
SearDocParseError(message: string, details?: SearErrorDetails): SearDocParseErrorreadonly code: "SEAR_DOC_PARSE"Stable machine-readable error code.
class SearLifecycleError extends SearErrorError thrown for invalid sheet lifecycle transitions.
SearLifecycleError(operation: string, state: string, message?: string): SearLifecycleErrorreadonly code: "SEAR_LIFECYCLE_INVALID_STATE"Stable machine-readable error code.
class SearPipelineStepExecutorNotFoundError extends SearErrorError thrown when a pipeline step kind has no registered executor.
readonly code: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"Stable machine-readable error code.
class SearRegistryConflictError extends SearErrorError thrown when a registry key is registered more than once.
SearRegistryConflictError(registry: string, key: string, message?: string): SearRegistryConflictErrorreadonly code: "SEAR_REGISTRY_CONFLICT"Stable machine-readable error code.
class SearRegistryEntryNotFoundError extends SearErrorError thrown when a required registry entry is missing.
SearRegistryEntryNotFoundError(registry: string, key: string, message?: string): SearRegistryEntryNotFoundErrorreadonly code: "SEAR_REGISTRY_ENTRY_NOT_FOUND"Stable machine-readable error code.
Observer hooks emitted while a pipeline executes.
onComplete(pipeline: Pipeline): voidPipeline finished after every staged step and postcommit action.
Pipeline begins execution.
onStepComplete(step: PipelineStep, pipeline: Pipeline): voidA single step has finished executing.
onStepStart(step: PipelineStep, pipeline: Pipeline, detail: string): voidA single step is about to execute. Receives auto-derived detail.
One ordered unit of work inside a pipeline.
data?: unknownExtension-owned payload for a custom step executor.
Local interaction transition for interaction steps.
kind: stringBuilt-in or extension-provided executor key.
localAction?: (): voidCommand-owned action for local-action steps.
name: stringHuman-readable step name used by diagnostics.
postCommit?: (): voidDeferred local state publication after document and interaction commits.
prepare?: (): (): voidLocal preparation that returns its rollback action.
Identity of a changed data or session projection.
Transaction payload for transaction steps.
Effects an executor may request without taking ownership of frame flushing.
applyInteraction(step: PipelineStep): voidexecuteTransaction(step: PipelineStep): voidinvalidateProjection(step: PipelineStep): voidprepareLocalAction(step: PipelineStep): voidrunLocalAction(step: PipelineStep): voidschedulePostCommit(step: PipelineStep): voidHandles one extensible Pipeline step kind.
readonly kind: stringexecute(context: PipelineStepExecutionContext, step: PipelineStep): voidinterface PluginCommandExtension<CommandBus>Plugin capability for registering typed commands against one host command bus.
registerCommands(commands: CommandBus): voidRegisters every stable command id owned by this plugin.
interface PluginCommandRegistrar<CommandBus>Required-method view used by host assemblies when invoking command registration.
registerCommands(commands: CommandBus): voidRegisters every stable command id owned by this plugin.
Built-in pipeline step kinds understood by SearCoreSheet.
| Member | Value | Description |
|---|---|---|
Interaction |
"interaction" |
Update local sheet interaction state; never synchronized through OT. |
Invalidate |
"invalidate" |
Publishes a changed projection without changing owned state. |
LocalAction |
"local-action" |
Run a command-owned local action; never synchronized through OT. |
PostCommit |
"post-commit" |
Publish a command-owned local state change only after staging succeeds. |
PreparedAction |
"prepared-action" |
Prepare a local resource and return its rollback for failed staging. |
Transaction |
"transaction" |
Stage a Transaction for atomic commit after every pipeline step succeeds. |
getActiveCommandId(): string | nullgetCommandObserverEpoch(): numberIdentifies the active observer scope so an older command cannot lend it write authority.
hasPluginCommandRegistrar<CommandBus>(plugin: unknown): pluginReturns whether a plugin contributes command registration for the current host.
isInsideCommandExecution(): booleanrunInsideCommandExecution<T>(commandId: string, callback: CommandExecutionCallback<T>): TrunOutsideCommandExecution<T>(callback: CommandExecutionCallback<T>): TRuns observers without inheriting the enclosing command's mutation authority.
warnIfOutsideCommandExecution(operationName: string, warn?: CommandExecutionWarningReporter): voidwarnIfSyntheticCommandDefinition(busName: string, commandId: string, warn?: CommandExecutionWarningReporter): voidStable machine-readable error codes owned by assembly packages.
readonly contractViolation: "SEAR_CONTRACT_VIOLATION"readonly docParse: "SEAR_DOC_PARSE"readonly lifecycleInvalidState: "SEAR_LIFECYCLE_INVALID_STATE"readonly pipelineStepExecutorNotFound: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"readonly registryConflict: "SEAR_REGISTRY_CONFLICT"readonly registryEntryNotFound: "SEAR_REGISTRY_ENTRY_NOT_FOUND"Extensible dispatch table for local interaction-state transitions.
get(type: string): SheetInteractionReducer | undefinedregister(reducer: SheetInteractionReducer): (): voidRegisters the value.
static readonly symbol: typeof symbolDI token for resolving SheetInteractionReducerRegistry.
Per-sheet, local-only interaction state. It deliberately does not use OT: these transitions are view/session concerns and must never be synchronized.
SheetInteractionStore(reducers: SheetInteractionReducerRegistry, platform?: Platform): SheetInteractionStoreapply(signal: SheetInteractionSignal): voidApplies a transaction to SheetInteractionStore state.
commit(state: SheetInteractionState, signals: readonly SheetInteractionSignal[]): voidPublishes a previously staged interaction state after pipeline commit.
stateFinal interaction state to make visible.
signalsOrdered signals to deliver to subscribers.
enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidRequires an editor command for every assembled interaction-state commit.
getState(): Readonly<SheetInteractionState>Returns the state.
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.
stateInteraction state visible before the signal.
signalLocal interaction transition to reduce.
subscribe(listener: (state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): void): (): voidSubscribes to state changes and returns an idempotent disposer.
static readonly symbol: typeof symbolDI token for resolving SheetInteractionStore.
Reduces one local interaction signal into the per-sheet interaction state.
readonly type: stringreduce(state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): SheetInteractionStateA local interaction event. Event names and payloads are owned by the feature that publishes and reduces them; Core only routes the event.
type: stringeditSession: SheetEditSession | nullselection: {
anchor: readonly [number, number];
focus: readonly [number, number];
source: string;
} | nullselectionRevision: numberIncrements for every explicit selection transition.
suppressedSelectionRevision: number | nullThe selection revision consumed when the current/last edit session began.
Plugin and PluginSpec describe an optional feature. During assembly, a plugin can register services, state,
commands, queries, observations, capabilities, and codecs. Registration establishes who owns a value and which
operation may change it. A feature that owns Sheet fill, for example, keeps its fill matrix and commands in its own
package while the assembly only connects it to an editor.
Use when: adding optional built-in or third-party behavior. Choose the lowest layer that owns the behavior: portable values in a domain package, feature state and commands in a plugin, platform conversion in a host adapter. A plugin should not reach into another feature's state or duplicate its finite values.
The composition root runs explicit lifecycle phases. A state contribution is available before commands and consumers that need it; successful commands publish committed changes to observers and renderers. Resources acquired during registration must be released in reverse order when setup fails or the editor is destroyed.
PluginManager coordinates registration. Runtime capabilities expose editor-owned services to the host without
exposing its dependency-injection container. Session adapters capture transient values across a Workbook Sheet
remount; document codecs and versioned OT contributions handle durable export and collaboration separately.
class EditorLifecycleError extends SearErrorPublic error raised when lifecycle stack ownership is violated.
EditorLifecycleError(code: EditorLifecycleErrorCode, message: string, details?: SearErrorDetails, options?: ErrorOptions): EditorLifecycleErrorreadonly code: EditorLifecycleErrorCodeStable machine-readable identifier for this error category.
Idempotent reverse-order disposer stack used by editor composition roots.
class Plugin<PluginStateType> extends StatePlugin<PluginStateType, Transaction>Base contract implemented by sheet and document plugins.
Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.
Plugin<PluginStateType>(__namedParameters: PluginSpec<PluginStateType>): Plugin<PluginStateType>Creates a plugin with its stable identity and initial state.
readonly documentState?: PluginDocumentStateContribution<PluginStateType, object> | readonly PluginDocumentStateContribution<PluginStateType, object>[]Document-state export modules owned by this plugin state.
interestedIn: string[]Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsStable identity for state ownership and neutral data projections.
Optional history behavior for transactions owned by this plugin.
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>Shared transaction algebra used by history and collaboration.
Returns the stable key that identifies this plugin instance.
abstract apply(pluginState: PluginStateType, transaction: Transaction): PluginStateType | nullApplies a transaction to plugin-owned state and returns the next state.
enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's command check for plugin-owned runtime sessions.
lockCommittedState(state: PluginStateType): voidOptionally locks a committed plugin-owned local state value against retained handles.
onInitialDataCell(cell: unknown, row: number, col: number): voidReceives one non-empty cell during the shared Sheet state initialization scan. The scan runs once after every plugin state has been registered, so plugins can build derived indexes without independently traversing the whole sheet.
onInitialDataComplete(): voidCalled after the final cell of the shared startup scan is delivered.
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.
transactionA committed transaction from the completed pipeline.
projectTransaction(state: PluginStateType, transaction: Transaction): readonly Transaction<Operation>[]Purely plans owner-targeted prerequisites before another owner's explicit transaction. Sheet runtimes stage these once, atomically with the original transaction, and retain them in the command pipeline for history and collaboration. Never mutate input state.
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]Registers default configuration values owned by this plugin.
abstract registerState(): PluginStateRegistration<PluginStateType> | PluginStateRegistration<unknown>[]Registers one or more plugin-owned state records with the host manager.
sealRuntimeMetadata(): voidFixes transaction and export metadata after the editor takes ownership.
sealRuntimeMethods(): voidPins transaction and data-initialization hooks after plugin startup.
sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
Inherited from StatePlugin.
Stable unique key assigned to one plugin instance.
Plugin managers use this key to store state, render nodes, and diagnostics without requiring plugin classes to be singleton values.
readonly key: stringUnique plugin key string.
Ordered registry that owns plugin instances for one core/editor runtime.
PluginManager(platform?: Platform): PluginManagerCreates a PluginManager bound to the host diagnostics channel when available.
clearPlugins(token?: object): voidRemoves all registered plugins during host teardown.
enforceWriteBoundary(token: object): voidGives the owning runtime exclusive registry write access after assembly.
forEach(callbackfn: (plugin: Plugin<any>): void): voidVisits state owners in registration order.
getAllPlugins(): Plugin<any>[]Returns all registered plugins in insertion order.
getCollaborativeTransactionPlugin(ownerId: string): Plugin<any> | undefinedResolves a stable collaboration owner to its editor-local plugin instance.
getCollaborativeTransactionPlugins(): readonly Plugin<any>[]Lists collaborative transaction owners registered in this runtime.
Lists document-state export contributions registered by plugin state owners.
getPluginState<T>(key: PluginKey): T | undefinedReturns the state owned by a registered plugin key, if present.
getTransactionHistoryAdapter(transaction: Transaction): PluginTransactionHistoryAdapter | undefinedReturns the history adapter contributed by a transaction's state owner.
getTransactionOTContribution(transaction: Transaction): PluginTransactionOTContribution<OTOperation> | undefinedReturns the shared transaction OT contribution for one local transaction owner.
invertTransaction(transaction: Transaction): Transaction<Operation> | nullInverts a transaction through its owner's registered OT definition.
registerPlugin<T>(plugin: Plugin<T>, token?: object): voidRegisters a plugin under its key and rejects duplicate ownership.
transformTransaction(transaction: Transaction, other: Transaction): Transaction<Operation> | nullRebases a retained transaction over another committed transaction through the shared registry.
unregisterPlugin(pluginOrKey: string | PluginKey | Plugin<any>, token?: object): voidUnregisters a plugin and clears the manager-owned state reference.
static readonly symbol: symbolDI token for resolving the runtime plugin manager.
interface PluginSpec<T>Immutable identity and initial state used to construct a plugin instance.
Stable machine-readable errors raised by editor lifecycle stacks.
| Member | Value |
|---|---|
StackDisposed |
"SEAR_EDITOR_LIFECYCLE_STACK_DISPOSED" |
SetupAndCleanupFailed |
"SEAR_EDITOR_LIFECYCLE_SETUP_AND_CLEANUP_FAILED" |
MultipleDisposalFailures |
"SEAR_EDITOR_LIFECYCLE_MULTIPLE_DISPOSAL_FAILURES" |
type PluginExtension = PluginCommandExtension<CommandBus> & conditional & conditional & conditional & conditionalMinimal host-extension contract shared by Sheet, Doc, and Workbook plugin types.
class HeadlessToolbar extends SearToolbarToolbar implementation for hosts without a UI surface.
static readonly symbol: symbolDI token for resolving HeadlessToolbar.
Platform-neutral lifecycle for a Sheet formula input surface.
static readonly symbol: symbolPlatform-neutral toolbar lifecycle contract.
static readonly symbol: symbolDI token for resolving SearToolbar.
interface PluginObservationExtension<ObservationRegistry>Plugin capability for registering typed observations against one host observation registry.
registerObservations(observations: ObservationRegistry): voidRegisters every typed state and event observation source owned by this plugin.
interface PluginObservationRegistrar<ObservationRegistry>Required-method view used by host assemblies when invoking observation registration.
registerObservations(observations: ObservationRegistry): voidRegisters every typed state and event observation source owned by this plugin.
interface PluginQueryRegistrar<QueryRegistry>registerQueries(queries: QueryRegistry): voidhasPluginObservationRegistrar<ObservationRegistry>(plugin: unknown): pluginReturns whether a plugin contributes observation registration for the current host.
hasPluginQueryRegistrar<QueryRegistry>(plugin: unknown): plugininterface PluginConfigRegistration<ConfigType>Default configuration contributed by one plugin during editor setup.
interface PluginDataEngineRegistrationOptions<PluginStateType>Controls whether a plugin state registration is exposed through DataEngine and data views.
readonly dataView?: readonly PluginDataViewFieldRegistration<PluginStateType>[]Field selectors contributed by this state to named read-only data views.
readonly enabled?: booleanWhen false, the manager owns the plugin without registering its state in DataEngine.
interface PluginDataViewFieldRegistration<PluginStateType>Describes one plugin-owned field exposed to a named DataEngine read-only view.
readonly fieldKey: stringField name written into the named view. Duplicate names in one view are rejected by DataEngine.
readonly required?: booleanWhen false, a missing state or void field does not make the containing view unavailable.
readonly select: (state: PluginStateType): unknownReads the field value from the current plugin-owned state whenever the view is requested.
readonly viewKey: stringNamed data view that receives this field, such as a sheet-level read model.
interface PluginDocumentStateCodec<TDocumentState>JSON-export codec shape supplied by a plugin-owned document-state module.
readonly key: stringdeserialize(payload: unknown, path: string): Partial<TDocumentState>serialize(state: TDocumentState): unknowninterface PluginDocumentStateContribution<TOwnerState, TDocumentState>Document-state export contribution owned by one plugin state owner.
readonly codec: PluginDocumentStateCodec<TDocumentState>readonly key: stringcapture(ownerState: TOwnerState): Partial<TDocumentState> | undefinedinterface PluginStateRegistration<PluginStateType>State registration returned by plugins during editor initialization.
readonly dataEngine?: PluginDataEngineRegistrationOptions<PluginStateType>DataEngine exposure metadata for this state registration.
Plugin key that owns the registered state.
readonly state: PluginStateTypeState value to register for that plugin key.
Converts one plugin-owned transaction into history operations and rebases retained history over transactions that committed later.
invert(transaction: Transaction): Transaction<Operation> | nullCreates the transaction that reverses the supplied committed transaction.
transform(transaction: Transaction, other: Transaction): Transaction<Operation> | nullRebases a retained transaction over a transaction that committed later.
Operation-level functions used to build one plugin-owned history adapter.
interface PluginTransactionOTContribution<OperationType>Transaction algebra and collaboration metadata contributed by one state owner.
readonly collaborative?: booleanWhether committed transactions owned by this plugin may cross a collaboration transport.
readonly definition: TransactionOTDefinition<OperationType>Versioned operation family used by history and collaboration.
readonly ownerId: stringStable wire identity independent from process-local PluginKey suffixes.
readonly relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]Explicit relations needed by third-party operation families.
Document-state export contribution bound to the plugin instance that owns the source state.
readonly contribution: PluginDocumentStateContribution<unknown>type PluginDataViewFieldSelector = { select(state: PluginStateType): unknown }["select"]Controls whether a plugin state registration is exposed through DataEngine and collaboration.
adoptCommittedPluginState<T>(state: T): TTakes ownership of committed data without retaining extension-owned matrix instances.
assertSheetContributionWrite(owner: object): voidChecks registration changes without adding work to query or planning paths.
createPluginTransactionHistoryAdapter(operations: PluginTransactionHistoryOperations): PluginTransactionHistoryAdapterCreates a transaction history adapter while preserving owner identity and metadata.
lockCommittedPluginState(state: unknown): voidLocks a plugin-owned committed value, including nested matrix state.
sealSheetContributionWrites(owner: object, assertWrite: (): void): voidSeals setup-time Sheet contribution registries after editor startup.
Capabilities expose editor-local services to plugins. Session state captures local UI state for restore without making it document content.
class RuntimeCapabilityError extends SearErrorPublic error raised when a runtime capability contract is violated.
RuntimeCapabilityError(code: RuntimeCapabilityErrorCode, message: string, details?: SearErrorDetails): RuntimeCapabilityErrorreadonly code: RuntimeCapabilityErrorCodeStable machine-readable identifier for this error category.
class RuntimeCapabilityRegistry extends RuntimeCapabilityReaderEditor-local registry shared by Sheet, Doc and Workbook assemblies.
RuntimeCapabilityRegistry(owner?: string): RuntimeCapabilityRegistrydestroy(): voidPermanently closes the registry and releases all published values.
enforceWriteBoundary(assertWrite: (): void): voidRequires editor command dispatch for capability changes after assembly.
get<T>(capability: RuntimeCapability<T>): T | undefinedgetRegisteredCapabilityIds(): readonly string[]has(capability: RuntimeCapability<unknown>): booleanregister<T>(capability: RuntimeCapability<T>, value: T): (): voidRegisters one value and returns an idempotent disposer for that registration.
require<T>(capability: RuntimeCapability<T>): Tclass SessionStateError extends SearErrorError raised when a session-state contributor violates its registry contract.
SessionStateError(code: SessionStateErrorCode, message: string, details?: SearErrorDetails): SessionStateErrorCreates a session-state contract error.
readonly code: SessionStateErrorCodeStable machine-readable error code.
Editor-local coordinator for all built-in and plugin-contributed session state.
assertRestorationOpen(): voidRejects a retained contributor restore callback after editor initialization.
Captures every registered contributor while preserving state whose owner is not loaded.
clear(lifecycleToken?: object): voidClears contributors and retained state owned by this registry instance.
getCompletedRestorePhases(): readonly SessionStateRestorePhase[]Returns restore phases already completed by this editor lifecycle.
getRegisteredStateIds(): readonly string[]Returns sorted ids for currently registered contributors.
loadSnapshot(snapshot: SessionStateSnapshot): voidLoads a complete snapshot before lifecycle restoration begins.
register<State>(definition: SessionStateDefinition<State>, adapter: SessionStateAdapter<State>): (): voidRegisters one state owner and returns an idempotent disposer.
restorePhase(phase: SessionStateRestorePhase): voidRestores every registered contributor assigned to one ordered lifecycle phase.
sealRestoration(lifecycleToken: object): voidCloses initialization-only restore operations for an assembled editor.
static readonly symbol: typeof symbolDI token for resolving the editor-local registry.
interface PluginRuntimeCapabilityExtension<RuntimeCapabilityRegistry>Plugin capability for publishing typed editor-owned services to plugins and hosts.
registerCapabilities(registry: RuntimeCapabilityRegistry): voidRegisters every runtime capability owned by this plugin.
interface PluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>Required-method view used by host assemblies when invoking capability registration.
registerCapabilities(registry: RuntimeCapabilityRegistry): voidinterface PluginSessionStateExtension<SessionStateRegistry>Plugin capability for registering editor-local session capture and restore behavior.
registerSessionState(registry: SessionStateRegistry): voidRegisters every local session value owned by this plugin.
interface PluginSessionStateRegistrar<SessionStateRegistry>Required-method view used by host assemblies when invoking session-state registration.
registerSessionState(registry: SessionStateRegistry): voidRegisters every local session value owned by this plugin.
interface RuntimeCapability<T>Typed token used to publish an editor-owned runtime service to plugins and hosts.
Read-only capability view exposed by an editor facade.
get<T>(capability: RuntimeCapability<T>): T | undefinedgetRegisteredCapabilityIds(): readonly string[]has(capability: RuntimeCapability<unknown>): booleanrequire<T>(capability: RuntimeCapability<T>): Tinterface SessionStateAdapter<State>Captures and restores one detached local session value.
readonly restoreAfter?: readonly SessionStateDefinition<unknown>[]Contributors in the same phase that must restore before this one when they are registered.
readonly restorePhase: SessionStateRestorePhaseLifecycle phase in which restore() may safely update the owning feature.
interface SessionStateDefinition<State>Typed identity owned and exported by one local-state contributor.
Supported runtime capability error codes.
| Member | Value |
|---|---|
InvalidDefinition |
"SEAR_RUNTIME_CAPABILITY_INVALID_DEFINITION" |
RegistrationConflict |
"SEAR_RUNTIME_CAPABILITY_REGISTRATION_CONFLICT" |
NotRegistered |
"SEAR_RUNTIME_CAPABILITY_NOT_REGISTERED" |
RegistryDestroyed |
"SEAR_RUNTIME_CAPABILITY_REGISTRY_DESTROYED" |
Supported session-state error codes.
| Member | Value |
|---|---|
invalidDefinition |
"SEAR_SESSION_STATE_INVALID_DEFINITION" |
invalidRestorePhase |
"SEAR_SESSION_STATE_INVALID_RESTORE_PHASE" |
invalidRestoreOrder |
"SEAR_SESSION_STATE_INVALID_RESTORE_ORDER" |
invalidRestoreDependency |
"SEAR_SESSION_STATE_INVALID_RESTORE_DEPENDENCY" |
restoreDependencyCycle |
"SEAR_SESSION_STATE_RESTORE_DEPENDENCY_CYCLE" |
snapshotNotLoaded |
"SEAR_SESSION_STATE_SNAPSHOT_NOT_LOADED" |
restorePhaseClosed |
"SEAR_SESSION_STATE_RESTORE_PHASE_CLOSED" |
restoreInProgress |
"SEAR_SESSION_STATE_RESTORE_IN_PROGRESS" |
registrationConflict |
"SEAR_SESSION_STATE_REGISTRATION_CONFLICT" |
snapshotNotDetached |
"SEAR_SESSION_STATE_SNAPSHOT_NOT_DETACHED" |
A supported local-state restoration phase.
| Member | Value |
|---|---|
BeforeInitialize |
"beforeInitialize" |
AfterInitialize |
"afterInitialize" |
type SessionStateSnapshot = Readonly<Record<string, unknown>>Opaque in-memory snapshot keyed by contributor-owned definition ids.
cloneSessionStateValue<T>(value: T): TCopies a session snapshot without trusting extension-provided clone hooks.
createRuntimeCapabilityReader(registry: RuntimeCapabilityRegistry, hidden?: readonly RuntimeCapability<unknown>[]): RuntimeCapabilityReaderExposes selected capabilities without handing hosts the mutable registry itself.
defineRuntimeCapability<T>(id: string): RuntimeCapability<T>Creates an immutable runtime capability definition with a stable process-wide identity.
defineSessionState<State>(id: string): SessionStateDefinition<State>Creates an immutable typed identity for one local session value.
hasPluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>(plugin: unknown): pluginReturns whether a plugin publishes runtime capabilities for the current editor.
hasPluginSessionStateRegistrar<SessionStateRegistry>(plugin: unknown): pluginReturns whether a plugin contributes local session-state registration for the current host.
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefinedReads one contributor value from an opaque snapshot through its typed definition.
Feature contributions supply the analysis and operation needed to move state with a Sheet range.
Editor-local range-move planning extension point shared by state owners.
analyze(context: SheetRangeMoveContext): SheetRangeMoveAnalysisAssesses all owner constraints without planning or publishing any mutation.
destroy(): voidReleases all editor-owned registrations.
hasConflict(context: SheetRangeMoveContext): booleanValidates all owners before testing destination conflicts.
plan(context: SheetRangeMoveContext): readonly SheetRangeMovePlan[]Plans all owners against the same pre-move state.
register(contribution: SheetRangeMoveContribution): (): voidRegisters one owner and returns an idempotent disposer.
static readonly symbol: typeof symbolclass SheetRangeMoveRejectedError extends SearErrorA rejected assessment retains the state owner's stable diagnostic code.
SheetRangeMoveRejectedError(analysis: {
readonly context: SheetRangeMoveContext;
readonly issue: {
readonly code: string;
readonly details: SearErrorDetails;
readonly message: string;
readonly ownerId: string;
};
readonly status: "blocked";
}): SheetRangeMoveRejectedErrorCreates the command failure from the same assessment consumed by preview.
readonly code: stringStable machine-readable identifier for this error category.
destroy(): voidplan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]register(contribution: SheetRangeReorderContribution): (): voidstatic readonly symbol: typeof symbolEditor-local preflight and operation planning for complete-axis structure edits.
destroy(): voidReleases editor-owned contributions.
plan(context: SheetStructureMoveContext): readonly Operation[]Validates the original intent before compiling dependent operation updates.
register(contribution: SheetStructureMoveContribution): (): voidRegisters one contribution with order-independent, idempotent disposal.
static readonly symbol: typeof symbolZero-based inclusive bounds of a cell range.
Normalized source and destination of a same-sheet cell move.
readonly destination: SheetMoveRangereadonly source: SheetMoveRangeA state owner's participation in range moves, independent of storage representation.
readonly id: stringUnique registration identity, conventionally <owner>.rangeMove; not a document field or operation target.
hasConflict(context: SheetRangeMoveContext): booleanReports whether destination data outside the source would be replaced.
plan(context: SheetRangeMoveContext): readonly SheetRangeMovePlan[]Reads current state and produces an isolated operation plan.
transformPlans(context: SheetRangeMoveContext, plans: readonly SheetRangeMovePlan[]): readonly SheetRangeMovePlan[]Rewrites plans after every state owner has contributed, for derived references.
validate(context: SheetRangeMoveContext): voidReads owner-specific invariants without mutation; rejected constraints throw a SearError.
Operations produced by one state owner without mutating its live state.
readonly operations: readonly Operation[]One stable row permutation within an inclusive cell range.
readonly destinationOf: (row: number): numberMaps a source row to its final row; columns never change.
readonly range: SheetMoveRangeState owners contribute atomic updates without exposing their matrices to the sorter.
readonly id: stringplan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]transformPlans(context: SheetRangeReorderContext, plans: readonly SheetRangeReorderPlan[]): readonly SheetRangeReorderPlan[]validate(context: SheetRangeReorderContext): voidreadonly operations: readonly Operation[]interface SheetRangeRuleEntry<Rule>A feature-owned rule and the rectangle it covers.
readonly range: SheetMoveRangereadonly rule: Ruleinterface SheetRangeRuleFragment<Rule>One retained or relocated piece of an original rule.
readonly original: SheetRangeRuleEntry<Rule>readonly placement: "retained" | "moved"readonly range: SheetMoveRangeinterface SheetRangeRuleMoveAdapter<Rule>Feature-specific storage and operation mapping for splittable range rules.
readonly id: stringplan(context: SheetRangeMoveContext, affected: readonly SheetRangeRuleEntry<Rule>[], fragments: readonly SheetRangeRuleFragment<Rule>[]): readonly SheetRangeMovePlan[]readRules(): readonly SheetRangeRuleEntry<Rule>[]validate(context: SheetRangeMoveContext): voidOne original-state row or column structure edit owned by a matrix plugin.
readonly operations: readonly Operation[]Owner-local validation and dependent edits compiled before a structure edit is staged.
readonly id: stringtransformOperations(context: SheetStructureMoveContext): readonly Operation[]validate(context: SheetStructureMoveContext): voidtype SheetRangeMoveAnalysis = {
readonly context: SheetRangeMoveContext;
readonly status: typeof SheetRangeMoveStatus.Allowed | typeof SheetRangeMoveStatus.RequiresConfirmation;
} | {
readonly context: SheetRangeMoveContext;
readonly issue: {
readonly code: string;
readonly details: SearErrorDetails;
readonly message: string;
readonly ownerId: string;
};
readonly status: typeof SheetRangeMoveStatus.Blocked;
}A move assessment contains no operations and never mutates document state.
createSheetRangeRuleMoveContribution<Rule>(adapter: SheetRangeRuleMoveAdapter<Rule>): SheetRangeMoveContributionCreates a range-move contribution for rules that can be split at cell boundaries.
intersectSheetMoveRanges(left: SheetMoveRange, right: SheetMoveRange): SheetMoveRange | nullReturns the shared inclusive area of two ranges, if any.
isPointInSheetMoveRange(range: SheetMoveRange, row: number, column: number): booleanTests inclusive range membership.
subtractSheetMoveRange(original: SheetMoveRange, cut: SheetMoveRange): SheetMoveRange[]Removes one inclusive rectangle, retaining at most four disjoint pieces.
translateSheetMoveRange(range: SheetMoveRange, source: SheetMoveRange, destination: SheetMoveRange): SheetMoveRangeTranslates a rule fragment by the source-to-destination displacement.
Canonical outcomes shared by move preview and execution.
readonly Allowed: "allowed"readonly Blocked: "blocked"readonly RequiresConfirmation: "requiresConfirmation"Format transfer contributions copy feature-owned formatting alongside cell values.
Editor-local composition of state-owner format transfers.
capture(source: SheetMoveRange): SheetFormatTransferSnapshotcapturePortable(source: SheetMoveRange): readonly SheetPortableFormatTransfer[]clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans all format owners against the same unchanged pre-clear state.
destroy(): voidplanPortable(captured: readonly SheetPortableFormatTransfer[], destination: SheetMoveRange): readonly SheetFormatTransferPlan[]register(owner: SheetFormatTransferContribution): (): voidsingleCellFillStep(row: number, column: number): number | nullusedExtent(lastRow: number, lastColumn: number): readonly [number, number] | nullstatic readonly symbol: typeof symbolinterface SheetFormatMatrix<Value>Sparse read contract implemented by feature-owned matrices.
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: Value, row: number, column: number): void): voidgetDefaultValue(): Value | null | undefinedgetItem(row: number, column: number): Value | null | undefinedOptional state-owner contribution to format painting.
readonly id: stringcapture(source: SheetMoveRange): SheetFormatTransferSnapshotclear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans removal of this owner's explicit formats without changing cell content.
planCaptured(portable: unknown, destination: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans a captured source pattern using this owner's current target state.
singleCellFillStep(row: number, column: number): number | nullOptional numeric step for filling one cell whose format gives it sequence meaning.
usedExtent(lastRow: number, lastColumn: number): readonly [number, number] | nullFarthest explicitly formatted row and column within sheet bounds.
One owner's isolated plan; only the owner interprets its operations.
readonly operations: readonly Operation[]Optional plugin lifecycle extension for format-transfer registration.
registerFormatTransfers(registry: SheetFormatTransferRegistry): voidCaptured format data, independent of subsequent source changes.
readonly portable?: unknownCaptured owner data that can be planned against another Sheet instance.
plan(destination: SheetMoveRange, targetRegistry?: SheetFormatTransferRegistry): readonly SheetFormatTransferPlan[]Serializable owner snapshot for a transient clipboard payload.
type SheetFormatRange = SheetMoveRangeInclusive range shared by format-transfer owners and hosts.
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<Omit<SheetFormatTransferContribution, "singleCellFillStep">>Captures sparse persisted formats and tiles them over an inclusive target.
Editor-local transfer channel for persisted cell metadata other than formats.
capturePortable(source: SheetMoveRange): readonly SheetPortableClipboardTransfer[]clear(range: SheetMoveRange): readonly SheetClipboardTransferPlan[]destroy(): voidplanPortable(requests: readonly SheetClipboardTransferRequest[]): readonly SheetClipboardTransferPlan[]register(owner: SheetClipboardTransferContribution): (): voidstatic readonly symbol: typeof symbolOne owner's captured data and the absolute range for one pasted tile.
readonly destination: SheetMoveRangereadonly portable: unknownreadonly id: stringcapture(source: SheetMoveRange): unknownclear(range: SheetMoveRange): readonly SheetClipboardTransferPlan[]planCaptured(instances: readonly SheetClipboardCapturedInstance[]): readonly SheetClipboardTransferPlan[]Operations planned by the state owner against the destination Sheet.
readonly operations: readonly Operation[]registerClipboardTransfers(registry: SheetClipboardTransferRegistry): voidOne pasted tile containing captures from any number of owners.
readonly captured: readonly SheetPortableClipboardTransfer[]readonly destination: SheetMoveRangeOwner data captured for a transient structured clipboard payload.
Public Sheet and Doc editor composition, lifecycle, commands, queries, and host-adapter wiring.
class DocCaretView extends DocViewOwns caret movement, focus, blink state, and caret overlay rendering.
DocCaretView(caretState: DocCaretState): DocCaretViewconfigure(context: DocViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters native shortcuts and returns ownership of their disposal to the host.
render(): Node<NodeProperties>[] | nullstatic readonly symbol: typeof symbolDI token for resolving DocCaretView.
static registerServices(context: DocViewServiceContext): voidRegisters caret-owned state before the plugin is resolved.
class DocCompositionView extends DocViewOwns optional IME composition text state and render invalidation.
configure(context: DocViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
registerCommands(commands: DocCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
static readonly symbol: typeof symbolDI token for resolving DocCompositionView.
class DocContentView extends DocViewDefault content renderer for text nodes laid out by the document layout engine.
configure(context: DocViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
registerCommands(commands: DocCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
render(searCore: SearCoreDoc): Node<NodeProperties>[] | nullstatic readonly symbol: typeof symbolDI token for resolving DocContentView.
class DocDebugOverlayView extends DocViewDebug overlay for document block-level render bounds.
configure(context: DocViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
render(): Node<NodeProperties>[] | nullstart(): voidStarts lifecycle-owned subscriptions after initialization succeeds.
static readonly symbol: typeof symbolDI token for resolving DocDebugOverlayView.
class DocSelectionView extends DocViewOwns document selection commands, select-all shortcut, and pointer drag selection.
configure(context: DocViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters native shortcuts and returns ownership of their disposal to the host.
render(): Node<NodeProperties>[] | nullstart(): voidStarts lifecycle-owned subscriptions after initialization succeeds.
static readonly symbol: typeof symbolDI token for resolving DocSelectionView.
class DocTextInputView extends DocViewOwns printable text input and delete bindings.
configure(context: DocViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters native shortcuts and returns ownership of their disposal to the host.
static readonly symbol: typeof symbolDI token for resolving DocTextInputView.
class DocTextStyleView extends DocViewConvenience base class for a Plugin targeting createDocEditor().
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): voidMaps semantic inline styles to drawing contributions in this view.
registerKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): voidRegisters native shortcuts and returns ownership of their disposal to the host.
static readonly symbol: typeof symbolclass DocView extends ViewExtensionBase<SearCoreDoc, NodeProperties>Convenience base class for a Plugin targeting createDocEditor().
configure(context: DocViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
initialize(context: DocViewRuntimeContext): voidCompletes setup after command, query and observation registrations are available.
registerCommands(commands: DocCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
registerInlineStyleRenderers(registry: RichTextRunRenderRegistry): voidMaps semantic inline styles to drawing contributions in this view.
registerKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): voidRegisters native shortcuts and returns ownership of their disposal to the host.
start(context: DocViewRuntimeContext): voidStarts lifecycle-owned subscriptions after initialization succeeds.
static registerServices(context: DocViewServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
class SheetView extends ViewExtensionBase<SearCoreSheet, CellProperties>Presentation lifecycle and contributions selected separately from business plugins.
configure(context: SheetViewSetupContext): voidConnects editor-local capabilities during assembly before startup.
initialize(context: SheetViewRuntimeContext): voidCompletes setup after command, query and observation registrations are available.
registerCommands(commands: SheetCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
registerObservations(observations: ObservationRegistry): voidRegisters state or event sources whose subscriptions are owned by this editor.
registerQueries(queries: SheetQueryRegistry): voidRegisters read-only projections without granting mutation authority to callers.
registerSessionState(session: SessionStateRegistry): voidRegisters detachable local session state separately from durable document content.
start(context: SheetViewRuntimeContext): voidStarts lifecycle-owned subscriptions after initialization succeeds.
static registerServices(context: SheetViewServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
class ViewportOverlayNode extends RichTextVisualNodeViewport overlay node that draws transient UI under an identity transform.
ViewportOverlayNode(input: {
readonly depth?: number;
readonly drawOverlay: (context: RenderContext): void;
readonly nodeKey: string;
readonly rect: PositionRectProps;
readonly role?: "selection" | "caret";
}): ViewportOverlayNodeCreates a viewport overlay render node.
drawScene(context: RenderContext): voidDraws overlay content; the node owns transform isolation for viewport-space plugins.
Viewport dimensions in host-view coordinates.
Current document viewport model exposed to interaction plugins.
interface DocViewImplementation<TPlugin>Injectable DocView class accepted by createDocEditor().
DocViewImplementation(...args: never[]): TPluginreadonly symbol: symbolDependency injection token for this editor-local implementation.
registerServices(context: DocViewServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
Local viewport position retained while remounting one document editor.
Stable host capabilities supplied to a DocView after editor assembly.
readonly commands: DocCommandBusCommand bus exposed by the document editor instance.
readonly document: {
readonly blockFlows: RichTextBlockFlowRegistry;
readonly core: SearCoreDoc;
readonly cursor: DocCursorManager;
readonly inlineStyles: RichTextInlineStyleRegistry;
readonly input: DocInputPlugin;
readonly layout: DocLayoutEngine;
readonly lineBoxes: RichTextLineBoxRegistry;
readonly nodes: DocNodeRegistry;
}Rich-document domain services.
readonly events: {
readonly engine: EventEngine<NodeProperties>;
readonly registrar: EventRegistrar;
}Event and hit-test services used by document interactions.
readonly extensions: DocRuntimeExtensionRegistryExtension capability registry for third-party document plugins.
readonly input: {
readonly keyboard: KeyboardRouter;
readonly pointer: PointerCapture;
readonly text: TextInput;
}Host input adapters used by document editing commands.
readonly observations: ObservationRegistryTyped state and event observations owned by this editor instance.
Platform adapter for timers, resize observation, and diagnostics.
readonly plugins: PluginManagerOrdered document plugin registry for this editor.
readonly queries: DocQueryRegistryreadonly render: {
readonly context: RenderContext;
readonly engine: DocRenderEngineCapability;
}Document render services and visible context.
readonly scroll: { readonly manager: ScrollManager }Scroll state shared by document layout and rendering.
readonly session: SessionStateRegistryLocal remount state contributed by built-in and third-party plugins.
readonly textShaper: TextShaperText shaper used by document layout and rendering.
interface DocViewRuntimeContext extends DocViewSetupContextDocument setup capabilities plus the Core created by createDocEditor().
readonly core: SearCoreDocCore document runtime.
Services available while createDocEditor() registers document plugins.
Typed public services available before createDocEditor() starts Core.
DI container used by the document assembly root.
readonly runtime: DocViewRuntimeRuntime services available to document plugins.
interface SheetViewImplementation<View>SheetViewImplementation(...args: never[]): Viewreadonly symbol: symbolDependency injection token for this editor-local implementation.
registerServices(context: SheetViewServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
Local viewport position retained while remounting one workbook sheet.
interface SheetViewRuntime extends SheetViewSetupRuntimeRuntime capabilities available after the command bus is bound and Core exists.
readonly commands: SheetCommandBusThe owning typed dispatcher through which state mutations are executed.
readonly toolbar?: SearToolbarInherited from SheetViewSetupRuntime.
interface SheetViewRuntimeContext extends SheetViewSetupContextSheet setup capabilities plus the Core created by createSheetEditor().
readonly core: SearCoreSheetreadonly runtime: SheetViewRuntimeCapabilities owned by the currently assembled editor instance.
Services available while createSheetEditor() registers Sheet plugins.
Typed public services available before createSheetEditor() creates its Core.
Editor-local dependency container available only during composition.
readonly runtime: SheetViewSetupRuntimeCapabilities owned by the currently assembled editor instance.
addStrategy(token: symbol, strategy: RenderStrategy<CellProperties>, position: { before: symbol } | { after: symbol }): voidStable 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.
readonly cells: { readonly catalog: CellTypeCatalog }Semantic cell types, validation, display text and clipboard behavior.
readonly collaboration: { readonly session: Pick<CollaborationSession, "getStatus"> } | undefinedreadonly config: ConfigEngineEditor-local defaults and configuration contributions.
readonly data: SheetDataEngineSparse Sheet state and neutral data-field projections.
readonly embeddedEditor?: { readonly editor: SheetEmbeddedEditor }Optional Sheet-facing rich-text editor supplied by the host.
readonly events: {
readonly engine: EventEngine<CellProperties>;
readonly registrar: EventRegistrar;
}readonly extensions: SheetRuntimeExtensionRegistryEditor-local registry of typed capabilities, without global mutable registrations.
readonly formula: {
readonly externalServices: IFormulaExternalServiceProvider;
readonly functions: IFunctionRegistry;
readonly results: FormulaResultProviderRegistry;
readonly richResults: FormulaRichResultProviderRegistry;
readonly sources: FormulaSourceProviderRegistry;
readonly textServices: IFormulaTextServiceProvider;
readonly webService: WebServiceClient;
readonly xmlXPath: XmlXPathEvaluator;
}Formula functions, sources, results and external data capabilities.
readonly input: {
readonly cursor: CursorEngine;
readonly cursorRules: CursorRegistry;
readonly keyboard: KeyboardRouter;
readonly pointer: PointerCapture;
readonly text: TextInput;
}readonly interaction: {
readonly pipelineSteps: PipelineStepExecutorRegistry;
readonly reducers: SheetInteractionReducerRegistry;
readonly store: SheetInteractionStore;
}Local interaction state and its command-owned reducers.
readonly lifecycle: SheetLifecycleCoordinatorreadonly observations: ObservationRegistryTyped state and event subscriptions; listeners receive no mutation authority.
Host-provided timing, scheduling and diagnostic operations.
readonly plugins: PluginManagerBusiness state owners registered in this editor instance.
readonly queries: SheetQueryRegistryRead-only typed queries over the latest committed state.
readonly render: {
readonly cellVisualReaders: SheetCellVisualReaderRegistry;
readonly contexts: {
readonly hit: RenderContext;
readonly main: RenderContext;
readonly offScreen: RenderContext;
};
readonly coordinator: SheetRenderCoordinatorManager;
readonly dirtyTracker: FrameDirtyTracker;
readonly dirtyTree: Tree<PositionRect<templateLiteral>>;
readonly engine: SheetRenderEngine;
readonly rendererRegistry: SheetRendererRegistry<CellProperties>;
readonly stage: SceneGraph<CellProperties>;
readonly strategies: RenderStrategyManager<CellProperties>;
readonly tree: Tree<Container>;
}Reads committed state and returns retained nodes for the current viewport.
readonly scroll: {
readonly coordinates: CoordinateEngine;
readonly manager: ScrollManager;
readonly scroller: Scroller;
readonly transformer: CoordinateTransformer;
}readonly session: SessionStateRegistryEditor-local capture and restore registry shared by every session-state owner.
readonly styles: SheetCellStyleReaderSemantic cell appearance shared by automation, filtering and views.
readonly textShaper: TextShaperInternal adapter input for one platform-originated document scroll state update.
registerDocViewportCommands(input: {
readonly commands: DocCommandBus;
readonly renderCoordinator: DocRenderCoordinator;
readonly scrollManager: ScrollManager;
readonly viewportEnvironment: DocViewportEnvironment;
}): voidRegisters viewport-owned document commands on the editor command bus.
registerDocViewportState(session: SessionStateRegistry, observations: ObservationRegistry, scrollManager: ScrollManager): voidRegisters viewport remount state and its host-facing observation.
registerSheetViewportCommands(commands: SheetCommandBus, scrollManager: ScrollManager, resizeController: SheetViewportResizeController): voidRegisters viewport-owned commands on the editor command bus.
registerSheetViewportSessionState(registry: SessionStateRegistry, scrollManager: ScrollManager): voidRegisters viewport-owned local remount state with the editor-local registry.
Applies one platform-originated document scroll update.
DefaultDocViews: readonly [typeof DocCompositionView, typeof DocTextInputView, typeof DocSelectionView, typeof DocCaretView, typeof DocTextStyleView, typeof DocContentView]Native input and scene contributions, independent of document state plugins.
Independent identities for document presentation contributions.
Document runtime capabilities registered by the default assembly root.
readonly Commands: DocRuntimeCapability<DocCommandBus>readonly Config: DocRuntimeCapability<ConfigEngine<any>>readonly Document: DocRuntimeCapability<{
readonly blockFlows: RichTextBlockFlowRegistry;
readonly core: SearCoreDoc;
readonly cursor: DocCursorManager;
readonly inlineStyles: RichTextInlineStyleRegistry;
readonly input: DocInputPlugin;
readonly layout: DocLayoutEngine;
readonly lineBoxes: RichTextLineBoxRegistry;
readonly nodes: DocNodeRegistry;
}>readonly Events: DocRuntimeCapability<{
readonly engine: EventEngine<NodeProperties>;
readonly registrar: EventRegistrar;
}>readonly Input: DocRuntimeCapability<{
readonly keyboard: KeyboardRouter;
readonly pointer: PointerCapture;
readonly text: TextInput;
}>readonly LineBoxes: DocRuntimeCapability<RichTextLineBoxRegistry>readonly Observations: DocRuntimeCapability<ObservationRegistry>readonly Platform: DocRuntimeCapability<Platform>readonly Plugins: DocRuntimeCapability<PluginManager>readonly Render: DocRuntimeCapability<{
readonly context: RenderContext;
readonly engine: DocRenderEngineCapability;
}>readonly Scroll: DocRuntimeCapability<{ readonly manager: ScrollManager }>readonly Session: DocRuntimeCapability<SessionStateRegistry>readonly TextShaper: DocRuntimeCapability<TextShaper>Current document viewport position exposed to hosts and plugins.
Stable session-state identity owned by the document viewport assembly.
Runtime extension tokens owned by document plugins assembled by editor composition roots.
readonly Composition: DocRuntimeCapability<DocCompositionManager>readonly Interaction: DocRuntimeCapability<DocInteractionRuntime>Renders the document viewport after the committed scroll state changes.
Resizes the standalone document viewport.
ResizeSheetViewportCommand: SheetCommandDefinition<{
readonly height: number;
readonly width: number;
}, SheetCommandResult>Scrolls the standalone document viewport to an absolute world position.
readonly Collaboration: RuntimeCapability<{ readonly session: Pick<CollaborationSession, "getStatus"> }>readonly EmbeddedEditor: RuntimeCapability<{ readonly editor: SheetEmbeddedEditor }>readonly Events: RuntimeCapability<{
readonly engine: EventEngine<CellProperties>;
readonly registrar: EventRegistrar;
}>readonly FormulaBar: RuntimeCapability<SearFormulaBar>readonly Input: RuntimeCapability<{
readonly cursor: CursorEngine;
readonly cursorRules: CursorRegistry;
readonly keyboard: KeyboardRouter;
readonly pointer: PointerCapture;
readonly text: TextInput;
}>readonly Lifecycle: RuntimeCapability<SheetLifecycleCoordinator>readonly Render: RuntimeCapability<{
readonly cellVisualReaders: SheetCellVisualReaderRegistry;
readonly contexts: {
readonly hit: RenderContext;
readonly main: RenderContext;
readonly offScreen: RenderContext;
};
readonly coordinator: SheetRenderCoordinatorManager;
readonly dirtyTracker: FrameDirtyTracker;
readonly dirtyTree: Tree<PositionRect<templateLiteral>>;
readonly engine: SheetRenderEngine;
readonly rendererRegistry: SheetRendererRegistry<CellProperties>;
readonly stage: SceneGraph<CellProperties>;
readonly strategies: RenderStrategyManager<CellProperties>;
readonly tree: Tree<Container>;
}>readonly Scroll: RuntimeCapability<{
readonly coordinates: CoordinateEngine;
readonly manager: ScrollManager;
readonly scroller: Scroller;
readonly transformer: CoordinateTransformer;
}>readonly TextShaper: RuntimeCapability<TextShaper>readonly Toolbar: RuntimeCapability<SearToolbar>Stable session-state identity owned by the Sheet viewport assembly.
createSheetEditor() assembles one visual Sheet editor from an initial document, selected plugins, and host-provided
platform, rendering, and input adapters. Use createDocEditor() for a standalone rich-text document. A Workbook
host uses createWorkbookEditor() when it needs stable Sheet identities and switching between Sheets.
Import these entry points from their owning @searsuite/sear-assembly-* package. The assembly connects contracts;
it does not take ownership of a feature's document state. If no visual host is needed, createHeadlessEditor()
provides a smaller entry point for server work and tests.
Use when: the application is ready to provide the adapters required by its chosen editor and to own the editor lifecycle. Start with the headless assembly when rendering and input are unnecessary.
createEmptySheetDocumentState() supplies a starting Sheet state. After creation, application actions and input
handlers run typed commands through editor.commands; state owners stage operations, and the editor commits them
together. Queries read the current state, observations report committed changes, and services expose editor-owned
adapters and extensions.
A visual Sheet session also contains viewport and other local state. That session is separate from the durable
document. A Workbook captures the mounted Sheet's document and local session before switching Sheets. Call
editor.destroy() when the host unmounts the editor so adapters, listeners, and plugins release their resources.
Related concepts: commands define the mutation path; plugins own feature state; the Workbook assembly owns Sheet structure and switching.
Inputs used to assemble one Sheet editor instance.
sheetState supplies the initial document; adapters supplies the host
services and render contexts. Optional plugins extend the default feature
set, while sessionState restores editor-local values after a remount.
cellFontFamily?: stringDefault font family and fallback list used by ordinary Sheet cells.
cellFontSize?: numberDefault font size used by ordinary Sheet cells.
Optional editor used to render and edit rich text embedded in Sheet cells.
plugins?: readonly SheetPluginImplementation<SheetPlugin<unknown>>[]sessionState?: Readonly<Record<string, unknown>>Optional editor-local state restored when remounting a workbook sheet.
viewExtensions?: readonly SheetViewImplementation<SheetView>[]Input, drawing and host UI extensions.
viewport?: {
height: number;
width: number;
}onCreated(editor: SheetEditor): voidinterface DocEditor extends DocKernelEditorPublic standalone document editor API returned by createDocEditor().
readonly commands: DocCommandBusThe supported command entry point for document user and program actions.
readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
readonly services: RuntimeCapabilityReaderRead-only access to typed services owned by this editor's isolated runtime.
destroy(): voidReleases listeners, timers, adapter state, and DI-owned services for this editor instance.
focus(): voidRequests focus for the host text-input adapter, preserving IME placement.
getDocument(): RichDocNode[]Returns a clone of the current rich-document content.
getText(): stringReturns the current plain-text view using one newline between paragraphs.
loadDocument(document: RichDocNode[]): voidReplaces the document content and renders the new state.
render(): voidRenders the current editor state into the configured render context.
Platform-specific services required to assemble a standalone document editor.
eventRegistrar: InjectableImplementation<EventRegistrar>Host event registrar selected explicitly by the visual host.
keyboardRouter: InjectableImplementation<KeyboardRouter>Keyboard router for action keys such as arrows, backspace, enter, and select-all.
Platform implementation that owns timers, resize observation, and diagnostics.
pointerCapture: InjectableImplementation<PointerCapture>Host-wide pointer capture adapter that emits render-root view coordinates.
Optional host scroller adapter for wheel/touch viewport scrolling.
Text input adapter for printable text, paste/cut, and IME composition.
Creates the visible render context used by the document editor.
createTextShaper(renderContext: RenderContext): TextShaperOptional text-shaping adapter; omission uses render-context measurements.
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.
Configuration for assembling a standalone rich-document editor.
Platform adapters supplied by the host application.
defaultPlugins?: false | readonly DocPluginImplementation<DocPlugin<unknown>>[]Default document feature plugins; pass false to assemble only custom plugins.
defaultViews?: false | readonly DocViewImplementation<DocView>[]Presentation extensions selected independently of state plugins.
devicePixelRatio?: numberRaster scale used to initialize and resize the render context.
Initial document-owned state.
fontFamily?: stringDefault font family and fallback list applied to document text.
fontSize?: numberDefault font size applied when measuring and rendering document text.
Guardrails used when deciding whether document block raster reuse should run for a frame.
lineHeightMultiplier?: numberDefault line-height multiplier applied to paragraphs without an explicit override.
paragraphSpacingAfter?: numberDefault spacing after non-final paragraphs.
plugins?: DocPluginImplementation<DocPlugin<unknown>>[]Document plugins installed after the default editing and rendering features.
sessionState?: Readonly<Record<string, unknown>>Optional editor-local state restored during an in-memory remount.
Vertical positioning used by standalone document layout; defaults to top.
viewExtensions?: readonly DocViewImplementation<DocView>[]Initial viewport size; defaults to 800 by 600 when the host cannot know it yet.
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.
Called once the editor object has been assembled and initial content rendered.
Platform-specific services required to assemble the default sheet editor.
clipboard?: InjectableImplementation<SheetClipboard>collabTransport?: InjectableImplementation<CollabTransport>cursorEngine: InjectableImplementation<CursorEngine>eventRegistrar: InjectableImplementation<EventRegistrar>fileDownload?: InjectableImplementation<FileDownload>Optional host file-save capability; existing environment bindings take precedence. The editor owns newly created adapters.
formulaBar?: InjectableImplementation<SearFormulaBar>Optional formula input surface supplied by the host.
keyboardRouter: InjectableImplementation<KeyboardRouter>pointerCapture: InjectableImplementation<PointerCapture>toolbar?: InjectableImplementation<SearToolbar>Optional host toolbar; omit it when the host has no toolbar surface.
userInteraction?: InjectableImplementation<UserInteractionService>Host-owned service for decisions that require a user response.
webServiceClient?: InjectableImplementation<WebServiceClient>Asynchronous web-service transport used by host-managed formula caches.
xmlDocumentParser?: InjectableImplementation<XmlDocumentParser>Host XML parser paired with the XPath engine; defaults to the browser implementation.
xmlXPathEngine?: InjectableImplementation<XmlXPathEngine>Host XPath engine paired with the XML parser; defaults to the browser implementation.
xmlXPathEvaluator?: InjectableImplementation<XmlXPathEvaluator>Optional complete XML/XPath override used by XML-backed formula plugins.
Creates the function catalog owned by this editor or its parent workbook.
createRenderContexts(): {
hitRenderContext: RenderContext;
offScreenRenderContext: RenderContext;
renderContext: RenderContext;
}createTextShaper(renderContext: RenderContext): TextShaperCreates an editor-local text shaper; omission uses render-context measurements.
registerEnvironment(container: Container): voidPersisted document content, independent of layout and local input sessions.
readonly document: RichDocNode[]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 services, and must call destroy() when the session is
no longer mounted.
ReturnsA fully initialized Sheet editor facade.
import {
createSheetEditor,
type SheetEditorAdapters,
} from '@searsuite/sear-assembly-setup';
import { createEmptySheetDocumentState } from '@searsuite/sear-assembly-sheet-state';
import { SelectRangeCommand } from '@searsuite/sear-plugin-selection';
async function openSheet(adapters: SheetEditorAdapters) {
const sheetState = createEmptySheetDocumentState(20, 10);
const editor = createSheetEditor({ adapters, sheetState });
await editor.commands.run(SelectRangeCommand, { anchor: [0, 0], focus: [0, 0] });
return editor; // The host calls editor.destroy() when the view unmounts.
}optionsPlatform adapters, initial Sheet state, plugins, and runtime configuration.
createDocEditor(options: DocEditorConfiguration): DocEditorAttaches document views and native adapters to the independent business assembly.
import {
createDocEditor,
type DocDocumentState,
type DocEditorAdapters,
} from '@searsuite/sear-assembly-setup';
function openDocument(adapters: DocEditorAdapters, documentState: DocDocumentState) {
const editor = createDocEditor({ adapters, documentState });
editor.focus();
return editor; // The host calls editor.destroy() when the view unmounts.
}Registry that lets multiple document plugins contribute handlers to single-subscription input adapters.
clear(): voidRemoves every registered handler.
Creates the composed keyboard handlers passed to the host keyboard adapter.
Creates the composed text handlers passed to the host text adapter.
enforceCommandBoundary(isCommandExecuting: (): boolean, isTearingDown: (): boolean): voidCloses registration changes after editor startup.
registerKeyboardHandlers(handlers: KeyboardRouterHandlers): (): voidAdds keyboard-action handlers and returns a disposer.
registerTextHandlers(handlers: TextInputHandlers): (): voidAdds text-input handlers and returns a disposer.
static readonly symbol: typeof symbolDI token for resolving the input binding registry.
Pointer input used by document interaction plugins.
preventDefault(): voidinterface CaptureDocSessionStateCommandResult extends DocCommandResultResult of capturing editor-local state for an in-memory document remount.
readonly sessionState: DocSessionStateinterface ExportDocStateCommandResult extends DocCommandResultResult of exporting detached document-owned state for an in-memory remount.
readonly documentState: DocDocumentStateRequests presentation work without changing document state.
Captures every registered local document session contributor.
Exports the current document-owned state without local session values.
UpdateDocDefaultConfigCommand: DocCommandDefinition<EditorDefaultConfigOverrides<DocConfig>, DocCommandResult>Updates editor-local Doc defaults without changing document state.
type RichTextInlineStyle = Readonly<Record<string, unknown>>Domain-neutral inline style bag carried by measured rich-text chars.
registerDocPluginInlineStyleRenderers(plugins: readonly unknown[], registry: RichTextRunRenderRegistry): (): voidRegisters every rich-text run renderer contributed by document plugins.
registerDocPluginKeyboardHandlers(plugins: readonly unknown[], context: DocKeyboardHandlerRegistrationContext): (): voidRegisters every keyboard binding contributed by document plugins.
registerDefaultDocFeatures(container: Container, manager: PluginManager, implementations: false | readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]Registers the default document feature plugins selected for one editor instance.
registerDocFeaturePlugins(container: Container, manager: PluginManager, implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]Registers document feature plugin instances with the kernel-owned PluginManager.
DefaultDocFeaturePlugins: readonly [typeof ParagraphPlugin, typeof TextInputPlugin, typeof SelectionPlugin, typeof DocNavigationPlugin, typeof RichTextLineBoxPlugin, typeof FontFamilyTextStylePlugin, typeof FontSizeTextStylePlugin, typeof BoldTextStylePlugin, typeof ItalicTextStylePlugin, typeof UnderlineTextStylePlugin, typeof StrikethroughTextStylePlugin, typeof TextColorStylePlugin, typeof TablePlugin, typeof HistoryPlugin]Default document state and semantic command owners.
Shared caret blink state used by document feature plugins and render layout.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidCloses direct caret writes after editor assembly.
isVisible(): booleanReturns whether the caret should be painted in the current frame.
reset(): voidRestarts the blink cycle with the caret visible.
setVisible(visible: boolean): voidSets the current caret visibility.
toggle(): booleanToggles the caret visibility for a blink tick.
static readonly symbol: typeof symbolDI token for resolving caret state owned by CaretPlugin.
Owns Doc layout cache, page map, and viewport range derivation.
DocRenderLayoutService(inputPlugin: DocInputPlugin, extensions: DocRuntimeExtensionRegistry, renderContext: RenderContext, scrollManager: ScrollManager, sceneTree: Tree<PositionRect<templateLiteral>>, configuration: DocEditorRuntimeConfiguration, configEngine: ConfigEngine, cursorManager: DocCursorManager, layoutEngine: DocLayoutEngine, virtualLayouts: DocVirtualLayoutStore, commands: DocCommandBus): DocRenderLayoutServiceCreates a render-layout service for one standalone document editor.
prepareRenderLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport, renderOperations?: DocRenderOperations): DocRenderLayoutBuilds the current render layout before plugins produce render nodes.
prepareViewportLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport): DocRenderLayoutReuses the previous full-document layout and updates only viewport-derived fields.
recordBlockRenderDebugSnapshot(snapshot: DocBlockRenderDebugSnapshot): voidRecords block-render reuse/debug stats for the latest render frame.
recordRenderPrepareTiming(mode: DocRenderPrepareMode, durationMs: number): voidrefreshInteractionLayout(contentRect: DocEditorContentRect, _viewport: DocEditorViewport): DocRenderLayout | nullReuses the latest layout snapshot and refreshes selection/caret geometry only.
reset(): voidClears cached layout and page state.
subscribeVirtualLayoutSummary(listener: DocVirtualLayoutSummaryListener): (): voidstatic readonly symbol: typeof symbolDI token for resolving the render-layout service.
class RichTextBlockNode extends RichTextVisualNodeScene node that indexes and draws one top-level rich-text block.
RichTextBlockNode(input: {
readonly block: {
readonly id: string;
readonly index: number;
};
readonly font: string;
readonly lineRenderer: RichTextLineRenderer;
readonly lines: readonly RichTextRenderLine[];
readonly origin?: Pick<PositionRectProps, "x" | "y">;
readonly rect: PositionRectProps;
}): RichTextBlockNodeCreates a block-level rich-text scene node.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws all visible text runs inside this block.
class RichTextRunNode extends RichTextVisualNodeScene node that draws one contiguous styled rich-text run in world coordinates.
RichTextRunNode(input: {
readonly baselineY: number;
readonly font: string;
readonly fontAscent: number;
readonly fontDescent: number;
readonly properties: Partial<RichTextRenderNodeProperties>;
readonly rect: PositionRectProps;
readonly runRenderer: RichTextRunRenderer;
readonly style?: Readonly<Record<string, unknown>>;
readonly text: string;
}): RichTextRunNodeCreates a text-run scene node.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the text run into the active world-space transform.
Caret-state capability consumed by document plugins.
interface DocEditorContentRect extends DocEditorViewportRectangle used for document text layout and rendering.
interface DocInteractionContentRect extends DocInteractionViewportCurrent document content rectangle exposed to interaction plugins.
Render-engine surface exposed to Doc plugins.
render(pluginKey?: unknown): voidReads committed state and returns retained nodes for the current viewport.
Layout/cache/page-map result exposed to document plugins for one render pass.
readonly blockLayoutDiff: DocBlockLayoutDiffBlock-level diff between the previous and current layout caches.
readonly composingCaretPixelOffset: numberPixel offset from composing-text start to the IME caret.
readonly cursorX: numberCursor x in world coordinates.
readonly cursorY: numberCursor y in world coordinates.
readonly documentRect: {
readonly height: number;
readonly width: number;
readonly x: number;
readonly y: number;
}Current document layout rectangle in world coordinates.
readonly layoutCache: DocLayoutCacheLatest full-document layout cache.
readonly pageMap: DocPageMapLatest page map derived from the layout cache.
readonly visibleBlocks: readonly DocBlockLayout[]Laid-out blocks selected for plugin-owned render nodes.
Public layout-service surface exposed to Doc plugins and hosts.
Public virtual layout summary exposed through the Doc layout-service capability.
readonly blockRender?: DocBlockRenderDebugSnapshotreadonly cacheHits: numberreadonly cacheMisses: numberreadonly cursorBlock: number | nullreadonly documentHeight: numberreadonly heightIndexUpdated: booleanreadonly initialLoadMs?: numberreadonly materializedBlocks: numberreadonly materializedIndexes: stringreadonly model: "reused" | "rebuilt"readonly rangeEnd: numberreadonly rangeStart: numberreadonly renderPhase?: DocVirtualLayoutRenderPhasereadonly timings: DocVirtualLayoutTimingSummaryreadonly totalBlocks: numberTiming summary reported by virtual document layout instrumentation.
readonly cursorSelectionMs: numberreadonly documentModelMs: numberreadonly heightCorrectionMs: numberreadonly materializeBlocksMs: numberreadonly renderPrepareMode?: "full" | "viewport"readonly renderPrepareMs?: numberreadonly snapshotCacheMs: numberreadonly viewportRangeMs: numberreadonly virtualLayoutTotalMs: numberMinimal layout-line shape consumed by rich-text render nodes.
readonly chars: readonly RichTextRenderChar[]readonly charStartOffset: numberreadonly cursorXOffsets?: readonly number[]readonly fontAscent: numberreadonly height: numberreadonly textNodePath: readonly number[]readonly x: numberreadonly y: numberinterface RichTextRenderNodeProperties extends NodePropertiesRender-node properties used by rich-text scene graphs.
readonly blockId?: stringStable top-level rich-text block id.
readonly blockIndex?: numberTop-level rich-text block index.
readonly lineIndex?: numberLayout line index inside the full rich-text snapshot.
readonly renderRole?: "selection" | "block" | "page" | "line" | "text-run" | "caret" | "composition"Semantic role for rich-text render nodes.
Inherited from NodeProperties.
type DocVirtualLayoutRenderPhase = "initial" | "realtime"Render phase reported by virtual document layout instrumentation.
type DocVirtualLayoutSummaryListener = (summary: DocVirtualLayoutSummary): voidcreateRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>Creates a world-space rectangle for one rich-text line/run.
Base service instances created before runtime adapters and plugins are wired.
readonly configEngine: ConfigEngineConfiguration engine registered in the DI container.
readonly stage: SceneGraph<RichTextRenderNodeProperties>Scene graph that owns standalone document content render nodes.
Input-binding capability consumed by document plugins.
registerKeyboardHandlers(handlers: KeyboardRouterHandlers): (): voidregisterTextHandlers(handlers: TextInputHandlers): (): voidView services exposed to document interaction plugins.
getRoot(): unknownreadRootViewOffset(): {
x: number;
y: number;
}subscribePointerDrag(handlers: DocPointerDragHandlers): (): voidServices available while a Doc plugin registers keyboard bindings.
readonly bindings: DocInputBindingRegistryCapabilityAggregates plugin-owned keyboard handlers for the host adapter.
readonly commands: DocCommandBusExecutes semantic editor commands from keyboard handlers.
Document pointer-drag lifecycle consumed by interaction plugins.
Runtime services assembled after Doc base services and host environment values are available.
readonly eventEngine: EventEngine<NodeProperties>Event pipeline and hit-testing facade for document interactions.
readonly eventRegistrar: EventRegistrarEvent registrar selected explicitly by the visual host.
readonly pluginManager: PluginManagerDocument plugin manager populated by feature registration.
readonly renderContexts: {
readonly hit: RenderContext;
readonly main: RenderContext;
readonly offScreen: RenderContext;
}Render contexts for visible, off-screen, and hit-test layers.
readonly renderEngine: DocRenderEngineDocument render engine populated with the shared Sheet-like strategy chain.
readonly scrollManager: ScrollManagerScroll manager coordinating document viewport state.
Detached committed document projection available to every host.
readonly document: RichDocNode[]readonly text: stringWhether one inline style can be applied, is active, and has a common selected value.
type DocInlineStyleState = Readonly<Record<string, DocInlineStyleStatus>>Inline style state consumed by document toolbars and other host controls.
Opaque local plugin state captured for in-memory remounts.
registerDocBaseServices(container: Container, _adapters: DocEditorAdapters, _viewport: DocEditorViewport, _defaultConfigOverrides?: EditorDefaultConfigOverrides<DocConfig>): DocBaseServicesRegisters document editor base services into the DI container.
registerDocRuntime(container: Container, adapters: DocEditorAdapters, viewport: DocEditorViewport): DocRuntimeRegisters render, input, scroll, command, and plugin runtime services for Doc.
registerDocConfigCommands(commands: DocCommandBus, config: ConfigEngine<DocConfig>): voidRegisters Doc configuration changes on the owning command bus.
registerDocDocumentObservation(observations: ObservationRegistry, document: DocDocumentSessionCoordinator): voidRegisters the document-owned read projection with the editor observation registry.
registerDocInlineStyleObservation(observations: ObservationRegistry, input: DocInputPlugin, inlineStyles: RichTextInlineStyleRegistry): voidRegisters the selection-derived inline-style state with the editor observation registry.
registerDocSessionStateCommands(commands: DocCommandBus, session: SessionStateRegistry): voidRegisters the in-memory document session capture command.
registerDocStateSnapshotCommands(commands: DocCommandBus, document: DocDocumentSessionCoordinator): voidRegisters the document-owned state snapshot command.
Committed document content exposed as an editor-local typed state observation.
DocInlineStyleObservation: StateObservationDefinition<Readonly<Record<string, DocInlineStyleStatus>>>Current inline-style availability and activation for the document selection.
Public programmatic input for an absolute world-space viewport position.
Internal adapter input for one platform-originated scroll state update.
PublishSheetDisplayedValueChangesCommand: SheetCommandDefinition<readonly SheetDisplayedValueCoordinate[], SheetCommandResult>Publishes derived display changes through the owning Sheet command bus.
A session snapshot holds local editor state for remounting. Durable Sheet and Doc content stays in the document state.
class SessionStateError extends SearErrorError raised when a session-state contributor violates its registry contract.
SessionStateError(code: SessionStateErrorCode, message: string, details?: SearErrorDetails): SessionStateErrorCreates a session-state contract error.
readonly code: SessionStateErrorCodeStable machine-readable error code.
Editor-local coordinator for all built-in and plugin-contributed session state.
assertRestorationOpen(): voidRejects a retained contributor restore callback after editor initialization.
Captures every registered contributor while preserving state whose owner is not loaded.
clear(lifecycleToken?: object): voidClears contributors and retained state owned by this registry instance.
getCompletedRestorePhases(): readonly SessionStateRestorePhase[]Returns restore phases already completed by this editor lifecycle.
getRegisteredStateIds(): readonly string[]Returns sorted ids for currently registered contributors.
loadSnapshot(snapshot: SessionStateSnapshot): voidLoads a complete snapshot before lifecycle restoration begins.
register<State>(definition: SessionStateDefinition<State>, adapter: SessionStateAdapter<State>): (): voidRegisters one state owner and returns an idempotent disposer.
restorePhase(phase: SessionStateRestorePhase): voidRestores every registered contributor assigned to one ordered lifecycle phase.
sealRestoration(lifecycleToken: object): voidCloses initialization-only restore operations for an assembled editor.
static readonly symbol: typeof symbolDI token for resolving the editor-local registry.
interface SessionStateAdapter<State>Captures and restores one detached local session value.
readonly restoreAfter?: readonly SessionStateDefinition<unknown>[]Contributors in the same phase that must restore before this one when they are registered.
readonly restorePhase: SessionStateRestorePhaseLifecycle phase in which restore() may safely update the owning feature.
interface SessionStateDefinition<State>Typed identity owned and exported by one local-state contributor.
type SessionStateSnapshot = Readonly<Record<string, unknown>>Opaque in-memory snapshot keyed by contributor-owned definition ids.
registerDefaultDependencies(container: Container): voidRegisters the small common runtime set into an explicit host container.
defineSessionState<State>(id: string): SessionStateDefinition<State>Creates an immutable typed identity for one local session value.
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefinedReads one contributor value from an opaque snapshot through its typed definition.
Stable machine-readable errors raised by session-state contracts.
readonly invalidDefinition: "SEAR_SESSION_STATE_INVALID_DEFINITION"readonly invalidRestoreDependency: "SEAR_SESSION_STATE_INVALID_RESTORE_DEPENDENCY"readonly invalidRestoreOrder: "SEAR_SESSION_STATE_INVALID_RESTORE_ORDER"readonly invalidRestorePhase: "SEAR_SESSION_STATE_INVALID_RESTORE_PHASE"readonly registrationConflict: "SEAR_SESSION_STATE_REGISTRATION_CONFLICT"readonly restoreDependencyCycle: "SEAR_SESSION_STATE_RESTORE_DEPENDENCY_CYCLE"readonly restoreInProgress: "SEAR_SESSION_STATE_RESTORE_IN_PROGRESS"readonly restorePhaseClosed: "SEAR_SESSION_STATE_RESTORE_PHASE_CLOSED"readonly snapshotNotDetached: "SEAR_SESSION_STATE_SNAPSHOT_NOT_DETACHED"readonly snapshotNotLoaded: "SEAR_SESSION_STATE_SNAPSHOT_NOT_LOADED"Ordered lifecycle phases in which local state may be restored.
readonly AfterInitialize: "afterInitialize"readonly BeforeInitialize: "beforeInitialize"The default Doc-backed rich-text editor adapter for Sheet cells.
class SheetCellContextView extends SheetEmbeddedEditorViewAdapts Sheet cell geometry and pointer coordinates for embedded sessions.
readonly key: "sheet.cell-context"initialize(context: SheetEmbeddedEditorViewContext): voidtoLocalPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPointtoSheetPoint(context: SheetEmbeddedEditorContext, point: SheetEditorPoint): SheetEditorPointOwns the adapter's independent presentation contributions.
dispose(ownerToken?: object): voidenforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidinitialize(context: SheetEmbeddedEditorViewContext): voidnotifyCancel(context: SheetEmbeddedEditorViewContext): voidnotifyCommit(document: SheetDocument, context: SheetEmbeddedEditorViewContext): voidnotifyRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorViewContext): voidregister(view: SheetEmbeddedEditorView): voidclass SheetOverflowView extends SheetEmbeddedEditorViewKeeps overflow sizing as a Sheet concern and requests geometry redraws.
readonly key: "sheet.overflow"dispose(): voidgetContentSize(): {
readonly height: number;
readonly width: number;
} | nullonCommit(_document: SheetDocument, _context: SheetEmbeddedEditorViewContext): voidonRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorViewContext): voidGeometry and render lifecycle selected separately from editing policies.
readonly key: stringdispose(): voidinitialize(context: SheetEmbeddedEditorViewContext): voidonCancel(context: SheetEmbeddedEditorViewContext): voidonCommit(document: SheetDocument, context: SheetEmbeddedEditorViewContext): voidonRender(update: SheetRenderUpdate, context: SheetEmbeddedEditorViewContext): voidPresentation services owned by the Sheet-to-Doc adapter.
readonly document: SheetDocumentreadonly editor: SheetEmbeddedEditorContextConstructor selected by the adapter's presentation composition.
class SearCoreEditorAdapter extends SheetEmbeddedEditorSheet adapter that owns one lightweight SearCoreDoc for all embedded cells.
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.
readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
bindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
createEditSession(context: SheetEmbeddedEditorContext, model?: DocEditModel): SheetEditSessiondispose(ownerToken?: object): voidinitialize(context: SheetEmbeddedEditorContext): voidmeasureUnwrapped(document: readonly Schema[], font: string): {
height: number;
width: number;
}Measures persisted rich text with its actual inline styles, without changing the edit session.
Configuration for the Doc instance embedded inside a Sheet cell.
readonly fontFamily: stringDefault font family and fallback list used by the active embedded document editor.
readonly fontSize: numberDefault font size used by the active embedded document editor.
readonly padding: numberPadding between the cell edge and embedded document text.
Configuration for the Sheet-specific SearCore document adapter.
readonly createTextShaper?: (renderContext: RenderContext): TextShaperHost text shaper; defaults to the portable render-context measurement adapter.
readonly embeddedDocConfig?: Partial<EmbeddedDocConfig>Configuration scoped to the Doc embedded inside a Sheet cell.
readonly plugins?: readonly SheetEmbeddedEditorPlugin | SheetEmbeddedEditorPluginImplementation[]Semantic Sheet editing policies. Defaults to clipboard and formula-reference policies.
readonly viewExtensions?: readonly SheetEmbeddedEditorView | SheetEmbeddedEditorViewImplementation[]Adapter presentation contributions; an empty list installs no default geometry or overflow views.
readonly source: StateObservationSource<Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>>notify(): voidCreates the lightweight SearCore editor used by Sheet embedded cells.
registerSheetEmbeddedInlineStyleObservation(observations: ObservationRegistry, readSession: (): {
readonly document: readonly RichDocNode[];
readonly selection: DocSelection;
readonly typingStyle: Readonly<Record<string, unknown>>;
} | null, inlineStyles: RichTextInlineStyleRegistry): SheetEmbeddedInlineStyleObservationControllerRegisters the selection-derived inline-style state with an embedded editor.
Built-in defaults for a Doc instance embedded inside a Sheet cell.
Transactional Sheet composition independent of presentation.
class DefaultSheetClipboardDataSource extends SheetClipboardDataSourceDefault data source bridging clipboard commands to the active Sheet data view.
DefaultSheetClipboardDataSource(dataEngine: DataEngine, queries: SheetQueryRegistry, ownerFormats: SheetFormatTransferRegistry, ownerClipboard: SheetClipboardTransferRegistry, platform: Platform, rangeMoves: SheetRangeMoveRegistry, cutSession: SheetClipboardCutSession, identity: SheetClipboardSheetIdentity, inputValidation: SheetCellInputValidationRegistry): DefaultSheetClipboardDataSourcereadonly cutSession: SheetClipboardCutSessionreadonly cutSourceId: stringreadonly formatTarget: PluginKeybindFormulaResults(results: IFormulaResultProvider): voidbindPreviewRuntime(core: SheetKernel, plugins: PluginManager, bridge: SheetClipboardWorkbookBridge | null): voidcaptureMergedRanges(range: SheetRangeBounds): readonly SheetClipboardMergedRange[]captureOwnerData(range: SheetRangeBounds): readonly SheetPortableClipboardTransfer[]captureOwnerFormats(range: SheetRangeBounds): readonly SheetPortableFormatTransfer[]clearOwnerData(range: SheetRangeBounds): readonly SheetClipboardTransferPlan[]clearOwnerFormats(range: SheetRangeBounds): readonly SheetFormatTransferPlan[]createClipboardCutId(): stringgetColumnCount(): numbergetMergedRange(row: number, column: number): SheetRangeBounds | nullOptional host projection for rejecting writes hidden by merged cells.
getRowCount(): numbergetSelection(): SheetRangeBounds | nullisRowVisible(row: number): booleanplanClearMergedRanges(range: SheetRangeBounds): {
operations: UpdateCellOTOperation<SheetCellMerge>[];
target: PluginKey;
}planOwnerData(requests: readonly SheetClipboardTransferRequest[]): readonly SheetClipboardTransferPlan[]planOwnerFormats(captured: readonly SheetPortableFormatTransfer[], target: SheetRangeBounds): readonly SheetFormatTransferPlan[]planPasteMergedRanges(merges: readonly SheetClipboardMergedRange[], target: SheetClipboardCellPoint): {
operations: UpdateCellOTOperation<SheetCellMerge>[];
target: PluginKey;
}planRangeMove(source: SheetClipboardRangeInput, destination: SheetClipboardRangeInput): readonly SheetRangeMovePlan[]prepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): voidreadCell(row: number, column: number): CellMatrixElement | nullreadCellFormat(row: number, column: number): CellFormat | nullreadCopyCell(row: number, column: number): CellMatrixElement | nullOptional displayed value for copy sources that have no persisted cell.
readCopyValueCell(row: number, column: number): CellMatrixElement | nullOptional calculated cell snapshot for values-only paste.
scheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>validateCutCell(row: number, column: number): SheetCellInputValidationResultOptional protection check before cutting an occupied source cell.
validatePasteCell(row: number, column: number, cell: CellMatrixElement | null): SheetCellInputValidationResultOptional editor-local validation applied before any pasted value is written.
Owns an optional work-priority projection without constructing a view.
bind(provider: SheetFormulaPriorityProvider): voidAttaches a projection before the owning scheduler starts.
read(): SheetFormulaPriorityProvider | undefinedReads the optional host work-priority projection.
static readonly symbol: typeof symbolclass SheetFormulaSchedulerDataSource extends FormulaSchedulerDataSourceDefault sheet adapter for formula scheduler data access.
This assembly-owned adapter converts render/runtime services into the narrow formula scheduler contract, keeping RecalcScheduler independent from DataEngine, ScrollManager, resize readers, and render viewport math.
SheetFormulaSchedulerDataSource(dataEngine: DataEngine, priority: SheetFormulaPriority, platform: Platform, localeProvider?: IFormulaLocaleProvider, textServiceProvider?: IFormulaTextServiceProvider, externalServices?: IFormulaExternalServiceProvider, functions?: IFunctionRegistry, xmlXPath?: XmlXPathEvaluator, formulaSource?: IFormulaSourceProvider, dateSystemProvider?: IFormulaDateSystemProvider, formulaParser?: IFormulaParser, workbookMetadata?: IFormulaWorkbookMetadataProvider): SheetFormulaSchedulerDataSourcecreateEvalContext(resultStore: FormulaResultStore): EvalContextBuilds the latest evaluation context for a recalculation batch.
ReturnsEvalContext for the current committed sheet snapshot.
resultStorePer-client derived formula result store used when formula cells reference formula cells.
getViewportFormulaKeys(formulaKeys: Iterable<number>): Set<number>Selects formula keys that are currently visible and should be evaluated first.
ReturnsFormula keys inside the current visible viewport.
formulaKeysFormula AST keys known to the scheduler.
getVisibleOrigin(): {
col: number;
row: number;
}Reads the first visible cell for formulas that depend on viewport position.
isSpillObstacleTransaction(transaction: Transaction): booleanIdentifies host-owned changes that can block or unblock projected array results.
onExternalServiceInvalidated(handler: (functionNames: readonly string[]): void): (): voidWakes functions whose descriptors depend on an invalidated service.
onViewportChanged(handler: (): void): (): voidSubscribes only when a host work-priority projection is attached.
static readonly symbol: typeof symbolDI token for resolving SheetFormulaSchedulerDataSource.
Owns Sheet state reduction, command transactions and publication without presentation services.
SheetKernel(manager: PluginManager, data: SheetDataEngine, config: ConfigEngine, interactions: SheetInteractionStore, steps: PipelineStepExecutorRegistry, platform: Platform, owners: SheetOwnerLifecycle): SheetKernelreadonly configEngine: ConfigEnginereadonly dataEngine: SheetDataEnginereadonly pluginManager: PluginManagerdestroy(token?: object): voidReleases state publication listeners.
enforceCommandBoundary(isExecuting: (): boolean): voidInstalls the owning command dispatch boundary.
enforceTeardownBoundary(token: object): voidReserves destruction for the owning editor.
executePipeline(pipeline: Pipeline): voidStages a pipeline's changes and commits them before notifying subscribers.
State-changing steps require an active command when the editor has installed its command boundary. A failure during staging rolls back prepared work and leaves the staged plugin state uncommitted. Successful commits notify plugins before independent consumers receive the publication.
Reads metadata from the latest delivered publication.
getOwnerState(key: PluginKey): unknownReads the committed state of one owner.
initialize(): voidRegisters state owners and their initial sparse indexes.
previewTransactionStates(transactions: readonly Transaction<Operation>[]): ReadonlyMap<PluginKey, unknown>Stages document transactions for a command without publishing their states.
start(): voidStarts lifecycle-owned business subscriptions.
subscribeCommits(listener: (snapshot: SheetCommitSnapshot): void): (): voidObserves immutable commit metadata without subscribing to a view.
subscribePublications(listener: (commit: SheetKernelPublication): void): (): voidAttaches an independent committed-state consumer.
static readonly symbol: symbolStarts and releases the business controllers owned by one Sheet kernel.
destroy(): voidReleases business subscriptions in reverse ownership order.
register(controller: SheetOwnerController): voidRegisters a controller during composition only.
start(): voidStarts every business controller after state initialization.
static readonly symbol: typeof symbolinterface CaptureSheetSessionStateCommandResult extends SheetCommandResultResult of capturing editor-local state for an in-memory workbook remount.
readonly sessionState: SheetSessionStateInitial state required by the default sheet feature bundle.
readonly cellAlignments: AlignmentMatrixSparse matrix containing cell alignment settings.
readonly cellBorders?: CellBorderMatrixSparse custom borders supplied by the host, or initially empty.
readonly cellFills: CellFillMatrixSparse matrix containing cell fill settings.
readonly cellFormats: CellFormatMatrixSparse matrix containing explicit cell number formats.
readonly cellHighlights: CellHighlightMatrixSparse conditional rules stored at range anchors.
readonly cellMerges: CellMergeMatrixSparse matrix containing merged-cell anchors and end coordinates.
readonly cellTextStyles?: CSRMatrix<SheetCellTextStyle | null>Sparse matrix containing cell vertical alignment settings.
readonly columnSizes: ColumnShapeDimensionsCSRMatrixColumn dimension matrix used by layout and rendering.
readonly dataValidations?: DataValidationMatrixreadonly duplicates: DuplicateMatrixSparse matrix containing duplicate-item highlight settings.
readonly filters?: SheetFilterMatrixreadonly fixedRows?: FixedRowMatrixSparse matrix containing fixed row settings.
readonly freeze?: SheetFreezeMatrixreadonly rowSizes: RowShapeDimensionsCSRMatrixRow dimension matrix used by layout and rendering.
readonly sheetData: SheetMatrixMain sparse matrix containing persisted sheet cell values.
Source projection shared with sparse conditional range consumers.
forEachValueInRange(top: number, left: number, bottom: number, right: number, visit: (display: string, raw: unknown): void): voidVisits persisted and projected values without traversing empty area.
readValue(row: number, column: number): unknownReads current values, including formulas.
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.
readonly sheetState: SheetDocumentStateCloned state payload suitable for workbook persistence or sheet remounting.
Workbook-owned endpoint for an atomic move between two sheets.
commitMove(cutId: string, sourceId: string, targetId: string, targetAfter: SheetDocumentState): Promise<void>prepareCut(cutId: string, sourceId: string, sourceBefore: SheetDocumentState, clearedSource: SheetDocumentState): voidDetached metadata for one completed Sheet state/effect publication.
readonly changedOwners: readonly string[]readonly revision: numberOptional host projection used only to prioritize pending formula work.
readOrigin(): {
readonly col: number;
readonly row: number;
}readRange(): {
readonly endCol: number;
readonly endRow: number;
readonly startCol: number;
readonly startRow: number;
}subscribe(listener: (): void): (): voidInputs for a business-only Sheet editor.
readonly adapters: SheetRuntimeAdaptersreadonly cellFontFamily?: stringreadonly cellFontSize?: numberreadonly plugins?: readonly SheetPluginImplementation<SheetPlugin<unknown>>[]readonly sessionState?: Readonly<Record<string, unknown>>readonly sheetState: SheetDocumentStateonCreated(editor: SheetEditor): voidA business runtime concern with no presentation context.
Business services supplied to an editor-local Plugin registration phase.
readonly configEngine: ConfigEnginereadonly dataEngine: SheetDataEnginereadonly pluginManager: PluginManagerHost services required by the Sheet business runtime.
readonly clipboard?: RuntimeServiceImplementation<SheetClipboard>readonly fileDownload?: RuntimeServiceImplementation<FileDownload>readonly platform: RuntimeServiceImplementation<Platform>readonly xmlXPathEngine?: RuntimeServiceImplementation<XmlXPathEngine>registerEnvironment(container: Container): voidtype RuntimeServiceImplementation = (...args: never[]): ServiceConstructor registered in an editor-local service container.
type SheetKernelPublication = StateKernelCommit<Plugin<unknown>, Transaction, SheetProjectionInvalidation>One committed state/effect publication available to independent consumers.
bindSheetKernelCommands(container: Container, kernel: SheetKernel, runtime: SheetPluginSetupRuntime): voidConnects commands and observations directly to the transactional kernel.
createCellHighlightValueSource(readMatrix: (): SheetMatrix, readCodecs: (): CellClipboardCodecRegistry | null, readFormulaResults: (): IFormulaResultProvider | null): {
forEachNumericValueInRange: CellHighlightNumericRangeReader;
forEachValueInRange: CellHighlightValueRangeReader;
forEachValueWithCoordinatesInRange: (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: unknown, row: number, column: number): void): void;
readNumericValue: (row: number, column: number): number | null;
readValue: CellHighlightValueReader;
}Composes persisted cells and derived formula projections for highlight evaluation.
Creates an isolated Sheet business editor without presentation services.
createSheetPluginSetupRuntime(options: SheetPluginRuntimeOptions): {
cells: { catalog: CellTypeCatalog };
config: ConfigEngine<any>;
data: SheetDataEngine;
extensions: SheetRuntimeExtensionRegistry;
formula: {
externalServices: IFormulaExternalServiceProvider;
functions: IFunctionRegistry;
results: FormulaResultProviderRegistry;
richResults: FormulaRichResultProviderRegistry;
sources: FormulaSourceProviderRegistry;
textServices: IFormulaTextServiceProvider;
webService: WebServiceClient;
xmlXPath: XmlXPathEvaluator;
};
interaction: {
pipelineSteps: PipelineStepExecutorRegistry;
reducers: SheetInteractionReducerRegistry;
store: SheetInteractionStore;
};
observations: ObservationRegistry;
platform: Platform;
plugins: PluginManager;
queries: SheetQueryRegistry;
session: SessionStateRegistry;
styles: SheetCellStyleReader;
}Creates the neutral state, command, query and observation setup runtime.
createSheetSortValueReader(readMatrix: (): SheetMatrix, readCodecs: (): CellClipboardCodecRegistry, readFormulaResults: (): IFormulaResultProvider): (row: number, column: number): SheetSortValueReads the user's value projection while preserving numeric comparison semantics.
findNestedAggregateFormulaName(formula: string, parser: IFormulaParser): string | undefinedparseSheetFilterDate(value: unknown, dateSystem: IFormulaDateSystemProvider): number | nullConverts ISO date input to the workbook's Excel serial system.
prepareSheetKernel(container: Container, lifecycle: EditorLifecycleStack, options: SheetKernelConfiguration): {
configEngine: ConfigEngine<SheetConfig>;
dataEngine: SheetDataEngine;
editor: SheetEditor;
kernel: SheetKernel;
runtime: {
cells: { catalog: CellTypeCatalog };
config: ConfigEngine<any>;
data: SheetDataEngine;
extensions: SheetRuntimeExtensionRegistry;
formula: {
externalServices: IFormulaExternalServiceProvider;
functions: IFunctionRegistry;
results: FormulaResultProviderRegistry;
richResults: FormulaRichResultProviderRegistry;
sources: FormulaSourceProviderRegistry;
textServices: IFormulaTextServiceProvider;
webService: WebServiceClient;
xmlXPath: XmlXPathEvaluator;
};
interaction: {
pipelineSteps: PipelineStepExecutorRegistry;
reducers: SheetInteractionReducerRegistry;
store: SheetInteractionStore;
};
observations: ObservationRegistry;
platform: Platform;
plugins: PluginManager;
queries: SheetQueryRegistry;
session: SessionStateRegistry;
styles: SheetCellStyleReader;
};
initialize(attachPresentation?: (): void): void;
seal(): (): void;
sealCommands(): void;
start(): void;
}Prepares one business runtime shared by Headless and visual Sheet hosts.
previewSheetDocumentState(core: SheetKernel, pluginManager: PluginManager, transactions: readonly Transaction<Operation>[]): SheetDocumentStateCaptures owner-contributed document state after staging, without committing it.
projectSheetTransaction(plugins: PluginManager, transaction: Transaction, readState: (plugin: Plugin<unknown>): unknown): readonly Transaction<Operation>[]Plans prerequisites once, retaining original origin metadata and each contributor's ownership.
readFormattedNumberCellColor(cell: CellMatrixElement | null, format: unknown, locale: CellFormatLocale): string | nullReads the same numeric display color used by the cell renderer.
readRichTextCellColor(cell: CellMatrixElement | null): string | nullReturns the explicit color shared by every text node in a rich-text cell.
registerDefaultSheetFeatures(container: Container, manager: PluginManager, adapters: SheetRuntimeAdapters, state: DefaultSheetFeatureState): voidRegisters the default sheet data, render, interaction, formula, and collaboration plugins.
containerAssembly DI container.
managerPlugin manager receiving the default plugin instances.
adaptersPlatform adapters supplied by the host.
stateInitial sheet state consumed by the feature-owned data plugins.
registerDefaultSheetRangeCommands(commands: SheetCommandBus, dataEngine: DataEngine, inputValidation: SheetCellInputValidationRegistry): voidRegisters public range editing commands for the default sheet assembly.
registerDefaultSheetStructureCommands(commands: SheetCommandBus, dataEngine: DataEngine, moves: SheetStructureMoveRegistry): voidRegisters public row/column insertion and deletion commands for the default sheet assembly.
registerSheetBaseServices(container: Container, adapters: Pick<SheetRuntimeAdapters, "platform" | "xmlDocumentParser" | "xmlXPathEngine" | "xmlXPathEvaluator" | "webServiceClient">, defaultConfigOverrides?: EditorDefaultConfigOverrides<SheetConfig>): {
configEngine: ConfigEngine<SheetConfig>;
dataEngine: SheetDataEngine;
}Registers platform and business state services without allocating presentation resources.
registerSheetCheckboxPlugin(container: Container, manager: PluginManager): voidInstalls checkbox capabilities through the cell catalog and editor-local extension registries.
registerSheetClearStylePlugin(container: Container, manager: PluginManager): voidShares owner contributions without coupling clear-style behavior to any concrete format feature.
registerSheetClipboardPlugin(container: Container, manager: PluginManager): voidRegisters clipboard services, plugin, and keyboard shortcuts.
registerSheetClipboardTransfers(plugins: readonly unknown[], registry: SheetClipboardTransferRegistry): voidInvokes the clipboard-transfer lifecycle for built-in and third-party owners.
registerSheetCollaborationPlugin(container: Container, manager: PluginManager, adapters: SheetRuntimeAdapters): voidRegisters sheet collaboration transport, channel binding, plugin, and lifecycle ownership.
registerSheetConfigCommands(commands: SheetCommandBus, config: ConfigEngine<SheetConfig>): voidRegisters Sheet configuration changes on the owning command bus.
registerSheetDropdownPlugin(container: Container, manager: PluginManager, source: DropdownSourceProjection): voidComposes dropdown interactions over the existing validation and cell owners.
registerSheetEditingFeatures(container: Container, manager: PluginManager): voidRegisters selection and document editing without native input or drawing services.
registerSheetFormatPainterPlugin(container: Container, manager: PluginManager): voidWires format painting without moving any format state out of its owner.
registerSheetFormatTransfers(plugins: readonly unknown[], formats: SheetFormatTransferRegistry): voidInvokes the same format-transfer lifecycle for built-in and third-party owners.
registerSheetFormulaPlugin(container: Container, manager: PluginManager): voidRegisters formula services and exposes the formula plugin as a render display provider.
registerSheetHistoryPlugin(container: Container, manager: PluginManager): voidRegisters editor-local history as both a feature plugin and lifecycle controller.
registerSheetInputValidationCommands(commands: SheetCommandBus, validation: SheetCellInputValidationRegistry): voidInstalls the input-validation registry's runtime disposal command.
registerSheetKernelContributions(container: Container, runtime: SheetPluginSetupRuntime, options: Pick<SheetKernelConfiguration, "sessionState">): voidRegisters business contributions and default state commands through one shared assembly path.
registerSheetPostFormulaFeatures(container: Container, manager: PluginManager, dimensions: SheetResizeDimensions): voidRegisters dimension and selection state owners after formula providers are ready.
registerSheetRangeMoves(plugins: readonly unknown[], registry: SheetRangeMoveRegistry): voidInvokes the optional range-move lifecycle hook of built-in and third-party plugins.
registerSheetRangeReorders(plugins: readonly unknown[], registry: SheetRangeReorderRegistry): voidInvokes owner-provided range-reorder planners, including third-party plugins.
registerSheetRuntimeServices(container: Container, adapters: SheetRuntimeAdapters): { pluginManager: PluginManager }Registers command, query, clipboard and state-owner runtime services.
registerSheetSessionStateCommands(commands: SheetCommandBus, session: SessionStateRegistry): voidRegisters the in-memory Sheet session capture command.
registerSheetStateSnapshotCommands(commands: SheetCommandBus, pluginManager: PluginManager): voidRegisters sheet state snapshot commands for the default sheet assembly.
registerSheetStructureMoves(plugins: readonly unknown[], registry: SheetStructureMoveRegistry): voidInvokes owner-provided structure-move planners without enumerating feature packages.
resolveSheetFormulaTextReference(text: string, options: FormulaReferenceResolutionOptions | undefined, shape: readonly [number, number]): FormulaError | ResolvedFormulaRangeResolves text references against the current Sheet's finite document shape.
sealSheetKernelRuntime(container: Container, runtime: SheetPluginSetupRuntime, lifecycle: EditorLifecycleStack): (): voidSeals editor-owned business registries and grants teardown authority only to the editor owner.
sealSheetPluginTeardownWrites(plugins: readonly Plugin<unknown>[], assertWrite: (): void): voidKeeps retained plugin instances from clearing live editor sessions directly.
CaptureSheetSessionStateCommand: SheetCommandDefinition<void, CaptureSheetSessionStateCommandResult>Captures local state that must survive switching away from one workbook sheet.
Host command that exports a cloned state snapshot for the active SheetEditor.
Current publication revision and changed owner identities; subscribes without requiring a view.
Removes one editor-local input validator through the Sheet command bus.
UpdateSheetDefaultConfigCommand: SheetCommandDefinition<EditorDefaultConfigOverrides<SheetConfig>, SheetCommandResult>Updates editor-local Sheet defaults without changing document state.
Canonical Sheet document state, codecs and snapshot construction.
Document data owned by one sheet and eligible for future ExportPlugin serialization.
Sparse custom cell-edge state; absence initializes an empty border owner.
Sparse cell fill state.
Sparse per-cell number-format state.
Sparse conditional highlight rules anchored at their range starts.
readonly cellTextStyles?: CSRMatrix<SheetCellTextStyle | null>Sparse vertical cell alignment state.
Sparse data validation rules anchored at range starts.
Sparse duplicate-item highlight state.
Sheet-owned filter range and column rules.
Sparse per-row fixed state.
Persistent top and left freeze boundaries.
Takes ownership of an input Sheet snapshot without retaining caller-owned mutable values.
Detaches input for a runtime that immediately locks the result as committed state.
Creates the default registry for built-in Sheet document-state modules.
createEmptySheetDocumentState(rowCount: number, columnCount: number): SheetDocumentStateCreates an empty Sheet document with matching dimensions for import adapters.
deserializeSheetDocumentState<TSheetState>(payload: unknown, registry?: DocumentStateCodecRegistry<TSheetState>, path?: string): TSheetStateDeserializes one Sheet document state through registered state-owner codecs.
lockCommittedSheetState(state: unknown): voidLocks document-owned Sheet data after a successful initialization or commit.
requireCompleteSheetDocumentState<TSheetState>(partial: Partial<TSheetState>, path: string): TSheetStateserializeSheetDocumentState<TSheetState>(sheetState: TSheetState, registry?: DocumentStateCodecRegistry<TSheetState>): SearSheetDocumentFileSerializes one Sheet document state through registered state-owner codecs.
adoptCommittedPluginState<T>(state: T): TTakes ownership of committed data without retaining extension-owned matrix instances.
lockCommittedPluginState(state: unknown): voidLocks a plugin-owned committed value, including nested matrix state.
Workbook state, commands, history and business plugin contracts.
Public configuration accepted by createWorkbookEditor().
readonly adapters: SheetRuntimeAdaptersreadonly captureSheetState?: WorkbookSheetStateCapturereadonly documentState: WorkbookDocumentState<SheetDocumentState>readonly onCreated?: (editor: WorkbookEditor): voidOne-time assembly callback for registering host-owned commands.
readonly plugins?: readonly WorkbookPluginImplementation<WorkbookPlugin>[]readonly sessionState?: Readonly<Record<string, unknown>>readonly sheetClientFactory?: WorkbookSheetClientFactoryreadonly sheetPlugins?: readonly SheetPluginImplementation<SheetPlugin<unknown>>[]readonly warn?: (message: string, ...details: unknown[]): voidInput passed when the workbook assembly creates one active SheetEditor.
readonly configuration: SheetKernelConfigurationreadonly sheetId: stringtype WorkbookSheetClientFactory = (input: WorkbookSheetClientFactoryInput): SheetEditorcreateWorkbookRuntime(configuration: WorkbookRuntimeConfiguration): 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.
const workbook = createWorkbookRuntime(configuration);
await workbook.commands.run(ActivateWorkbookSheetCommand, { sheetId });
workbook.destroy();configurationWorkbook document state, host adapters, and Workbook and Sheet plugins.
class WorkbookPlugin extends PluginExtension<WorkbookCommandBus, ObservationRegistry, SessionStateRegistry, WorkbookRuntimeExtensionRegistry>Base contract for plugins owned by createWorkbookEditor().
enforceRuntimeWriteBoundary(assertWrite: (): void): voidCloses plugin-owned runtime mutations after Workbook assembly.
getSheetPlugins(context: WorkbookCompanionSheetPluginContext): readonly SheetPluginImplementation<SheetPlugin<unknown>>[]getSheetServices(context: WorkbookCompanionSheetPluginContext): readonly WorkbookCompanionSheetService<unknown>[]Contributes parent-owned services without exposing the child editor container.
initialize(context: WorkbookPluginContext): void | WorkbookPluginDisposerCompletes setup after command, query and observation registrations are available.
onBeforeSheetActivation(input: ActivateWorkbookSheetCommandInput): voidRuns inside the activation command before the source Sheet is captured.
onSheetActivationFailed(input: ActivateWorkbookSheetCommandInput): voidRestores plugin-local work if activation fails before commit.
onTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidonWorkbookDestroy(context: WorkbookPluginContext): voidregisterCapabilities(registry: WorkbookRuntimeExtensionRegistry): voidPublishes editor-local typed capabilities for other extensions.
registerCommands(commands: WorkbookCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
registerObservations(observations: ObservationRegistry): voidRegisters state or event sources whose subscriptions are owned by this editor.
registerSessionState(registry: SessionStateRegistry): voidRegisters detachable local session state separately from durable document content.
static registerServices(context: WorkbookPluginServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
Public workbook facade returned by createWorkbookEditor().
readonly commands: WorkbookCommandBusThe supported command entry point for workbook user and program actions.
readonly document: WorkbookDocumentApiRead-only access to document-owned workbook state.
readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
readonly services: RuntimeCapabilityReaderRead-only access to typed services owned by this editor's isolated runtime.
readonly sheets: WorkbookSheetsApiRead-only access to the active and mounted SheetEditor.
destroy(): voidReleases the active SheetEditor, plugins, observations, commands, and editor-local services.
Context passed to Workbook plugin lifecycle hooks.
Editor-local dependency container available only during composition.
readonly runtime: WorkbookPluginRuntimeCapabilities owned by the currently assembled editor instance.
interface WorkbookPluginImplementation<TPlugin>Injectable Workbook plugin class accepted by createWorkbookEditor().
WorkbookPluginImplementation(...args: never[]): TPluginreadonly symbol: symbolDependency injection token for this editor-local implementation.
registerServices(context: WorkbookPluginServiceContext): voidRegisters editor-local dependencies before this contribution is constructed.
Runtime services exposed to Workbook plugins for one WorkbookEditor instance.
readonly commands: WorkbookCommandBusThe owning typed dispatcher through which state mutations are executed.
readonly document: WorkbookDocumentApireadonly extensions: WorkbookRuntimeExtensionRegistryEditor-local registry of typed capabilities, without global mutable registrations.
readonly formula: {
readonly externalServices: IFormulaExternalServiceProvider;
readonly functions: IFunctionRegistry;
readonly textServices: IFormulaTextServiceProvider;
readonly webService: WebServiceClient;
readonly xmlXPath: XmlXPathEvaluator;
}Formula functions, sources, results and external data capabilities.
readonly observations: ObservationRegistryTyped state and event subscriptions; listeners receive no mutation authority.
readonly session: SessionStateRegistryCapture and restoration registry for detachable local state.
readonly sheets: WorkbookSheetClientsApicreateCommandResult(activeSheetEditorChanged: boolean): WorkbookCommandResultReturns the current result shape for a command that performs no mutation.
executeTransaction(transaction: WorkbookTransaction): WorkbookCommandResultCommits a transaction assembled inside a typed Workbook command.
Services available before a Workbook plugin is registered in its editor-local container.
type WorkbookPluginDisposer = (): voidResource disposer returned by Workbook plugin lifecycle hooks.
cloneWorkbookEditorDocumentState(document: WorkbookDocumentState<SheetDocumentState>, cloneSheet?: (state: SheetDocumentState): SheetDocumentState): WorkbookDocumentState<SheetDocumentState>Detaches the Workbook document and every Sheet payload from caller-owned state.
defineWorkbookRuntimeCapability<T>(id: string): WorkbookRuntimeCapabilityToken<T>Creates a typed capability published by a Workbook plugin.
registerWorkbookPluginCapabilities(plugins: readonly unknown[], registry: WorkbookRuntimeExtensionRegistry): voidPublishes every typed runtime capability contributed by Workbook plugins.
registerWorkbookPluginCommands(plugins: readonly unknown[], commands: WorkbookCommandBus): voidregisterWorkbookPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): voidregisterWorkbookPluginSessionStates(plugins: readonly unknown[], session: SessionStateRegistry): voidresolveWorkbookPlugins(container: Container, implementations: readonly WorkbookPluginImplementation<WorkbookPlugin>[]): WorkbookPlugin[]Resolves isolated Workbook plugin singletons from one editor-local container.
sealWorkbookPluginTeardownWrites(plugins: readonly WorkbookPlugin[], assertWrite: (): void): voidProtects plugin cleanup entry points while the Workbook is active.
Workbook capabilities registered by the default assembly root.
readonly Formula: WorkbookRuntimeCapabilityToken<{
readonly externalServices: IFormulaExternalServiceProvider;
readonly functions: IFunctionRegistry;
readonly textServices: IFormulaTextServiceProvider;
readonly webService: WebServiceClient;
readonly xmlXPath: XmlXPathEvaluator;
}>readonly Platform: WorkbookRuntimeCapabilityToken<Platform>Input for activating a workbook sheet.
readonly sheetId: stringSheet id to make active.
Input for hiding a workbook sheet.
readonly nextActiveSheetId?: stringOptional active sheet to select when hiding the current active sheet.
readonly sheetId: stringSheet id to hide.
Input for unhiding a workbook sheet.
readonly sheetId: stringSheet id to reveal.
Workbook access to independently owned Sheet command/query/subscription protocols.
Read-only access to SheetEditor instances owned by one WorkbookEditor.
Returns the SheetEditor mounted for the active sheet.
getActiveId(): stringReturns the stable id of the active sheet.
getEditor(sheetId: string): SheetEditor | nullReturns the mounted SheetEditor when sheetId is active; detached sheets return null.
type AddWorkbookSheetCommandInput = AddWorkbookSheetInput<SheetDocumentState> & { readonly activate?: boolean }Input for adding a sheet to the workbook.
Input for moving a sheet tab.
type RemoveWorkbookSheetCommandInput = RemoveWorkbookSheetInput & { readonly nextActiveSheetId?: WorkbookSheetId }Input for removing a sheet from the workbook.
Input for renaming a workbook sheet.
firstVisibleSheetId(documentState: WorkbookDocumentState): stringActivateWorkbookSheetCommand: WorkbookCommandDefinition<ActivateWorkbookSheetCommandInput, WorkbookCommandResult>Official command for activating a workbook sheet.
AddWorkbookSheetCommand: WorkbookCommandDefinition<AddWorkbookSheetCommandInput, WorkbookCommandResult>Official command for adding a sheet descriptor and sheet state payload.
HideWorkbookSheetCommand: WorkbookCommandDefinition<HideWorkbookSheetCommandInput, WorkbookCommandResult>Official command for hiding a workbook sheet.
Official command for moving a workbook sheet tab.
RemoveWorkbookSheetCommand: WorkbookCommandDefinition<RemoveWorkbookSheetCommandInput, WorkbookCommandResult>Official command for removing a sheet descriptor and sheet state payload.
RenameWorkbookSheetCommand: WorkbookCommandDefinition<RenameWorkbookSheetInput, WorkbookCommandResult>Official command for renaming a workbook sheet.
UnhideWorkbookSheetCommand: WorkbookCommandDefinition<UnhideWorkbookSheetCommandInput, WorkbookCommandResult>Official command for unhiding a workbook sheet.
WorkbookSheetListObservation: StateObservationDefinition<readonly Pick<WorkbookSheetDescriptor, "id" | "name" | "color" | "hidden">[]>Ordered sheet properties used by workbook navigation, published on document changes.
Read-only access to the document-owned state of one WorkbookEditor.
Returns the current in-memory workbook document state.
interface WorkbookDocumentStateSerializationOptions<TSheetState>Options for workbook document-state serialization.
readonly sheetRegistry?: DocumentStateCodecRegistry<TSheetState>Registry that owns Sheet document-state module serialization.
Read-only active SheetEditor capture hook used by custom hosts and focused tests.
readonly documentState: WorkbookDocumentState<SheetDocumentState>readonly editor: SheetEditorreadonly sheetId: stringreadonly sheetState: SheetDocumentStatetype WorkbookSheetStateCapture = (input: WorkbookSheetStateCaptureInput): SheetDocumentStatedeserializeWorkbookDocumentState<TSheetState>(payload: unknown, options?: WorkbookDocumentStateSerializationOptions<TSheetState>): WorkbookDocumentState<TSheetState>Deserializes a stable SearSuite JSON workbook file into runtime document state.
serializeWorkbookDocumentState<TSheetState>(documentState: WorkbookDocumentState<TSheetState>, options?: WorkbookDocumentStateSerializationOptions<TSheetState>): SearWorkbookFile<WorkbookSheetDescriptor>Serializes a workbook document state into the stable SearSuite JSON format.
WorkbookDocumentStateObservation: StateObservationDefinition<WorkbookDocumentState<SheetDocumentState>>Current workbook-owned metadata and per-sheet document payloads.
Owns built-in workbook session values without exposing their shape to aggregate capture.
WorkbookSessionStore(documentState: WorkbookDocumentState): WorkbookSessionStorebindActiveSheetCapture(capture: (): {
readonly sheetId: string;
readonly state?: Readonly<Record<string, unknown>>;
}): voidclear(lifecycleToken?: object): voidenforceCommandBoundary(isExecuting: (): boolean, lifecycleToken: object): voidRestricts runtime session changes to this editor's command dispatch.
getActiveSheetId(): stringgetSheetSessionState(sheetId: string): Readonly<Record<string, unknown>> | undefinedregisterSessionState(registry: SessionStateRegistry): voidRegisters the built-in contributors beside third-party workbook contributors.
removeMissingSheets(liveSheetIds: ReadonlySet<string>, ownerToken?: object): voidsetActiveSheetId(sheetId: string, ownerToken?: object): voidsetSheetSessionState(sheetId: string, state: Readonly<Record<string, unknown>> | undefined, ownerToken?: object): voidvalidate(documentState: WorkbookDocumentState): voidstatic readonly symbol: typeof symbolCaptured local state for remounting one WorkbookEditor runtime.
readonly sessionState: WorkbookSessionStateCurrent workbook-owned document snapshot.
readonly documentState: WorkbookDocumentState<SheetDocumentState>Current live SheetEditor mounted by one WorkbookEditor instance.
readonly editor: SheetEditorLive editor owned by the workbook assembly.
readonly sheetId: stringStable id of the sheet mounted by the live editor.
interface WorkbookCompanionSheetPluginContext extends WorkbookPluginContextContext used when a Workbook plugin contributes plugins to a mounted SheetEditor.
readonly sheetId: stringreadonly sheetState: SheetDocumentStateinterface WorkbookCompanionSheetService<Value>One typed service value contributed to a temporary child SheetEditor container.
Read-only active SheetEditor session capture hook.
readonly editor: SheetEditorreadonly sessionState: Readonly<Record<string, unknown>> | undefinedreadonly sheetId: stringOpaque editor-local workbook state keyed by contributor-owned definitions.
type WorkbookSheetSessionStateCapture = (input: WorkbookSheetSessionStateCaptureInput): SheetSessionState | undefinedCurrent live active SheetEditor, updated only when the mounted editor changes.
Stable session identity for the locally active workbook sheet.
WorkbookSheetSessionsStateDefinition: SessionStateDefinition<Readonly<Record<string, Readonly<Record<string, unknown>>>>>Stable session identity for detached SheetEditor snapshots keyed by sheet id.
class WorkbookFormulaObjectsPlugin extends WorkbookPluginWorkbook-owned editing surface for named formulas and table references.
initialize(context: WorkbookPluginContext): voidCompletes setup after command, query and observation registrations are available.
onTransactionCommitted(): voidonWorkbookDestroy(): voidregisterCommands(commands: WorkbookCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
registerObservations(observations: ObservationRegistry): voidRegisters state or event sources whose subscriptions are owned by this editor.
static readonly symbol: typeof symbolreadonly names?: Readonly<Record<string, string>>readonly tables?: readonly WorkbookFormulaTable[]bindWorkbookFormulaObjects(ast: FormulaAST, parser: IFormulaParser, state: WorkbookDocumentState<SheetDocumentState>): {
ast: FormulaAST;
expanded: boolean;
}Resolves workbook-owned names and table columns before dependency extraction.
renameWorkbookFormulaObjectsSheet(state: WorkbookDocumentState<SheetDocumentState>, previousName: string, nextName: string): WorkbookDocumentState<SheetDocumentState>Keeps document-owned names and tables attached to their sheet after a rename.
RemoveWorkbookDefinedNameCommand: WorkbookCommandDefinition<{ readonly name: string }, void>RemoveWorkbookFormulaTableCommand: WorkbookCommandDefinition<{ readonly name: string }, void>WorkbookFormulaObjectsMetadataKey: "searsuite.workbook.formulaObjects"Metadata key owned by workbook formula evaluation.
Retains one formula edit while its source sheet is temporarily unmounted.
cancelPendingPick(): voidgetSheetServices(): readonly WorkbookCompanionSheetService<unknown>[]Contributes parent-owned services without exposing the child editor container.
hasPendingPick(): booleaninitialize(context: WorkbookPluginContext): (): voidCompletes setup after command, query and observation registrations are available.
onBeforeSheetActivation(): voidRuns inside the activation command before the source Sheet is captured.
onSheetActivationFailed(): voidRestores plugin-local work if activation fails before commit.
onTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidregisterCommands(commands: WorkbookCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
static readonly symbol: typeof symbolShifts workbook-qualified AST references for one structurally changed sheet.
shiftReferences(input: {
ast: FormulaAST;
changedSheetId: string;
changes: readonly StructureChange[];
sheetBindings: ReadonlyMap<string, string>;
}): WorkbookFormulaReferenceShiftResultShifts workbook references whose stable binding points at the changed sheet.
Dependency entry retained after a workbook formula reference becomes invalid.
readonly kind: "broken"readonly reason: WorkbookFormulaBrokenReferenceReasonreadonly reference: WorkbookFormulaReferencereadonly sheetId: stringResult of applying row/column structure edits to one compiled workbook formula.
readonly changed: booleanWhether formula position, AST, dependencies, or broken-reference metadata changed.
readonly compiled: CompiledWorkbookFormulaUpdated compiled formula.
Result of shifting workbook-qualified formula references in one AST.
readonly ast: FormulaASTShifted AST, or the original AST when no workbook reference changed.
readonly brokenReferences: readonly WorkbookFormulaReference[]References that became invalid because the target row or column was deleted.
readonly changed: booleanWhether the AST identity changed.
Reason a workbook formula reference can no longer resolve.
| Member | Value |
|---|---|
SheetDeleted |
"sheetDeleted" |
ReferenceDeleted |
"referenceDeleted" |
Dependency graph reference entry kind value.
| Member | Value |
|---|---|
Broken |
"broken" |
Dependency entry stored by the workbook formula graph.
isWorkbookFormulaBrokenReference(reference: WorkbookFormulaGraphReference): referenceReports whether one workbook formula graph reference is a retained broken reference.
Cancels a pending cross-sheet reference pick.
Retains the source formula draft before activating another sheet.
PickWorkbookFormulaReferenceCommand: WorkbookCommandDefinition<{
readonly end: Point;
readonly start: Point;
}, void>Applies a picked range to the retained formula draft.
Restores the retained draft when the source sheet becomes active again.
class WorkbookFormulaCompanionSheetPlugin extends Plugin<null>Base contract implemented by sheet and document plugins.
Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.
WorkbookFormulaCompanionSheetPlugin(workbookFormula: WorkbookFormulaPlugin, sheetId: string, workbookObservations: ObservationRegistry): WorkbookFormulaCompanionSheetPluginapply(pluginState: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
configure(context: SheetPluginSetupContext): voidinitialize(context: SheetPluginRuntimeContext): voidonEditorDestroy(): voidonTransactionCommitted(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.
transactionA committed transaction from the completed pipeline.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidProtects workbook reference integrity until cross-sheet moves own a workbook transaction.
registerState(): PluginStateRegistration<null>Registers one or more plugin-owned state records with the host manager.
registerStructureMoves(registry: SheetStructureMoveRegistry): voidProtects persisted qualified references outside the current Sheet transaction.
static readonly symbol: symbolInherited from Plugin.
class WorkbookFormulaCrossSheetHighlightPlugin extends WorkbookPlugin, FormulaCrossSheetHighlightSourceKeeps the selected formula's qualified references visible during a workbook sheet switch.
getReferences(selectionRevision: number, selectionSource?: string): readonly FormulaCrossSheetReference[]getSheetServices(): readonly WorkbookCompanionSheetService<unknown>[]Contributes parent-owned services without exposing the child editor container.
initialize(context: WorkbookPluginContext): (): voidCompletes setup after command, query and observation registrations are available.
static readonly symbol: typeof symbolWorkbook-qualified dependency graph owned by WorkbookFormulaPlugin.
dirtySize: numberNumber of formula cells currently marked dirty.
resultSize: numberNumber of cached formula results currently retained by the workbook graph.
size: numberNumber of formula cells currently registered in the workbook graph.
clear(): voidRemoves every formula and dependency edge.
getBrokenReferences(formulaCell: WorkbookCellReference): readonly WorkbookFormulaBrokenReference[]Returns broken references owned by one formula cell.
getDependencies(formulaCell: WorkbookCellReference): readonly WorkbookFormulaGraphReference[]Returns workbook-qualified dependencies owned by one formula cell.
getDependents(cell: WorkbookCellReference): readonly WorkbookCellReference[]Returns formula cells that currently depend on the given workbook cell.
getDirtyFormulaCells(): readonly WorkbookCellReference[]Returns every workbook-qualified formula cell currently marked dirty.
getFormulaCells(): readonly WorkbookCellReference[]Returns every workbook-qualified formula cell currently registered.
getFormulaResult(formulaCell: WorkbookCellReference): FormulaValue | undefinedReturns a derived workbook formula result, or #REF! when references are broken.
hasBrokenReferences(formulaCell: WorkbookCellReference): booleanReports whether one formula cell currently contains broken references.
hasFormulaCell(formulaCell: WorkbookCellReference): booleanReports whether one workbook-qualified cell is registered as a formula cell.
isDirty(formulaCell: WorkbookCellReference): booleanReports whether one workbook formula cell needs recalculation.
markDirty(changedCells: readonly WorkbookCellReference[]): readonly WorkbookCellReference[]Marks formulas that depend on changed workbook cells as dirty, including transitive formula chains.
markFormulaCellsDirty(formulaCells: readonly WorkbookCellReference[]): voidMarks formula cells themselves dirty after an external evaluation service changes.
removeFormulaCell(formulaCell: WorkbookCellReference): voidRemoves one formula cell and every reverse edge it owns.
removeSheet(sheetId: string): voidRemoves formulas on a deleted sheet and marks references to that sheet as broken.
setFormulaResult(formulaCell: WorkbookCellReference, result: FormulaValue): voidStores a derived workbook formula result and marks the formula clean.
updateFormulaCell(formulaCell: WorkbookCellReference, dependencies: readonly WorkbookFormulaReference[]): voidRegisters dependencies for one workbook-qualified formula cell.
updateFormulaCellReferences(formulaCell: WorkbookCellReference, dependencies: readonly WorkbookFormulaGraphReference[]): voidRegisters graph references for one formula cell, including broken references.
Runtime adapter that evaluates workbook formulas through the shared formula engine.
WorkbookFormulaEvaluationRuntime(input?: {
contextServices?: (): {
readonly dateTimeLocale?: FormulaDateTimeLocale;
readonly externalServices?: FormulaExternalServiceReader;
readonly languageService?: FormulaLanguageService;
readonly phoneticReader?: FormulaPhoneticReader;
readonly textLocale?: FormulaTextLocale;
readonly xmlXPath?: XmlXPathEvaluator;
};
evaluator?: IFormulaEvaluator;
parser?: IFormulaParser;
}): WorkbookFormulaEvaluationRuntimeCreates a workbook formula evaluation runtime.
compileFormula(formulaCell: WorkbookCellReference, source: string, workbookState: WorkbookDocumentState<SheetDocumentState>): CompiledWorkbookFormulaCompiles formula text into native AST plus stable workbook dependencies.
formatFormulaSource(compiled: CompiledWorkbookFormula, workbookState: WorkbookDocumentState<SheetDocumentState>): stringFormats workbook formula source with current sheet names while keeping stable sheet-id bindings.
recalculateDirty(input: {
formulas: ReadonlyMap<string, CompiledWorkbookFormula>;
graph: WorkbookFormulaDependencyGraph;
runtime: WorkbookPluginRuntime;
}): WorkbookFormulaRecalculationResultRecalculates dirty formula cells whose dependencies are currently clean.
shiftCompiledFormulaReferences(input: {
changedSheetId: string;
changes: readonly StructureChange[];
compiled: CompiledWorkbookFormula;
formulaCell: WorkbookCellReference;
}): WorkbookFormulaCompiledReferenceShiftResultShifts compiled formula references after a row or column structure change.
class WorkbookFormulaPlugin extends WorkbookPluginBase contract for plugins owned by createWorkbookEditor().
assertSheetRangeMoveSupported(sheetId: string, context: SheetRangeMoveContext): voidRejects moves requiring reference edits outside the current Sheet transaction boundary.
assertSheetStructureMoveSupported(sheetId: string, context: SheetStructureMoveContext): voidRejects qualified reference rewrites that cannot be persisted by a single Sheet transaction.
formatReference(reference: ParsedWorkbookFormulaReference): stringFormats a stable workbook reference with the latest workbook sheet name.
Returns the workbook-qualified dependency graph owned by this plugin instance.
getFormulaResult(formulaCell: ParsedWorkbookFormulaReference): FormulaValue | undefinedReturns a workbook-level formula result when the skeleton can determine one.
getSheetFormulaResult(sheetId: string, row: number, col: number): FormulaValue | undefinedReturns a result only for formula cells that contain workbook-qualified references.
getSheetFormulaSource(sheetId: string, row: number, col: number): string | undefinedReturns display-ready formula source for workbook formulas on one mounted sheet.
getSheetPlugins(context: WorkbookCompanionSheetPluginContext): readonly SheetPluginImplementation<SheetPlugin<unknown>>[]Contributes the active-sheet companion that forwards committed Sheet transactions.
getSheetServices(context: WorkbookCompanionSheetPluginContext): readonly {
token: symbol;
value: unknown;
}[]Shares the workbook function registry with each mounted Sheet editor.
initialize(context: WorkbookPluginContext): (): voidStarts observing workbook state for this WorkbookEditor instance.
observeSheetTransaction(sheetId: string, transaction: Transaction): voidReceives a committed Sheet transaction from the active SheetEditor companion.
parseReference(reference: string): ParsedWorkbookFormulaReferenceParses a displayed cross-sheet reference against the latest workbook sheet names.
Recalculates workbook formulas currently marked dirty.
registerCommands(commands: WorkbookCommandBus): voidRegisters workbook formula commands.
registerObservations(observations: ObservationRegistry): voidRegisters workbook formula diagnostic observations.
removeFormulaCell(formulaCell: WorkbookCellReference): voidRemoves workbook formula bookkeeping for one formula cell.
setFormulaCellFormula(formulaCell: ParsedWorkbookFormulaReference, formulaSource: string): voidRegisters and compiles one workbook formula source.
setFormulaResult(formulaCell: ParsedWorkbookFormulaReference, result: FormulaValue): voidStores a derived workbook formula result and marks the formula clean.
updateFormulaCell(formulaCell: ParsedWorkbookFormulaReference, dependencies: readonly WorkbookFormulaReference[]): voidRegisters workbook-qualified dependencies for one formula cell.
static readonly symbol: typeof symbolstatic registerServices(__namedParameters: WorkbookPluginServiceContext): voidRegisters one workbook-owned formula runtime shared by mounted Sheet editors.
Inherited from WorkbookPlugin.
Compiled workbook formula with native workbook-reference AST nodes.
readonly ast: FormulaASTParsed AST consumed by the configured formula evaluator.
readonly brokenReferences: readonly WorkbookFormulaBrokenReference[]References that are already known to be invalid.
readonly dependencies: readonly WorkbookFormulaReference[]Stable workbook dependencies extracted from the AST.
readonly hasExpandedObjects?: booleanreadonly hasWorkbookReferences: booleanWhether the formula contains at least one workbook-qualified reference.
readonly sheetBindings: ReadonlyMap<string, string>Formula-text sheet names bound to stable sheet ids at compile time.
readonly source: stringOriginal user-authored formula source.
Result returned after recalculating workbook-level dirty formulas.
readonly recalculatedCells: readonly WorkbookCellReference[]Formula cells recalculated by this command.
readonly remainingDirtyCells: readonly WorkbookCellReference[]Formula cells still dirty after the command completes.
Result returned after recalculating dirty workbook formulas.
readonly recalculatedCells: readonly WorkbookCellReference[]Formula cells that were evaluated and stored in the workbook result cache.
readonly remainingDirtyCells: readonly WorkbookCellReference[]Dirty formula cells that could not be evaluated in this pass.
Local event emitted when a companion Sheet plugin observes a committed transaction.
readonly sheetId: stringWorkbook sheet id that owned the active SheetEditor when the transaction committed.
readonly transaction: TransactionCommitted Sheet transaction observed from the active SheetEditor.
State snapshot for the workbook-scoped formula runtime.
readonly activeSheetId: string | nullActive sheet id in the observed workbook state.
readonly cachedFormulaResultCount: numberNumber of derived workbook formula results currently cached.
readonly dirtyFormulaCellCount: numberNumber of workbook formula cells waiting for recalculation.
readonly formulaCellCount: numberNumber of formula cells currently indexed in the workbook dependency graph.
readonly observedSheetTransactionCount: numberNumber of active-sheet transactions observed by companion Sheet plugins.
readonly sheetIds: readonly string[]Sheet ids currently present in the observed workbook state.
readonly workbookId: string | nullWorkbook id currently observed by WorkbookFormulaPlugin.
type WorkbookFormulaDependencyGraphReader = Pick<WorkbookFormulaDependencyGraph, "getFormulaResult" | "isDirty" | "getDirtyFormulaCells" | "hasFormulaCell" | "getDependencies" | "getBrokenReferences" | "hasBrokenReferences" | "getDependents" | "getFormulaCells" | "size" | "dirtySize" | "resultSize">Read surface returned to plugins without graph mutation methods.
collectWorkbookFormulaBindings(state: WorkbookDocumentState<SheetDocumentState>): SearFormulaBindingFile[]Captures workbook-qualified targets using stable ids.
createMountedWorkbookFormulaCompanionSheetPlugin(workbookFormula: WorkbookFormulaPlugin, sheetId: string, workbookObservations: ObservationRegistry): SheetPluginImplementation<SheetPlugin<unknown>>createWorkbookFormulaDependencyGraphReader(graph: WorkbookFormulaDependencyGraph): WorkbookFormulaDependencyGraphReaderCaptures only bound graph reads; no mutable graph handle escapes.
readWorkbookFormulaBindings(state: WorkbookDocumentState<SheetDocumentState>, cell: {
col: number;
row: number;
sheetId: string;
}, formula: string): ReadonlyMap<string, string>Reads valid persisted bindings for one unchanged formula source.
readWorkbookUpdatedCells(sheetId: string, operations: readonly Operation[]): {
cell: CellMatrixElement | null;
reference: WorkbookCellReference;
}[]Resolves updates at their final transaction positions, including inverse updates preceding swaps.
Recalculates formulas affected by an external service change.
InvalidateWorkbookFormulaFunctionsCommand: WorkbookCommandDefinition<readonly string[], void>Recalculates formulas affected by function registration changes.
Rebuilds workbook formula indexes for a committed Sheet transaction.
RecalculateWorkbookFormulasCommand: WorkbookCommandDefinition<void, RecalculateWorkbookFormulasCommandResult>Recalculates workbook-level formulas marked dirty by cross-sheet changes.
Synchronizes derived formula indexes after a committed Workbook document change.
Removes one workbook-owned external formula service contribution.
Removes one workbook-owned function contribution by its registration id.
Removes one workbook-owned text formula service contribution.
WorkbookFormulaBindingsMetadataKey: "searsuite.workbook.formulaBindings"Runtime metadata holding bindings restored from a durable workbook file.
WorkbookFormulaSheetTransactionObservation: EventObservationDefinition<WorkbookFormulaSheetTransactionEvent>WorkbookFormulaPlugin event stream for committed active-sheet transactions.
WorkbookFormulaPlugin state exposed to diagnostic hosts.
WorkbookFormulaStructureResultsChangedObservation: EventObservationDefinition<readonly WorkbookCellReference[]>Formula results recalculated after a Workbook sheet-list change.
Owns collaboration state beyond the lifetime of any temporary active SheetEditor.
WorkbookCollaborationPlugin(transports: WorkbookCollaborationTransportFactory, platform: Platform): WorkbookCollaborationPlugingetConnectedSheetIds(): readonly string[]getSheetServices(context: WorkbookCompanionSheetPluginContext): {
token: symbol;
value: {
channel: CollaborationChannel;
owner: "host";
};
}[]Contributes parent-owned services without exposing the child editor container.
getSheetStatus(sheetId: string): CollaborationStatus | undefinedinitialize(context: WorkbookPluginContext): (): voidCompletes setup after command, query and observation registrations are available.
onTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidonWorkbookDestroy(): voidregisterCapabilities(registry: WorkbookRuntimeExtensionRegistry): voidPublishes editor-local typed capabilities for other extensions.
registerCommands(commands: WorkbookCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
static readonly symbol: typeof symbolclass WorkbookHistoryPlugin extends WorkbookPluginBuilt-in contributor for workbook structure and declared multi-sheet content history.
Exposes only multi-sheet content entries to the mounted Sheet history adapter.
getOrderStatus(): {
redoOrder?: number;
undoOrder?: number;
}initialize(context: WorkbookPluginContext): voidCompletes setup after command, query and observation registrations are available.
nextSequence(): numberonTransactionCommitted(event: WorkbookTransactionCommittedEvent): voidonWorkbookDestroy(): voidregisterCommands(commands: WorkbookCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
registerObservations(observations: ObservationRegistry): voidRegisters state or event sources whose subscriptions are owned by this editor.
registerSessionState(registry: SessionStateRegistry): voidRegisters detachable local session state separately from durable document content.
subscribe(listener: (status: HistoryStatus): void): (): voidstatic readonly symbol: typeof symbolRead-only host facade for Workbook-owned collaboration channels.
getConnectedSheetIds(): readonly string[]getSheetStatus(sheetId: string): CollaborationStatus | undefinedCreates one transport per Workbook-owned Sheet collaboration channel.
readonly symbol: symbolWorkbook transaction snapshots retained independently from SheetEditor history.
readonly after: WorkbookTransactionStatereadonly before: WorkbookTransactionStatereadonly contentSheetIds?: readonly string[]Sheet content restored with this entry; other sheet content stays current.
redoOrder?: numberundoOrder?: numberWorkbook-local undo and redo stacks.
readonly redoStack: readonly WorkbookHistoryEntry[]readonly sequence?: numberreadonly undoStack: readonly WorkbookHistoryEntry[]History behavior attached to one workbook transaction.
| Member | Value |
|---|---|
Ignore |
"ignore" |
Record |
"record" |
Undo |
"undo" |
Redo |
"redo" |
Current workbook structure undo/redo availability.
ApplyWorkbookCollaborationEventCommand: WorkbookCommandDefinition<{
readonly event: CollaborationExternalEvent;
readonly sheetId: string;
}, void>Routes one transport event into the Workbook-owned channel.
ConnectWorkbookCollaborationCommand: WorkbookCommandDefinition<{
readonly options: CollaborationConnectOptions;
readonly sheetId: string;
}, Promise<void>>Connects the long-lived collaboration channel for one Workbook sheet.
DisconnectWorkbookCollaborationCommand: WorkbookCommandDefinition<{ readonly sheetId: string }, void>Disconnects one Workbook-owned collaboration channel.
RedoWorkbookCommand: WorkbookCommandDefinition<void, void>Re-applies the most recently reverted workbook structure mutation.
UndoWorkbookCommand: WorkbookCommandDefinition<void, void>Reverts the most recent committed workbook structure mutation.
Session identity owned by workbook structural history.
Typed workbook structural history status.
Editor-scoped command bus for workbook-level sheet-list actions.
Creates an empty workbook command bus.
destroy(): voidClears listeners and command registrations during teardown.
enforceRegistrationBoundary(assertWrite: (): void): voidCloses setup-time command registration after the editor is assembled.
getRegisteredCommandIds(): readonly string[]Returns a stable snapshot of all workbook command ids exposed by this editor.
getRegisteredCommands(): readonly WorkbookCommandDefinition<unknown, unknown>[]Returns the typed definitions registered on this workbook editor instance.
has(definition: string | WorkbookCommandDefinition<unknown, unknown>): booleanReturns whether this workbook editor currently exposes a command id.
isExecuting(): booleanWhether this WorkbookEditor is currently dispatching a command.
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.
run<Definition>(definition: Definition, input: WorkbookCommandInput<Definition>): WorkbookCommandDefinitionResult<Definition>Executes a registered workbook command through its typed definition.
runWithoutMutationAuthority<Value>(callback: (): Value): ValueInvokes external observers without inheriting this editor's command write authority.
subscribe(listener: WorkbookCommandListener): (): voidSubscribes to command lifecycle events and returns an unsubscribe function.
static readonly symbol: typeof symbolDI token for the command bus owned by one WorkbookEditor.
class WorkbookRangeMoveError extends SearErrorPrevents a same-sheet move from leaving workbook-qualified references stale.
WorkbookRangeMoveError(sheetId: string): WorkbookRangeMoveErrorreadonly code: "WORKBOOK_RANGE_MOVE_QUALIFIED_REFERENCE"Stable machine-readable identifier for this error category.
class WorkbookRuntimeExtensionRegistry extends RuntimeCapabilityRegistryEditor-local capability registry exposed through WorkbookEditor.services.
static readonly symbol: typeof symbolInherited from RuntimeCapabilityRegistry.
class WorkbookStructureMoveError extends SearErrorPrevents an axis move from leaving qualified reference sources outside its transaction stale.
WorkbookStructureMoveError(sheetId: string): WorkbookStructureMoveErrorreadonly code: "WORKBOOK_STRUCTURE_MOVE_QUALIFIED_REFERENCE"Stable machine-readable identifier for this error category.
Ordered, atomic workbook mutation assembled inside a typed command handler. Reducers stage state only; the WorkbookEditor owns validation and commit.
WorkbookTransaction(id: string, historyAction?: WorkbookHistoryAction, contentSheetIds?: readonly string[]): WorkbookTransactioncontentSheetIdsSheet states whose before/after snapshots belong to this history entry.
readonly contentSheetIds: readonly string[]readonly historyAction: WorkbookHistoryActionreadonly id: stringaddStep(name: string, reduce: WorkbookTransactionReducer): thisAdds one pure reducer to the staged transaction.
getStepNames(): readonly string[]Returns stable step names for diagnostics and tests.
Optional diagnostics hooks used by the workbook command bus.
readonly warn?: (message: string, ...details: unknown[]): voidReceives non-fatal command-boundary diagnostics.
Internal controller API implemented by the workbook editor facade.
Result returned by workbook-level sheet-list commands.
readonly activeSheetEditorChanged: booleanWhether the live active SheetEditor instance was replaced.
readonly documentState: WorkbookDocumentState<SheetDocumentState>Latest workbook state after the command.
Immutable event delivered after a complete workbook transaction commits.
readonly after: WorkbookTransactionStatereadonly before: WorkbookTransactionStatereadonly transaction: WorkbookTransactionDetached state staged by workbook transaction reducers.
readonly activeSheetId: stringreadonly documentState: WorkbookDocumentState<SheetDocumentState>type WorkbookCommandDefinition = CommandDefinition<"workbook", Input, Result>Stable workbook command identifier carrying its input and result contract.
type WorkbookCommandDefinitionResult = conditionalExtracts the result contract from a typed workbook command definition.
Lifecycle event emitted by the workbook command bus for diagnostics and host UI.
type WorkbookCommandHandler = (input: WorkbookCommandInput<Definition>): WorkbookCommandDefinitionResult<Definition>Factory installed by the workbook assembly to run one typed command.
type WorkbookCommandInput = conditionalExtracts the input contract from a typed workbook command definition.
type WorkbookCommandListener = (event: WorkbookCommandEvent): voidObserver invoked when workbook command execution starts, completes or fails.
type WorkbookTransactionReducer = (state: WorkbookTransactionState): WorkbookTransactionStateOne pure staged workbook mutation.
defineWorkbookCommand<Input, Result>(id: string): WorkbookCommandDefinition<Input, Result>Creates an immutable workbook-owned command contract.
registerDefaultWorkbookCommands(commands: WorkbookCommandBus, controller: WorkbookCommandController): voidRegisters the built-in workbook commands on one workbook command bus.
registerWorkbookStateCommands(commands: WorkbookCommandBus, session: SessionStateRegistry, exportDocumentState: (): WorkbookDocumentState<SheetDocumentState>): voidRegisters aggregate snapshot commands without enumerating contributor fields.
Workbook structure, Sheet mounting, workbook commands, sessions, and shared runtime services.
createWorkbookEditor() creates the Workbook runtime and mounts a Sheet editor for the active Sheet. The Workbook
owns structure and shared services; the mounted Sheet editor owns its own commands, queries, services, and
selected plugins. WorkbookEditor keeps structural reads under document and mounted-Sheet access under sheets.
Use when: a product needs several Sheets with stable identities, switching, structural commands, or shared
Workbook services. A single Sheet host can use createSheetEditor() directly.
ActivateWorkbookSheetCommand captures the current Sheet document and local session, tears down that Sheet
editor, and mounts the requested Sheet. The session is restored when returning to it. Workbook structural commands
such as AddWorkbookSheetCommand and RenameWorkbookSheetCommand stage changes in a separate history from cell
edits inside the active Sheet.
Stable sheetId values identify Sheets across rename and reorder operations. A host should use the Workbook
document API for structure and the mounted Sheet API for content. WorkbookPlugin contributions can own shared
services that survive a Sheet remount.
interface WorkbookEditorConfiguration extends Omit<WorkbookRuntimeConfiguration, "adapters" | "sheetClientFactory">Visual Workbook composition layered on the neutral Workbook runtime.
readonly adapters: SheetEditorAdaptersreadonly sheetEditorFactory?: WorkbookSheetEditorFactoryreadonly sheetViews?: readonly SheetViewImplementation<SheetView>[]readonly viewport?: {
readonly height: number;
readonly width: number;
}Visual Sheet configuration supplied by Workbook browser and desktop hosts.
readonly configuration: SheetEditorConfigurationreadonly sheetId: stringtype WorkbookSheetEditorFactory = (input: WorkbookSheetEditorFactoryInput): SheetEditorCreates the selected visual Sheet facade.
createWorkbookEditor(configuration: WorkbookEditorConfiguration): WorkbookEditorAttaches visual Sheet sessions to the shared Workbook business runtime.
import { createWorkbookEditor, type WorkbookEditorConfiguration } from '@searsuite/sear-assembly-workbook';
function openWorkbook(configuration: WorkbookEditorConfiguration) {
const workbook = createWorkbookEditor(configuration);
const activeSheet = workbook.sheets.getActiveEditor();
return { workbook, activeSheet }; // The host later calls workbook.destroy().
}Sheet-facing embedded rich-text editor contracts and test fakes without Doc-runtime dependencies.
Reads a cell document and commits a new document through the Sheet boundary.
commit(document: SheetDocument): voidCell geometry supplied by Sheet. The editor uses these functions for hit testing and drawing without knowing how the Sheet viewport is implemented.
readonly cellRect: SheetEditorRectreadonly clipRect?: SheetEditorRectreadonly containsPoint?: (point: SheetEditorPoint): booleanreadonly toLocalPoint: (point: SheetEditorPoint): SheetEditorPointreadonly toSheetPoint: (point: SheetEditorPoint): SheetEditorPointA point in Sheet or editor-local coordinates.
A rectangle in Sheet or editor-local coordinates.
Result of pointer hit testing against the embedded document.
readonly position?: SheetTextPositionreadonly selection?: SheetTextSelectionreadonly target: "text" | "empty" | "outside"interface SheetPointerInput extends SheetInputModifiersPointer input normalized by the Sheet host.
readonly buttons?: numberreadonly clickCount?: numberreadonly point: SheetEditorPointreadonly type: "pointerDown" | "pointerMove" | "pointerUp"type SheetDocument = readonly SheetDocumentNode[]A rich-document snapshot owned by the Sheet cell boundary.
type SheetDocumentNode = SchemaA document node exchanged between a Sheet cell and an embedded editor.
Current IME composition state in editor-local coordinates.
A cursor rectangle in editor-local coordinates.
readonly rect: SheetEditorRectreadonly visible?: booleanUndo and redo availability for the active embedded cell edit.
Whether one inline style can be applied, is active, and has a common value.
type SheetEmbeddedInlineStyleState = Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>Inline-style state exposed by a Sheet embedded editor while editing a cell.
Keys are plugin-owned persisted style keys (for example, bold or
fontSize). Keeping the state keyed by the stable style key lets third-party
inline-style extensions participate without changing this contract.
SheetEmbeddedInlineStyleObservation: StateObservationDefinition<Readonly<Record<string, SheetEmbeddedInlineStyleStatus>>>Current inline-style availability and activation for the embedded selection.
The embedded editor reports render updates and session state to its Sheet host. FakeSheetEmbeddedEditor supports consumers that need a test implementation.
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.
cancelCount: numberreadonly committedDocuments: Schema[][]disposeCount: numberreadonly editContexts: SheetEmbeddedEditorContext[]initializeCount: numberreadonly inputs: SheetEditInput[]readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
readonly renderContexts: SheetEmbeddedEditorContext[]readonly renderSessions: FakeRenderSession[]bindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
dispose(ownerToken?: object): voidinitialize(context: SheetEmbeddedEditorContext): voidinterface SheetEmbeddedEditor
SheetEmbeddedEditor: unknownStable Sheet-facing embedded editor contract. Implementations own rich-text layout, painting, selection, cursor and IME behavior behind this boundary.
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.
readonly observations: ObservationRegistryTyped editor-local state and event observations exposed to the host.
symbol: symbolbindTeardownToken(token: object): voidRestricts runtime teardown to the owning Sheet editor when supported.
createEditSession(context: SheetEmbeddedEditorContext, model?: DocEditModel): SheetEditSessiondispose(ownerToken?: object): voidinitialize(context: SheetEmbeddedEditorContext): voidmeasureUnwrapped(document: readonly Schema[], font: string): {
height: number;
width: number;
}Measures persisted rich text with its actual inline styles, without changing the edit session.
A rectangle or semantic reason that should be redrawn by Sheet.
readonly kind: "selection" | "content" | "all" | "composition" | "cursor" | "geometry"readonly reason?: stringreadonly rects?: readonly SheetEditorRect[]Per-frame options for painting an active Sheet edit session.
readonly cursorVisible?: booleanWhether the caret should be painted during this frame.
An active editing session for one Sheet cell document.
cancel(): voiddispose(): voidgetComposition(): SheetCompositionState | nullgetCursor(): SheetCursorState | nullgetDocument(): readonly Schema[]getSelection(): SheetTextSelection | nullhandleInput(input: SheetEditInput): SheetRenderUpdaterender(renderContext?: RenderContext, options?: SheetEditRenderOptions): SheetRenderUpdatePaints the current edited document, selection, cursor and composition.
setSelection(selection: SheetTextSelection): SheetRenderUpdateContext in which a Sheet cell editor renders and edits one cell document.
readonly defaultFontFamily?: stringHost-selected default font family for read-only Sheet cell rendering.
readonly defaultFontSize?: numberHost-selected default font size for read-only Sheet cell rendering.
readonly documentAccessor: SheetDocumentAccessorreadonly geometry: SheetEditorGeometryreadonly invalidate?: (invalidation: SheetEditorInvalidation): voidreadonly isCommandExecuting?: (): booleanPresent in assembled Sheets to require command dispatch for edit-session mutations.
readonly renderContext: RenderContextA retained render session for one Sheet cell document.
dispose(): voidhitTest(input: SheetPointerInput): SheetPointerHit | nullrender(renderContext?: RenderContext): SheetRenderUpdatePaints the current document into the supplied render target.
State returned after a render or edit operation.
readonly composition?: SheetCompositionStatereadonly contentSize?: {
readonly height: number;
readonly width: number;
}readonly cursor?: SheetCursorStatereadonly invalidation?: SheetEditorInvalidationreadonly needsRedraw: booleanreadonly selection?: SheetTextSelectionBuilt-in cell identities and commit strategies for text, numbers, formulas, and rich text.
class SheetCellStyleRegistry extends SheetCellStyleReaderComposes semantic cell appearance before consumers choose a presentation.
destroy(): voidReleases all contributions and derived caches owned by this registry.
read(row: number, column: number): SheetCellStyleReads the composed semantic style for one cell without exposing drawing types.
register(source: SheetCellStyleSource): (): voidRegisters an editor-local contribution and returns its owned disposer.
registerConditional(source: SheetCellStyleRuleSource): (): voidAdds evaluated semantic style rules, ordered by priority and stable identity.
registerOverride(source: SheetCellStyleOverride): (): voidAdds an ordered semantic style override without replacing its base owner.
static readonly symbol: typeof symbolDependency injection token for this editor-local implementation.
Shared ordering of independently owned cell rules, without a presentation registry.
nextPriority(): numberregister(id: string, readHighestPriority: (): number): (): voidstatic readonly symbol: typeof symbolQueryable cell appearance, independent of nodes, coordinates, layout, and drawing APIs.
readonly fill?: stringOptional cell background color, independent of drawing geometry.
readonly format?: unknownOptional number or display format interpreted by cell-type providers.
readonly horizontalAlign?: SheetHorizontalAlignmentHorizontal text alignment used by semantic display projections.
readonly stroke?: stringOptional semantic outline color.
readonly textColor?: stringOptional foreground color of displayed cell text.
readonly textStyle?: SheetCellTextStylereadonly verticalAlign?: SheetVerticalAlignmentVertical text alignment used by semantic display projections.
Theme-independent defaults used by semantic style projections.
read(): Readonly<SheetCellStyle>Reads the composed semantic style for one cell without exposing drawing types.
One conditional appearance produced by a feature's rule evaluation.
readonly id: stringStable identifier used for registration, priority ties and disposal.
readonly priority: numberDeterministic rule priority; later matching priorities override earlier values.
readonly properties: Readonly<SheetCellStyle>Semantic style properties this contribution is authorized to supply.
interface SheetCellStyleOverride extends SheetCellStyleSourceA feature-owned contribution with exclusive ownership of its base properties.
readonly priority: numberDeterministic rule priority; later matching priorities override earlier values.
Semantic style query shared by filters, automation, and views.
read(row: number, column: number): Readonly<SheetCellStyle>Reads the composed semantic style for one cell without exposing drawing types.
readonly id: stringStable identifier used for registration, priority ties and disposal.
readonly properties: readonly keyof SheetCellStyle[]Semantic style properties this contribution is authorized to supply.
read(row: number, column: number): readonly SheetCellStyleMatch[]Reads the composed semantic style for one cell without exposing drawing types.
A feature-owned contribution with exclusive ownership of its base properties.
readonly id: stringStable identifier used for registration, priority ties and disposal.
readonly properties: readonly keyof SheetCellStyle[]Semantic style properties this contribution is authorized to supply.
read(row: number, column: number): Readonly<SheetCellStyle>Reads the composed semantic style for one cell without exposing drawing types.
Cell typography and wrapping. Font size is measured in logical pixels (96 per inch).
| Member | Value |
|---|---|
Up |
"up" |
Right |
"right" |
Down |
"down" |
Circle |
"circle" |
Diamond |
"diamond" |
Triangle |
"triangle" |
Flag |
"flag" |
Star |
"star" |
Bar |
"bar" |
Check |
"check" |
Cross |
"cross" |
extractRichText(value: unknown): stringExtracts plain text from persisted rich-text content.
formatFormulaValue(value: unknown): stringFormats formula results consistently for rendering and measurement.
CellType identifies the kind of stored value. The built-in commit strategies handle text, numbers, booleans, formulas, and rich text.
Persisted cell payload stored in the sheet matrix.
formula?: stringFormula source text for formula cells; calculated results live in formula plugin state.
formulaEvaluationMode?: "dynamic" | "legacy"Array evaluation mode used when the formula was entered.
type: stringCell type identifier owned by the cell type catalog.
value?: unknownRaw value whose shape is owned by the cell type.
| Member | Value |
|---|---|
Empty |
"empty" |
String |
"string" |
Number |
"number" |
Boolean |
"boolean" |
Formula |
"formula" |
RichText |
"richtext" |
Formatting turns a stored value into display text. CellFormat and the alignment values describe presentation without changing the underlying value.
Editor-local cell-format codecs; unregistered types preserve their payload verbatim.
apply(cell: CellMatrixElement | null, format: Readonly<Record<string, unknown>>): CellMatrixElement | nullcapture(cell: CellMatrixElement | null): Readonly<Record<string, unknown>>destroy(): voidregister(codec: CellFormatTransferCodec): (): voidstatic readonly symbol: typeof symbolEditor-local fanout for changes to displayed cell values.
SheetDisplayedValueChanges(warn: (error: unknown): void): SheetDisplayedValueChangesdispose(): voidenforceCommandBoundary(isExecuting: (): boolean, runWithoutMutationAuthority: <Value>(callback: (): Value): Value): voidSeals publishing after startup while keeping host listeners outside command authority.
publish(cells: readonly SheetDisplayedValueCoordinate[]): voidsubscribe(listener: SheetDisplayedValueChangeListener): (): voidstatic readonly symbol: typeof symbolinterface ICellFormatLocaleProvider
ICellFormatLocaleProvider: unknownProvides sheet-local defaults for number and date/time display formatting.
symbol: typeof symbolLocale defaults used when a cell format does not declare explicit display settings.
readonly datePattern: stringreadonly dateTimePattern: stringreadonly decimalSeparator?: stringreadonly groupSeparator?: stringreadonly locale: stringreadonly timePattern: stringType-owned format projection that never substitutes source values for target values.
readonly cellType: stringapply(cell: CellMatrixElement, format: Readonly<Record<string, unknown>>): CellMatrixElementcapture(cell: CellMatrixElement): Readonly<Record<string, unknown>>A cell whose displayed value changed after a derived value update.
Horizontal alignment values supported by the built-in Sheet alignment feature.
| Member | Value |
|---|---|
Center |
"center" |
Left |
"left" |
Right |
"right" |
Vertical alignment values supported by the built-in Sheet alignment feature.
| Member | Value |
|---|---|
Bottom |
"bottom" |
Center |
"center" |
Top |
"top" |
type CellFormat = { readonly kind: "general" } | { readonly kind: "text" } | {
readonly code: string;
readonly kind: "excelCode";
} | {
readonly kind: "number";
readonly locale?: string;
readonly maximumFractionDigits?: number;
readonly minimumFractionDigits?: number;
readonly useGrouping?: boolean;
} | {
readonly kind: "percent";
readonly locale?: string;
readonly maximumFractionDigits?: number;
readonly minimumFractionDigits?: number;
} | {
readonly currency: string;
readonly kind: "currency";
readonly locale?: string;
readonly maximumFractionDigits?: number;
readonly minimumFractionDigits?: number;
} | {
readonly kind: "date";
readonly pattern?: string;
} | {
readonly kind: "time";
readonly pattern?: string;
} | {
readonly kind: "dateTime";
readonly pattern?: string;
}Cell formatting changes input interpretation and display only, never the raw value for display purposes.
type SheetDisplayedValueChangeListener = (cells: readonly SheetDisplayedValueCoordinate[]): voidadjustCellFormatDecimalPlaces(format: unknown, delta: number): CellFormatAdjusts the visible decimal-place count of numeric built-in formats.
assertSheetHorizontalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet horizontal alignments.
assertSheetVerticalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet vertical alignments.
cellFormatToExcelCode(format: unknown): string | undefinedConverts an explicit cell format into the Excel-style code exposed to formula metadata readers.
Creates the default cell-format locale provider.
createGeneralNumberDisplayCandidates(value: number): readonly string[]Returns General-format candidates from most informative to most compact.
formatCellNumber(value: number, format: unknown, locale?: CellFormatLocale): stringformatCellNumberDisplay(value: number, format: unknown, locale?: CellFormatLocale): SpreadsheetFormatDisplayFormats one numeric cell and preserves format-section visual metadata.
formatCellNumberForEditor(value: number, format: unknown, locale?: CellFormatLocale): stringReturns the initial text for editing a numeric cell.
formatCellNumberForFormulaBar(value: number, format: unknown, locale?: CellFormatLocale): stringReturns the numeric source shown for a selected cell in the formula bar.
formatCellText(value: string, format: unknown, locale?: CellFormatLocale): stringApplies the fourth custom-format section to a text cell.
interpretNumberInput(source: string, currentFormat: CellFormat | null | undefined, locale?: CellFormatLocale, previous?: CellMatrixElement | null): {
format?: CellFormat;
value: number;
} | nullParses direct numeric/date input and suggests a display format for General cells.
isSheetHorizontalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet horizontal alignment.
isSheetVerticalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet vertical alignment.
normalizeCellFormat(value: unknown): CellFormatNormalizes a public CellFormat object, falling back to General for invalid input.
parseFormattedNumber(text: string, format: unknown, locale?: CellFormatLocale): number | undefineddate: { readonly kind: "date" }dateTime: { readonly kind: "dateTime" }general: { readonly kind: "general" }number: { readonly kind: "number" }percent: { readonly kind: "percent" }text: { readonly kind: "text" }time: { readonly kind: "time" }currency(currency: string, locale?: string): CellFormatexcelCode(code: string): CellFormatExcel-compatible formatting defaults used when no i18n plugin is installed.
A commit strategy interprets an edit before it enters Sheet state. Input validators can reject values that do not meet a feature’s rule.
class BooleanCellCommitStrategy extends CellCommitStrategyRecognizes directly entered spreadsheet logical literals.
commit(context: CellCommitContext): CellMatrixElementConverts matching edit input into a persisted cell value.
matches(context: CellCommitContext): booleanReports whether this strategy can commit the supplied input.
class CellCommitStrategy extends CellCommitStrategyDefinitionBase class for reusable strategies; plain definitions can also be registered.
abstract commit(context: CellCommitContext): CellMatrixElement | nullConverts matching edit input into a persisted cell value.
abstract matches(context: CellCommitContext): booleanReports whether this strategy can commit the supplied input.
Extensible value-type registry. Hosts and plugins can add or replace input classifiers without coupling their domain types to the cell editor.
commit(context: CellCommitContext): CellMatrixElement | nullSelects a matching strategy and commits the supplied edit input.
commitWithFormat(context: CellCommitContext): {
cell: CellMatrixElement | null;
format: CellFormat | null;
}Commits a value and returns any format inferred by its owning strategy.
get(key: string): CellCommitStrategyDefinition | undefinedgetAll(): readonly CellCommitStrategyDefinition[]Returns the all.
register(strategy: CellCommitStrategyDefinition): (): voidRegisters or replaces a strategy. The returned disposer restores the replaced strategy when this registration remains active.
unregister(key: string): booleanUnregisters the value.
static readonly symbol: typeof symbolDI token for resolving CellCommitStrategyRegistry.
class DefaultStringCellCommitStrategy extends CellCommitStrategyFinal fallback: persist otherwise-unclassified input as plain text.
commit(context: CellCommitContext): CellMatrixElementPersists unmatched input as a string cell.
matches(): booleanMatches input not claimed by a more specific strategy.
class EmptyCellCommitStrategy extends CellCommitStrategyRemoves a cell when its editor document has no semantic text.
commit(): nullConverts empty input into an absent cell value.
matches(context: CellCommitContext): booleanReports whether the input should clear the cell.
class FormulaCellCommitStrategy extends CellCommitStrategyRecognizes formula source and normalizes it before persistence.
commit(context: CellCommitContext): CellMatrixElementPersists formula source without evaluating it.
matches(context: CellCommitContext): booleanReports whether the input is formula source.
class NumberCellCommitStrategy extends CellCommitStrategyInfers numeric values after more-specific domain types have had a chance to match.
commit(context: CellCommitContext): CellMatrixElementPersists input as a numeric cell.
inferFormat(context: CellCommitContext): CellFormat | nullmatches(context: CellCommitContext): booleanReports whether the input is a valid numeric value.
class RichTextCellCommitStrategy extends CellCommitStrategyPersists the document tree only when it contains durable inline/block semantics.
commit(context: CellCommitContext): CellMatrixElementPersists a cloned rich-document snapshot.
matches(context: CellCommitContext): booleanReports whether the input is a rich-document snapshot.
Editor-local validation contributions, evaluated before a cell edit commits.
beginTeardown(token: object): voidAllows owner-controlled cleanup after command dispatch has ended.
enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void, teardownToken: object): voidCloses direct writes once the editor finishes starting.
register(id: string, validator: SheetCellInputValidator, options?: SheetCellInputValidatorOptions): (): voidunregister(registrationId: number): voidRemoves one registration, dispatching through its command after assembly.
validate(row: number, column: number, text: string): SheetCellInputValidationResultvalidateClear(row: number, column: number): SheetCellInputValidationResultChecks only validators that explicitly protect existing contents from clearing.
static readonly symbol: typeof symbolstatic validateTextLimits(text: string): SheetCellInputValidationResult | nullExcel-compatible limits shared by editing and clipboard paste.
class TextCellCommitStrategy extends CellCommitStrategyHandles explicit text input: Text-format cells and apostrophe-prefixed values.
commit(context: CellCommitContext): CellMatrixElementPersists input as an explicit text cell.
matches(context: CellCommitContext): booleanReports whether the input is explicitly typed as text.
Input available when the cell editor commits one edited cell.
col: numberformat?: CellFormat | nullExplicit format read from the Sheet cell-format state owner.
Locale used to interpret the formatted editor text.
plainText: stringprevious: CellMatrixElement | nullrow: numberContract for deciding how editor input becomes persisted cell data.
commit(context: CellCommitContext): CellMatrixElement | nullinferFormat(context: CellCommitContext): CellFormat | nullmatches(context: CellCommitContext): booleanResult of validating a proposed cell edit.
type SheetCellInputValidator = (row: number, column: number, text: string): SheetCellInputValidationResultassertCellExtensionWrite(owner: object): voidChecks registration changes only; cell reads and rendering stay on their existing hot paths.
sealCellExtensionWrites(owner: object, assertWrite: (): void): voidSeals an editor-local cell extension owner after setup contributions are registered.
Clipboard codecs preserve type-specific values when cells are copied and pasted.
Editor-local registry for cell-type-owned clipboard behavior.
decode(payload: CellClipboardCellPayload, context: CellClipboardDecodeContext): CellMatrixElement | nulldecodePlainText(text: string): CellMatrixElement | nullget(cellType: string): CellClipboardCodecDefinition | undefinedregister(codec: CellClipboardCodecDefinition): (): voidtoPlainText(cell: CellMatrixElement): stringstatic readonly symbol: typeof symbolJSON-safe representation owned by the cell type that produced it.
Clipboard behavior contributed by one persisted cell type.
readonly cellType: stringdecode(data: unknown, context: CellClipboardDecodeContext): CellMatrixElement | nulldecodePlainText(text: string): CellMatrixElement | nullencode(cell: CellMatrixElement): unknownrebase(cell: CellMatrixElement, context: CellClipboardDecodeContext): CellMatrixElementtoPlainText(cell: CellMatrixElement): stringContext used by a cell type when a native clipboard cell is pasted elsewhere.
readonly columnDelta: numberreadonly rowDelta: numbercloneCellClipboardValue(value: unknown): unknownCopies portable Clipboard cell payloads made of arrays and enumerable object fields.
Platform-neutral cell semantics and extension catalogs.
Editor-local catalog of persisted cell types and their semantic capabilities.
Registering a definition installs all of its capabilities atomically into the specialised registries; disposing it restores the definition it replaced.
CellTypeCatalog(commitStrategies: CellCommitStrategyRegistry, displayTexts: CellDisplayTextRegistry, clipboardCodecs: CellClipboardCodecRegistry, formatCodecs?: CellFormatTransferRegistry): CellTypeCatalogCreates a catalog over the commit, display-text, clipboard and format registries.
get(type: string | symbol): CellTypeDefinition | undefinedReturns the registered definition for a type key.
getAll(): readonly CellTypeDefinition[]Returns all registered definitions in insertion order.
getDisplayText(cell: CellDisplayData, context: CellDisplayContext): stringResolves display text through the registered provider for a persisted cell type.
register(definition: CellTypeDefinition): (): voidRegisters a definition atomically and returns a disposer that restores the previous definition.
unregister(type: string | symbol): booleanUnregisters a definition by type key.
static readonly symbol: typeof symbolDI token for resolving the workbook cell type catalog.
A persisted spreadsheet cell type and all behaviours associated with it.
abstract readonly type: stringPersisted cell type identifier stored on sheet cell data.
createClipboardCodec(): CellClipboardCodecDefinition | undefinedCreates clipboard behavior owned by this persisted cell type.
createCommitStrategies(): readonly CellCommitStrategyDefinition[]Creates commit strategies associated with this cell type.
createDisplayTextProvider(): CellDisplayTextProvider | undefinedCreates the display-text provider associated with this cell type.
createFormatTransferCodec(): CellFormatTransferCodec | undefinedOptional format-transfer behavior owned by this cell type.
isStoredValue(_cell: {
formula?: unknown;
value?: unknown;
}): booleanValidates persisted data before it reaches a renderer-specific Cell.
registerBuiltinCellDefinitions(catalog: CellTypeCatalog): (): voidRegisters built-in cell definitions and returns a disposer in reverse order.
Maps persisted cell types to their display-text semantics without creating render Cells.
CellDisplayTextRegistry(platform: Platform): CellDisplayTextRegistrygetDisplayText(cell: CellDisplayData, context: CellDisplayContext): stringReturns the display text.
register(provider: CellDisplayTextProvider): (): voidRegisters the value.
static readonly symbol: typeof symbolDI token for resolving CellDisplayTextRegistry.
Read-only data available while deriving display text.
This deliberately does not reuse a render-cell context: measurement, copy, and search need the same cell semantics without taking a render dependency.
Persisted data required to derive a cell's plain-text representation.
Pure document formatting supplied by an embedded editor implementation.
Minimal formula-result capability required by formula display text.
getFormulaResult(row: number, col: number): unknownClipboard behavior for formula source text and relative references.
registerTextFormatTransferCodecs(registry: CellFormatTransferRegistry, readFormatting: (): CellDocumentFormatting | undefined): (): voidText cell type composition; numeric and formula values remain with their own codecs.
Host-neutral revision, pending-operation, acknowledgement, catch-up, and rebase algorithms.
In-memory authority that validates, rebases, orders, and deduplicates collaboration batches.
accept(submission: CollaborationSubmission): CollaborationAcceptedBatchAccepts one client submission into the canonical resource order.
sync(resourceId: string, fromRevision: number): CollaborationSyncMessageReturns ordered canonical batches after a known revision.
Owner-to-OT mapping used by clients, authorities, and editor bridges.
readonly operations: TransactionOTRegistrydestroy(): voidgetRegisteredOwnerIds(): readonly string[]has(ownerId: string): booleanregister<OperationType>(ownerId: string, definition: TransactionOTDefinition<OperationType>, relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]): (): voidRegisters one collaborative state owner and returns an idempotent disposer.
require(ownerId: string, operationType?: CollaborationOperationType): TransactionOTDefinitionResolves one registered owner and optionally validates its wire operation type.
Single client-side collaboration algorithm shared by all editor bridges.
CollaborationEngine(contributors: CollaborationContributorRegistry): CollaborationEngineconnect(resourceId: string, clientId: string, revision?: number): voidStarts one resource session from a host-supplied document revision.
disconnect(): voidEnds the current session and releases transient pending state.
getPendingCount(): numbergetRevision(): numberreceive(message: CollaborationServerMessage): readonly CollaborationEngineEffect[]Applies one authority message and returns host/transport effects in deterministic order.
submitLocal<OperationType>(ownerId: string, operations: readonly OperationType[]): readonly CollaborationEngineEffect[]Queues one already-committed local transaction and emits at most one in-flight submission.
class CollaborationError extends SearErrorPublic collaboration failure with stable diagnostics.
CollaborationError(code: CollaborationErrorCode, message: string, details?: SearErrorDetails): CollaborationErrorreadonly code: CollaborationErrorCodeStable machine-readable identifier for this error category.
interface CollaborationContribution<OperationType>Open collaboration contribution shared by editor clients and authorities.
readonly definition: TransactionOTDefinition<OperationType>readonly ownerId: stringreadonly relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]Versioned OT family identity carried on the wire.
Stable collaboration protocol and state-machine errors.
| Member | Value |
|---|---|
InvalidIdentity |
"SEAR_COLLABORATION_INVALID_IDENTITY" |
InvalidProtocol |
"SEAR_COLLABORATION_INVALID_PROTOCOL" |
InvalidRevision |
"SEAR_COLLABORATION_INVALID_REVISION" |
RevisionGap |
"SEAR_COLLABORATION_REVISION_GAP" |
OwnerConflict |
"SEAR_COLLABORATION_OWNER_CONFLICT" |
OwnerNotRegistered |
"SEAR_COLLABORATION_OWNER_NOT_REGISTERED" |
OwnerTypeMismatch |
"SEAR_COLLABORATION_OWNER_TYPE_MISMATCH" |
OperationRejected |
"SEAR_COLLABORATION_OPERATION_REJECTED" |
AcknowledgementMismatch |
"SEAR_COLLABORATION_ACKNOWLEDGEMENT_MISMATCH" |
EngineDisconnected |
"SEAR_COLLABORATION_ENGINE_DISCONNECTED" |
RegistryDestroyed |
"SEAR_COLLABORATION_REGISTRY_DESTROYED" |
type CollaborationEngineEffect = {
readonly kind: "send";
readonly submission: CollaborationSubmission;
} | {
readonly kind: "applyRemote";
readonly operations: readonly OTOperation[];
readonly ownerId: string;
readonly serverRevision: number;
}Effects emitted by the pure collaboration client state machine.
Stable collaboration protocol and state-machine errors.
Canonical operation batch accepted and ordered by the authority.
readonly baseRevision: numberreadonly clientId: stringreadonly kind: "accepted"readonly operationId: stringreadonly operationType: CollaborationOperationTypereadonly ownerId: stringreadonly payload: OTEncodedValuereadonly protocolVersion: 1readonly resourceId: stringreadonly serverRevision: numberExplicit authority rejection; clients must not infer recovery from dropped frames.
readonly code: stringreadonly kind: "rejected"readonly message: stringreadonly operationId?: stringreadonly protocolVersion: 1readonly resourceId: stringClient submission before the authority assigns a canonical revision.
readonly baseRevision: numberreadonly clientId: stringreadonly kind: "submit"readonly operationId: stringreadonly operationType: CollaborationOperationTypereadonly ownerId: stringreadonly payload: OTEncodedValuereadonly protocolVersion: 1readonly resourceId: stringOrdered catch-up response sent when a transport joins a resource.
readonly batches: readonly CollaborationAcceptedBatch[]readonly fromRevision: numberreadonly kind: "sync"readonly protocolVersion: 1readonly resourceId: stringreadonly serverRevision: numberCurrent collaboration wire protocol version.
Typed command definitions and the editor-local command bus contract.
type TextInputEvent = {
readonly kind: typeof TextInputKind.Text;
readonly text: string;
} | {
readonly caretOffset: number;
readonly kind: typeof TextInputKind.CompositionUpdate;
readonly text: string;
}Committed text or an in-flight composition update, including composition clearing.
Canonical kinds of portable text-input events.
readonly CompositionUpdate: "compositionUpdate"readonly Text: "text"Builder for rich-document command transactions.
Commands append document OT steps and selection mapping metadata here. The caller later applies the steps through the editor pipeline.
Appends a prepared document step.
ReturnsThe current transaction for chaining.
stepStep to run during transaction application.
deleteNode(path: number[], nodeSnapshot: NodeSchema): thisAppends a node deletion step.
ReturnsThe current transaction for chaining.
pathPath of the node to delete.
nodeSnapshotDeleted node payload used for OT inversion.
deleteText(path: number[], offset: number, text: string): thisAppends a text deletion step.
ReturnsThe current transaction for chaining.
pathPath to the text node.
offsetString offset where deletion starts.
textExact text expected to be deleted.
getMeta<T>(key: string): T | undefinedReads command metadata by key.
ReturnsThe stored value when present.
keyMetadata key.
insertNode(path: number[], node: NodeSchema): thisAppends a node insertion step.
ReturnsThe current transaction for chaining.
pathTarget insertion path.
nodeNode payload to insert.
insertText(path: number[], offset: number, text: string): thisAppends a text insertion step.
ReturnsThe current transaction for chaining.
pathPath to the text node.
offsetString offset where text is inserted.
textText to insert.
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.
setMeta(key: string, value: unknown): thisStores command metadata.
ReturnsThe current transaction for chaining.
keyMetadata key.
valueMetadata value.
setSelection(sel: DocSelection): thisAppends a selection-only step.
ReturnsThe current transaction for chaining.
selSelection that should be active after this transaction.
updateAttrs(path: number[], key: string, value: unknown, prev: unknown): thisAppends one attribute update operation and retains its previous value for inversion.
Runtime state available while a rich-document command builds a transaction.
Current document selection before the command applies.
lastSnapshot: LayoutSnapshot | nullLast measured layout snapshot, required for vertical cursor movement.
Editor-local schema definitions used when creating new blocks and text.
Pending document tree used for reads before the transaction is committed.
preferredX: number | nullPreferred horizontal position used by repeated vertical cursor navigation.
One atomic document transaction step with its selection mapping logic.
Rich-document OT operations produced by this step.
mapSelection(sel: DocSelection, newDoc: RichDocNode[]): DocSelectionMaps an existing selection through the step.
ReturnsSelection rebased onto newDoc.
selSelection before this step.
newDocDocument state after this step.
Union of cursor directions accepted by rich-document navigation.
| Member | Value |
|---|---|
Up |
"up" |
Down |
"down" |
Left |
"left" |
Right |
"right" |
type DocCommand = (tr: DocTransaction, state: DocCommandContext): DocTransactionRich-document command that appends steps to a transaction.
Creates a command for Backspace behavior.
ReturnsCommand that deletes a selection, deletes the previous character, or merges with the previous paragraph.
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.
textText to insert into the rich document.
moveCursorCommand(direction: DocCursorDirection, shiftKey: boolean, layoutEngine: DocLayoutEngine): DocCommandCreates a command for arrow-key cursor movement.
ReturnsSelection-only command with the computed cursor or range.
directionNavigation direction.
shiftKeyWhether the movement should extend selection.
layoutEngineLayout engine used for vertical line navigation.
Creates a command that selects the complete rich document.
ReturnsSelection-only command spanning the first text node to the last text node.
Creates a command that splits the current paragraph at the cursor.
ReturnsCommand that moves trailing text and nodes into a newly inserted paragraph.
The dependency-free JSON protocol shared by standalone and embedded rich documents.
Persisted rich-document node schema shared by document runtime, commands, and OT.
attrs?: Record<string, any>Node attributes for styles, formatting, and feature-owned metadata.
Child rich-document nodes.
id?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
text?: stringOptional text content for leaf text nodes.
type: stringDomain node type identifier.
interface TextSchema extends NodeSchemaPersisted text-bearing rich-document node schema.
text: stringOptional text content for leaf text nodes.
type Schema = NodeSchema | TextSchemaPersisted rich-document schema node.
Rich-document nodes, selections, schema helpers, inline styles, and layout contracts.
A rich document is a tree of RichDocNode values. Paragraphs, text runs, tables, rows, and cells are node types
in that tree. DocNodeRegistry creates nodes from schema data; Schema, NodeSchema, and the node guards describe which
shapes the runtime accepts. Use the built-in node types when reading or constructing document content, then add
custom node behavior through the registry used by your Doc assembly.
The tree is document data. Layout measurements and painted nodes are computed later by the editor and render packages, so storing a document does not require a visual host.
Base value for a rich-document node in layout and persisted document state.
Concrete node types supply schema creation through DocNodeRegistry. Each
node carries a type, attributes, and child content; an optional stable id
connects the persisted structure to retained layout and collaboration
positions. Use the registry to create nodes from schema data.
static create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
Editor-local node definitions; static helpers only materialize built-in schemas.
create(schema: Schema): RichDocNodeMaterializes the complete tree through this registry, including nested custom nodes.
enforceWriteBoundary(assertWrite: (): void): voidReserves runtime registration changes for the owning editor's commands.
isBlockType(type: string): booleanisTextType(type: string): booleanregister(definition: DocNodeDefinition): voidInstalls a definition for this editor without changing other registries.
requireDefaultBlockType(): stringrequireDefaultTextType(): stringstatic readonly symbol: typeof symbolstatic create(schema: Schema): RichDocNodeCreates built-in values without reading or mutating any editor's registrations.
static isBlockType(type: string): booleanstatic isTextType(type: string): booleanstatic requireDefaultBlockType(): stringstatic requireDefaultTextType(): stringclass ParagraphNode extends RichDocNodeBuilt-in paragraph node.
ParagraphNode(schema: NodeSchema): ParagraphNodeCreates a paragraph node from persisted schema.
static readonly nodeType: "paragraph"Persisted schema type owned by the paragraph document feature.
class TableCellNode extends RichDocNodeBuilt-in table cell node.
TableCellNode(schema: NodeSchema): TableCellNodeCreates a table cell node from persisted schema.
static readonly nodeType: "tableCell"Persisted schema type owned by the table document feature.
class TableNode extends RichDocNodeBuilt-in table block node.
TableNode(schema: NodeSchema): TableNodeCreates a table node from persisted schema.
static readonly nodeType: "table"Persisted schema type owned by the table document feature.
class TableRowNode extends RichDocNodeBuilt-in table row node.
TableRowNode(schema: NodeSchema): TableRowNodeCreates a table row node from persisted schema.
static readonly nodeType: "tableRow"Persisted schema type owned by the table document feature.
class TextNode extends RichDocNodeBuilt-in text leaf node.
TextNode(schema: NodeSchema): TextNode
TextNode(schema: TextSchema): TextNodeCreates a text node from persisted schema.
text?: stringText content carried by this leaf node.
static readonly nodeType: "text"Persisted schema type owned by the text input document feature.
Registration contract for one persisted rich-document node type.
readonly create: (schema: Schema): RichDocNodeFactory that creates the runtime node instance for this persisted schema.
readonly defaultBlock?: booleanWhether this block is the default container for plain text editing.
readonly defaultText?: booleanWhether this text-like node is the default leaf for plain text editing.
readonly role?: DocNodeRoleGeneric role consumed by core editing/layout helpers.
readonly type: stringPersisted schema type owned by a document feature plugin.
Minimal factory interface for creating document nodes.
Implemented by DocNodeRegistry (static or injected).
create(schema: {
attrs?: Record<string, unknown>;
content?: unknown[];
id?: string;
text?: string;
type: string;
}): RichDocNodePersisted rich-document node schema shared by document runtime, commands, and OT.
attrs?: Record<string, any>Node attributes for styles, formatting, and feature-owned metadata.
Child rich-document nodes.
id?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
text?: stringOptional text content for leaf text nodes.
type: stringDomain node type identifier.
interface TextSchema extends NodeSchemaPersisted text-bearing rich-document node schema.
text: stringOptional text content for leaf text nodes.
| Member | Value |
|---|---|
Text |
"text" |
Block |
"block" |
type DocNodeId = string & { readonly [docNodeIdBrand]: true }Stable identity used by document layout and retained render nodes.
type RichTextChar = unknownMeasured inline character/token used by rich-text line wrapping.
char: stringfontAscent: numberfontDescent?: numberfontLineGap?: numberheight: numbertextNodeIndex?: numberDirect child index of the source text node within its paragraph.
textNodeOffset?: numberCharacter offset within the source text node.
width: numbertype Schema = NodeSchema | TextSchemaPersisted rich-document schema node.
cloneRichDocument(document: readonly RichDocNode[]): RichDocNode[]Returns a detached mutable snapshot of a rich document.
createDocNodeId(value: string): DocNodeIdCreates a typed document node id from a non-empty string value.
createDocNodeIdFromPath(path: readonly string | number[]): DocNodeIdCreates a fallback document node id from a rich-document path.
Create a single empty paragraph containing one empty text node.
getTextNodeLength(doc: RichDocNode[], path: number[]): numberCharacter length of the text node at path. Returns 0 for missing / non-text nodes.
isDocSemanticallyEmpty(doc: RichDocNode[]): booleanReturns true if every paragraph in doc contains no meaningful text.
isTextNode(node: TextNode | RichDocNode): nodeReturns true when a rich-document node is a text leaf.
normalizeDocForEdit(doc: RichDocNode[]): RichDocNode[]Ensure doc has at least one paragraph.
Returns the same array if already valid; otherwise [createEmptyParagraph()].
paraText(para: RichDocNode): stringExtract the concatenated plain text of a paragraph node.
paraTextLength(para: RichDocNode): numberTotal plain-text length of a paragraph node (sums all direct text children).
registerParagraphDocNode(registry: DocNodeRegistrar): voidRegisters the paragraph node type owned by paragraph-oriented document features.
registerTableDocNodes(registry: DocNodeRegistrar): voidRegisters the table node types owned by table-oriented document features.
registerTextDocNode(registry: DocNodeRegistrar): voidRegisters the text node type owned by text-input document features.
resolveDocNodeId(node: { readonly id?: string } | undefined, path: readonly string | number[]): DocNodeIdResolves a block-level document id, preferring persisted node identity over path fallback.
resolveNode(doc: RichDocNode[], path: number[]): RichDocNode | undefinedResolve the text node at path inside doc (treated as the root content
array). Returns undefined if the path is invalid.
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.
DocCursorPos identifies a text node with a path from the document root and an offset inside that node.
DocSelection holds an anchor and a head; when they point to the same position, the selection is a cursor.
Commands use these positions to target edits, and OT paths follow the same tree structure.
Start with DocSelection when moving a caret or selecting text. Use the layout contracts only when a host needs
geometry for rendering or hit testing.
Anchor + head selection model.
Collapsed selection (cursor only): anchor === head.
head moves freely; anchor is fixed until a non-Shift action resets it.
Cursor position inside a RichDocNode tree.
path is an array of integer indices that navigates from the implicit
document root (the RichDocNode[] array treated as root.content) down to
the text node that contains the cursor.
Examples for a flat document: [0, 0] → paragraph 0 → text node 0 (the most common case in P0) [1, 2] → paragraph 1 → inline span 2
The path aligns with OT operation paths: a StringInsert at this cursor
becomes { p: [...path, offset], si: text } applied to the root wrapper
{ type: 'doc', content: doc }.
offset is the character position within the leaf text node:
0 = before first character
n = after the nth character (= text.length means "end of node")
compareCursor(a: DocCursorPos, b: DocCursorPos): -1 | 0 | 1Lexicographic comparison of two cursor positions.
Compares path element-by-element, then offset. Returns -1 | 0 | 1.
docPathsEqual(left: readonly number[], right: readonly number[]): booleanReports whether two paths address the same rich-document node.
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.
isCollapsed(sel: DocSelection): booleanmapInlineTextRangePatchCursor(cursor: DocCursorPos, patches: readonly InlineTextRangePatch[]): DocCursorPosRepositions a cursor after an inline text range patch plan has been applied.
normalizeSelection(sel: DocSelection): {
end: DocCursorPos;
start: DocCursorPos;
}Normalize selection so start ≤ end regardless of direction.
resolveTextContent(doc: RichDocNode[], path: number[]): stringGet the plain-text string of the node at path.
Convenience wrapper around resolveNode.
Inline style functions patch a text range while preserving the surrounding document tree.
Ordered registry for plugin-owned rich-text inline style readers and mutations.
enforceWriteBoundary(assertWrite: (): void): voidgetMutation(styleKey: string): RichTextInlineStyleMutation | undefinedResolves a plugin-owned persisted inline style mutation by style key when registered.
getMutationKeys(): readonly string[]Returns all registered persisted inline-style mutation keys in registration order.
readTextNodeStyle(node: TextNode): Readonly<Record<string, unknown>> | undefinedReads all registered style slices from a text node.
register(contribution: RichTextInlineStyleContribution): (): voidRegisters one plugin-owned inline style contribution.
requireMutation(styleKey: string): RichTextInlineStyleMutationResolves a plugin-owned persisted inline style mutation by style key.
sameStyle(styleA: Readonly<Record<string, unknown>> | undefined, styleB: Readonly<Record<string, unknown>> | undefined): booleanCompares two style bags using stable key/value serialization.
static readonly symbol: typeof symbolDI token for resolving the inline style registry.
One text-node replacement produced by an inline text range edit.
readonly beforeLength: numberreadonly blockIndex: numberreadonly childIndex: numberreadonly endOffset: numberreadonly replacement: readonly RichDocNode[]readonly replacementCount: numberreadonly selectedLength: numberreadonly startOffset: numberreadonly wholeNode: booleanContext supplied when patching one selected text-node segment.
readonly blockIndex: numberreadonly childIndex: numberreadonly endOffset: numberreadonly startOffset: numberPlugin-owned contribution for one inline text style concern.
readonly key: stringStable contribution key used for duplicate detection and unregister.
mutations?: readonly RichTextInlineStyleMutation[]Persisted inline text-style mutations owned by this contribution.
read(input: RichTextInlineStyleReadInput): Readonly<Record<string, unknown>> | undefinedReads this contribution's style slice from a text node.
Plugin-owned mutation for one persisted inline text-style concern.
readonly styleKey: stringStable style key used by commands to resolve this mutation.
apply(input: RichTextInlineStyleMutationInput): Record<string, unknown>Applies the normalized style value to a text node's persisted attrs.
Input supplied when an inline-style contribution mutates persisted text-node attrs.
Input supplied when an inline-style contribution reads document attrs.
interface TextAttributeRange<TAttributes>A generic text attribute range in document-relative character offsets.
One grapheme range expressed in UTF-16 source offsets.
type InlineTextRangeAttrsPatcher = (attrs: Record<string, unknown>, context: InlineTextRangePatchContext): Record<string, unknown>Patches the attrs for the selected segment of one text node.
type RichTextInlineStyle = Readonly<Record<string, unknown>>Domain-neutral inline style bag carried by measured rich-text chars.
type TextAttributePatch = Readonly<Record<string, unknown>>Attributes merged into a text node for one presentation range.
applyInlineTextRangePatchPlan(doc: readonly RichDocNode[], patches: readonly InlineTextRangePatch[]): RichDocNode[]Applies an inline text range patch plan to an immutable document snapshot.
applyInlineTextStylePropertyMutation(attrs: Readonly<Record<string, unknown>>, property: string, value: unknown): Record<string, unknown>Applies or removes one persisted inline-text style property.
applyRichTextFormat(document: readonly Schema[], format: Readonly<Record<string, unknown>>, registry: RichTextInlineStyleRegistry): Schema[]Replaces registered styles while retaining text, structure and unrelated attributes.
applyTextAttributeRanges(doc: RichDocNode[], ranges: readonly TextAttributeRange<Readonly<Record<string, unknown>>>[], nodes?: DocNodeRegistry): RichDocNode[]Applies presentation attributes to text ranges without owning their meaning. Plugins decide how to interpret the resulting text-node attrs.
buildInlineTextRangePatchPlan(doc: readonly RichDocNode[], selection: DocSelection, patchAttrs: InlineTextRangeAttrsPatcher): InlineTextRangePatch[]Builds reusable text-node split/replacement patches for a document selection.
captureRichTextFormat(document: readonly Schema[], registry: RichTextInlineStyleRegistry): Readonly<Record<string, unknown>>Captures the leading text run's explicit registered styles, excluding host defaults.
createInlineTextStyleAttrsPatcher(property: string, value: unknown): InlineTextRangeAttrsPatcherCreates the compatibility inline text-style attrs patcher for property/value callers.
readTextStyleAttrs(attrs: Record<string, unknown>): Record<string, unknown>Reads the inline text-style attribute bag from a node's attributes.
replaceInlineTextStyle(doc: RichDocNode[], selection: DocSelection, property: string, value: unknown, patchAttrs?: InlineTextRangeAttrsPatcher): RichDocNode[]Replaces one inline text-style property on the selected document range.
segmentTextGraphemes(text: string): readonly TextGraphemeRange[]Segments text into grapheme ranges, with a code-point fallback for older hosts.
updateInlineTextStyleAttrs(current: unknown, property: string, value: unknown): Record<string, unknown>Updates one entry in a text node's style attrs bag.
Persisted paragraph attribute keys owned by the paragraph feature.
readonly LineSpacing: "lineSpacing"readonly SpacingAfter: "spacingAfter"Ordered registry for plugin-owned top-level block flow resolution.
RichTextBlockFlowRegistry(defaultSpacingAfter?: number): RichTextBlockFlowRegistryenforceWriteBoundary(assertWrite: (): void): voidregister(contribution: RichTextBlockFlowContribution): (): voidresolve(input: {
readonly blockCount: number;
readonly index: number;
readonly node: RichDocNode;
}): numberstatic readonly symbol: typeof symbolOrdered registry for plugin-owned rich-text line box resolution.
enforceWriteBoundary(assertWrite: (): void): voidregister(contribution: RichTextLineBoxContribution): (): voidRegisters one plugin-owned line box contribution.
resolve(input: {
readonly chars: readonly RichTextChar[];
readonly lineSpacing?: RichTextLineSpacing;
}): RichTextLineBoxResolves the final line box for one measured line.
static readonly symbol: typeof symbolDI token for resolving the rich-text line box registry.
Plugin-owned contribution that can refine block flow metrics.
readonly key: stringresolve(input: RichTextBlockFlowResolveInput): numberInput used to resolve the flow spacing after one top-level document block.
readonly blockCount: numberreadonly index: numberreadonly node: RichDocNodereadonly spacingAfter: numberDomain-side contract for services that provide measured rich-text block layout.
calculateLayoutPerParagraph(width: number): RichTextLine[][]setBaseFont(font: string): voidUpdates the transient font used when measuring unstyled text.
Flow metrics for one rich-text line.
readonly ascent: numberreadonly contentHeight: numberreadonly descent: numberreadonly leadingBottom: numberreadonly leadingTop: numberreadonly lineGap: numberreadonly lineHeight: numberPlugin-owned contribution that can refine rich-text line flow metrics.
readonly key: stringStable contribution key used for duplicate detection and unregister.
Resolves the next line box from the current accumulated line box.
Input used to resolve the flow box for one measured rich-text line.
readonly chars: readonly RichTextChar[]readonly lineBox: RichTextLineBoxreadonly lineSpacing?: RichTextLineSpacingPersisted or default line-spacing policy resolved by paragraph layout.
readonly mode: RichTextLineSpacingModereadonly value?: numberResolved paragraph layout values consumed by line and block flow.
readonly lineSpacing: RichTextLineSpacingreadonly spacingAfter: numberDefault paragraph layout values supplied by the owning document runtime.
readonly lineSpacing: RichTextLineSpacingreadonly spacingAfter: numbertype RichTextLine = unknownOne laid-out rich-text line with aggregate dimensions.
fontAscent: numberMax measured font ascent across all chars on this line; used for stable vertical centering.
fontDescent?: numberMax measured font descent across all chars on this line.
height: numberPlugin-resolved line box used for flow and baseline placement.
width: numbertype RichTextLineSpacingMode = "auto" | "multiple" | "atLeast" | "exact"Supported paragraph line-spacing semantics.
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
Since lineHeight = fontAscent + fontDescent, this simplifies to:
baseline = offsetY + cellPadding + (boxHeight - 2·cellPadding + 2·fontAscent - lineHeight) / 2
boxHeightTotal pixel height of the containing box (e.g. cell height).
cellPaddingPadding on each side of the box.
fontAscentMeasured font ascent of the first line (stable across all glyphs in the font).
lineHeightTotal line height (fontAscent + fontDescent) of the first line.
offsetYAbsolute Y offset of the box top-left (default 0 for relative coordinates).
Creates the paragraph-owned default after-spacing contribution.
Creates the default line box contribution used by document composition roots.
Creates the paragraph-owned line-spacing contribution.
parseRichTextLineSpacing(value: unknown): RichTextLineSpacing | nullParses a persisted line-spacing override, returning null when invalid.
parseRichTextParagraphSpacing(value: unknown): number | nullParses a persisted paragraph-spacing override, returning null when invalid.
resolveRichTextParagraphLayout(node: RichDocNode | undefined, defaults?: RichTextParagraphLayoutDefaults): RichTextParagraphLayoutResolves paragraph-owned overrides over the runtime defaults.
Neutral defaults for runtimes that do not configure document paragraph spacing.
Editor-local query, observation, capability, and lifecycle contracts shared by facades.
DocLayoutEngine computes document geometry for a viewport. The viewport and page contracts describe which part of that layout a host should paint.
Compares two block-layout snapshots and exposes render-neutral reuse facts.
DocBlockLayoutDiff(entries: readonly DocBlockLayoutDiffEntry[]): DocBlockLayoutDiffreadonly entries: readonly DocBlockLayoutDiffEntry[]getChangedEntries(): readonly DocBlockLayoutDiffEntry[]getEntry(id: DocNodeId): DocBlockLayoutDiffEntry | nullgetReusableRasterCopies(): readonly DocBlockRasterReuse[]getShiftedEntries(): readonly DocBlockLayoutDiffEntry[]hasChanges(): booleanstatic compare(previous: DocLayoutCache | null, current: DocLayoutCache, options?: DocBlockLayoutDiffOptions): DocBlockLayoutDiffImmutable snapshot of block-level document layout used by viewport and SceneGraph projection.
DocLayoutCache(snapshot: LayoutSnapshot, blocksOrIndex: IndexedSnapshot<LayoutSnapshot, DocBlockLayout, DocNodeId> | readonly DocBlockLayout[]): DocLayoutCacheCreates a layout cache from already computed block records.
snapshotLayout snapshot used to derive this cache.
blocksOrIndexTop-level block layout records ordered by document position, or a custom indexed store.
blocks: readonly DocBlockLayout[]Top-level block layout records ordered by document position.
Layout snapshot used to derive this cache.
getBlockById(id: DocNodeId): DocBlockLayout | nullReturns the cached layout record for a document block id.
getBlockByIndex(index: number): DocBlockLayout | nullReturns the cached layout record for a top-level block index.
getBlockIdsByIndexes(indexes: readonly number[]): readonly DocNodeId[]Returns block ids for the supplied top-level block indexes.
getBlocksInVerticalRange(top: number, bottom: number): readonly DocBlockLayout[]Returns all cached block records intersecting the supplied vertical range.
getContentLayoutReusableBlockIndexes(previous: DocLayoutCache): readonly number[]Returns block indexes whose internal content layout can be reused from a previous cache.
A downstream flow shift changes absolute rect.y, so the whole block record
cannot be reused. The renderer can still reuse the block's measured content
shape when line count, visual size and flow height are unchanged.
hasBlockFlowLayoutChanged(previous: DocLayoutCache, blockId: DocNodeId): booleanReturns whether one block's height-sensitive flow layout changed.
hasFlowHeightChanged(previous: DocLayoutCache, blockId: DocNodeId): booleanReturns whether one block's flow height changed compared with another cache.
static fromSnapshot(document: readonly RichDocNode[], snapshot: LayoutSnapshot, previousCache?: DocLayoutCache | null): DocLayoutCacheBuilds a block layout cache from a rich document and its layout snapshot.
Converts between DocCursorPos (path + char offset) and pixel coordinates (relative to the editor box top-left corner), using rich-text block measurements.
Mirrors the Y-positioning formula used by the document render layout so that cursor positions align with rendered glyphs.
DocLayoutEngine(blockFlowRegistry: RichTextBlockFlowRegistry): DocLayoutEnginebuildSnapshot(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 to blockManager
before building the snapshot.
docThe current RichDocNode[] being edited.
blockManagerLayout provider that already holds the paragraph blocks.
editorWidthTotal pixel width of the editor box (including padding).
editorHeightTotal pixel height of the editor box (including padding).
cellPaddingPadding on each side (default 4).
verticalAlignVertical positioning strategy (default center for embedded cell editors).
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.
cursorToPoint(pos: DocCursorPos, snapshot: LayoutSnapshot): {
height: number;
x: number;
y: number;
}Convert a DocCursorPos to pixel coordinates relative to the editor box top-left corner.
Returns the position of the cursor bar's horizontal anchor (i.e. the x at which to draw the vertical cursor line, and the y passed to drawCursor), plus the line height needed to size the cursor bar.
findLineIndex(pos: DocCursorPos, snapshot: LayoutSnapshot): numberReturns the index into snapshot.lines for the line containing pos.
Returns 0 if not found.
getSelectionRects(sel: DocSelection, snapshot: LayoutSnapshot, originX: number, originY: number): {
height: number;
width: number;
x: number;
y: number;
}[]Compute canvas-space rectangles for a non-collapsed DocSelection.
ReturnsArray of {x,y,width,height} rectangles in canvas coordinates.
selThe current DocSelection (anchor + head).
snapshotLayout snapshot from buildSnapshot.
originXAbsolute canvas X of the editor box top-left.
originYAbsolute canvas Y of the editor box top-left.
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.
static readonly symbol: symbolDI token for resolving DocLayoutEngine.
Maps document blocks to pages for viewport range queries and virtualization.
DocPageMap(pageHeight: number, pageGap: number, pages: readonly DocPageLayout[]): DocPageMapCreates a page map from immutable page records.
pageHeightPage height used by this map.
pageGapGap between pages in document coordinates.
pagesOrdered page layout records.
readonly pageGap: numberGap between pages in document coordinates.
readonly pageHeight: numberPage height used by this map.
readonly pages: readonly DocPageLayout[]Ordered page layout records.
getPage(index: number): DocPageLayout | nullReturns a page record by index.
getPageIndexesForBlock(blockId: DocNodeId): readonly number[]Returns page indexes that intersect a block id.
getPagesByIndexes(indexes: readonly number[]): readonly DocPageLayout[]Returns pages for the supplied page indexes, preserving page order.
getPagesForBlock(block: DocBlockLayout): readonly DocPageLayout[]Returns all pages intersecting a block layout record.
getPagesInVerticalRange(top: number, bottom: number): readonly DocPageLayout[]Returns all pages intersecting the supplied vertical document range.
static fromLayoutCache(cache: DocLayoutCache, pageHeight: number, pageGap?: number): DocPageMapBuilds a page map by intersecting cached block rectangles with fixed-height pages.
Visible document window used to filter block and page layout ranges.
DocViewportWindow(x: number, y: number, width: number, height: number): DocViewportWindowCreates a viewport window from document-space rectangle coordinates.
xLeft edge in document coordinates.
yTop edge in document coordinates.
widthVisible width in document units.
heightVisible height in document units.
intersects(rect: DocLayoutRect): booleanReturns whether this viewport intersects another document-space rectangle.
static fromViewport(viewport: { readonly contentRect: DocLayoutRect }, scroll?: {
readonly x: number;
readonly y: number;
}): DocViewportWindowCreates a document-space window from a viewport rectangle and scroll offsets.
Injectable rich-document editor service placeholder.
The service owns document-editor initialization once a document assembly root is available. It is bound by symbol so consumers do not depend on string DI tokens.
Constructs the editor service.
initialize(): voidInitializes document-editor runtime state.
static readonly symbol: symbolDI token for resolving the editor service.
Materialized layout for a subset of top-level document blocks.
readonly blocks: readonly DocBlockLayout[]Block records for the materialized blocks, using full-document indexes.
readonly snapshot: LayoutSnapshotLine snapshot containing only the materialized block ranges.
Cached layout metadata for one top-level document block.
readonly flowHeight: numberFlow height from this block top to the next block top, or visual height for the last block.
Stable block identity used by retained render nodes.
readonly index: numberZero-based top-level document block index.
readonly lineEnd: numberExclusive index after the last layout line belonging to this block.
readonly lineStart: numberInclusive index of the first layout line belonging to this block.
readonly rect: DocLayoutRectDocument-space rectangle occupied by this block.
readonly current: DocBlockLayout | nullreadonly deltaY: numberreadonly index: numberreadonly previous: DocBlockLayout | nullreadonly status: DocBlockLayoutDiffStatusreadonly reflowBlockIds?: ReadonlySet<DocNodeId>Reflow blocks whose render output changed even if their measured layout shape did not.
readonly repaintBlockIds?: ReadonlySet<DocNodeId>Repaint blocks whose render output changed without invalidating layout cache.
Rectangle contract used by document layout planning without binding to a render target.
Layout metadata for one document page.
Block ids that intersect this page.
readonly index: numberZero-based page index.
readonly rect: DocLayoutRectPage rectangle in document coordinates.
Inclusive visible block/page range within the current document viewport.
readonly endBlock: numberLast top-level document block index included in the buffered viewport.
readonly endPage: numberLast page index included in the buffered viewport.
readonly startBlock: numberFirst top-level document block index included in the buffered viewport.
readonly startPage: numberFirst page index included in the buffered viewport.
Minimal scroll/viewport contract needed to compute a document viewport range.
A single wrapped line inside the editor, with full path metadata for bidirectional cursor ↔ pixel coordinate mapping.
Per-character measurements for this line.
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.
cursorXOffsets?: number[]Cursor boundary x offsets relative to this line's x, one entry per char boundary.
fontAscent: numberFont ascent: distance from baseline to top of tallest glyph on this line.
height: numberLine height in CSS/canvas pixels.
textNodePath: number[]Full path to the text node this line belongs to.
For a flat document (paragraph → single text node):
textNodePath = [paraIndex, 0]
The path mirrors DocCursorPos.path semantics: a cursor at
{ path: textNodePath, offset } lives on this line when
charStartOffset <= offset <= charStartOffset + chars.length.
x: numberLeft edge of text, relative to editor box top-left (includes cellPadding).
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.
type DocBlockLayoutDiffStatus = "unchanged" | "shifted" | "changed" | "added" | "removed"type DocVerticalAlign = "top" | "center"Vertical positioning strategy for a laid-out document frame.
computeViewportRange(scrollSource: DocViewportScrollSource, layoutCache: DocLayoutCache, pageMap: DocPageMap, offset?: {
readonly x: number;
readonly 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.
Layout snapshots and block diffs identify the areas that changed so rendering can reuse unaffected work.
class ArrayIndexedSnapshot<TSnapshot, TItem, TKey> extends IndexedSnapshot<TSnapshot, TItem, TKey>Array and Map backed implementation of IndexedSnapshot.
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.
getByIndex(index: number): TItem | nullReturns one item by its numeric index.
getByKey(key: TKey): TItem | nullReturns one item by its stable key.
getKeysByIndexes(indexes: readonly number[]): readonly TKey[]Returns keys for the supplied numeric indexes, preserving input order.
class IndexedSnapshot<TSnapshot, TItem, TKey>Generic immutable snapshot plus ordered, multi-key indexed item access.
abstract getByIndex(index: number): TItem | nullReturns one item by its numeric index.
abstract getByKey(key: TKey): TItem | nullReturns one item by its stable key.
abstract getKeysByIndexes(indexes: readonly number[]): readonly TKey[]Returns keys for the supplied numeric indexes, preserving input order.
readonly destination: DocBlockRenderDebugRectreadonly source: DocBlockRenderDebugRectreadonly changedBlocks: readonly DocBlockRenderDebugRect[]readonly copiedPixelArea: numberreadonly frameMode: DocBlockRenderFrameModereadonly incrementalRenderAccepted: booleanreadonly incrementalRenderReason: stringreadonly invalidRedrawRects: readonly DocBlockRenderDebugRect[]readonly rasterCopies: readonly DocBlockRenderDebugCopy[]readonly redrawnBlockCount: numberreadonly reusedBlocks: readonly DocBlockRenderDebugRect[]readonly shiftedBlocks: readonly DocBlockRenderDebugRect[]readonly skippedBlockCount: numberreadonly copiedAreaRatio: numberreadonly copiedPixelArea: numberreadonly copyCount: numberreadonly invalidAreaRatio: numberreadonly invalidPixelArea: numberreadonly invalidRectCount: numberPre-computed layout for the entire editing session.
lines: LayoutLine[]type DocBlockRenderFrameMode = "rebuild" | "full" | "scroll" | "block-copy" | "skipped"lockLayoutSnapshot(snapshot: LayoutSnapshot): LayoutSnapshotLocks a completed layout so readers cannot change cursor or render geometry.
Portable cell-format values and formatting contracts.
Display metadata selected from one Excel number-format section.
readonly datePattern: stringreadonly dateTimePattern: stringreadonly decimalSeparator?: stringreadonly groupSeparator?: stringreadonly locale: stringreadonly timePattern: stringtype SpreadsheetFormatValue = string | number | boolean | null | undefined | SpreadsheetTextValue | SpreadsheetErrorValue | readonly SpreadsheetFormatValue[] | readonly readonly SpreadsheetFormatValue[][]formatDollar(number: number, decimals: number, currencySymbol?: string): stringformatExcelDateTime(serial: number, pattern?: string, locale?: SpreadsheetFormatLocale): string | nullFormats an Excel date/time serial with date, clock, and elapsed-time tokens.
formatExcelDisplay(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): SpreadsheetFormatDisplay | SpreadsheetErrorValue | nullFormats a scalar value and preserves section-level visual metadata.
formatExcelText(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): string | SpreadsheetErrorValue | nullformatFixed(number: number, decimals: number, noCommas: boolean): stringformatSpreadsheetNumber(value: number, code: string, locale?: SpreadsheetFormatLocale): string | nullinspectExcelCellFormat(code: string | undefined): ExcelCellFormatInfoReads Excel's CELL information from a number-format code.
parseSpreadsheetNumericLiteral(source: string): numberApplies the spreadsheet's 15-significant-digit input limit before binary conversion.
excelDatePartsFromSerial(serial: number, use1904?: boolean): ExcelDateParts | nullReads the date portion of an Excel serial, including the synthetic 1900 leap day.
excelSerialFromDateParts(year: number, month: number, day: number, use1904?: boolean): number | nullConverts calendar parts to a serial. Out-of-range months and days roll over.
excelSerialToUnixMillis(serial: number, use1904?: boolean): number | nullConverts a real Excel date to UTC Unix milliseconds, returning null for the phantom day.
parseNumberValue(source: string, decimalSeparator?: string, groupSeparator?: string): number | nullunixMillisToExcelSerial(epochMs: number, use1904?: boolean): numberConverts UTC Unix milliseconds to an Excel serial, including the time fraction.
EXCEL_1904_SERIAL_OFFSET: 1462Difference between the Excel date systems for dates on or after 1904-01-01.
LAST_EXCEL_DATE_SERIAL: 2958465Last whole-day serial representable in the 1900 date system.
The TypeScript formula parser, evaluator, dependency graph, and built-in function runtime.
FormulaParser turns formula text into an expression tree. FormulaEvaluator evaluates that tree against cell
values and functions supplied by the runtime. DependencyGraph records which cells must be recalculated when an
input changes. These are the TypeScript implementations of the contracts in
@searsuite/sear-domain-formula-engine.
Most Sheet hosts use these through the formula plugin and editor assembly. When replacing the implementation, depend on the contract interfaces rather than importing these classes into a feature plugin.
class FormulaParser extends IFormulaParserTypeScript implementation of the formula parser contract.
parse returns an AST without evaluating the formula. The parser also
extracts range-level dependencies and rewrites references after structural
row or column changes. It rejects formulas beyond its length, nesting, and
operand limits instead of partially parsing them.
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.
parse(formula: string): FormulaASTParses a formula string into an AST.
ReturnsParsed AST.
formulaFormula string including the leading '=', such as "=A1+B1".
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.
static readonly symbol: typeof symbolDI token for resolving FormulaParser.
class FormulaEvaluator extends IFormulaEvaluatorEvaluates parsed formulas against an explicit host-provided context.
FormulaEvaluator(registry: IFunctionRegistry, aggCache: IAggregationCache): FormulaEvaluatorevaluate(ast: FormulaAST, context: EvalContext): FormulaValueEvaluates one AST.
Recursively traverses each AST node and executes the matching operation.
evaluateBatch(asts: {
ast: FormulaAST;
key: number;
}[], context: EvalContext): EvalResult[]Batch evaluation.
The TS implementation evaluates one AST at a time. A WASM implementation can process all ASTs on the Rust side in one pass.
registerFunction(fn: FormulaFunction): voidRegisters a custom function.
static readonly symbol: typeof symbolDI token for resolving FormulaEvaluator.
class DependencyGraph extends IDependencyGraphTracks formula dependencies, dirty propagation, evaluation readiness, and cycles.
pendingCount: numberNumber of dirty formulas still waiting for evaluation.
size: numberTotal number of formula cells currently in the graph.
clear(): voidClears all data.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds mutations to the owning editor command dispatch after initialization.
getDependencies(formulaKey: number): readonly Dependency[]Gets the range-level dependencies owned by one formula cell.
Returns defensive copies so callers can inspect dependency edges without mutating the graph's internal forward-dependency store.
getDependents(key: number): number[]Gets every formula that depends on one cell.
Merges results from three lookup paths:
getFormulaKeys(): readonly number[]Gets a defensive snapshot of formula cells currently registered in the graph.
getLastCycleKeys(): number[]Returns the last cycle keys.
getNextReadyBatch(viewport: Set<number>, maxCount: number): number[]Gets currently dirty formulas that can be evaluated immediately.
Two-pass scan: viewport first, then off-screen formulas. Viewport priority ensures visible formulas update first.
isDirty(key: number): booleanReports whether one formula cell is currently dirty.
markClean(key: number): voidMarks one formula clean.
Unlocks downstream dependencies by decrementing dirtyDepCount for every dirty formula that depends on key.
markDirty(changedKeys: number[]): voidMarks all affected formulas dirty.
Propagates by BFS from changedKeys along reverse-dependency edges. Only marks; does not sort or calculate.
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.
removeCell(formulaKey: number): voidRemoves one formula cell.
updateCell(formulaKey: number, depsList: Dependency[]): voidRegisters or updates dependencies for one formula cell.
static readonly symbol: typeof symbolDI token for resolving DependencyGraph.
class FormulaExecutionBudget extends FormulaEvaluationBudgetMutable, deterministic guard against unbounded formula work.
FormulaExecutionBudget(maxSteps?: number): FormulaExecutionBudgetreadonly maxSteps: numberconsumeStep(): booleanFormats the shared FormulaAST back to formula source text.
format(ast: FormulaAST, options?: WorkbookFormulaFormatOptions): stringclass FormulaLexicalScope extends FormulaEvaluationScopeCase-insensitive lexical scope for LET bindings.
readonly parent?: FormulaEvaluationScopeget(name: string): FormulaValue | undefinedset(name: string, value: FormulaValue): voidWorkbook name resolution used while formatting formula source.
readonly missingSheetName?: stringreadonly resolveSheetName?: (formulaSheetName: string): string | undefinedcellKey(row: number, col: number): numberEncodes zero-based coordinates as one numeric cell key.
fromCellKey(key: number): [number, number]Decodes a numeric cell key to zero-based coordinates.
The function entries below are FormulaFunction values, grouped by purpose: lookup, date and time, math,
finance, text, and other families. FunctionRegistry registers the built-ins and resolves names without case
sensitivity. For example, a formula containing XLOOKUP is evaluated through the registry's XLOOKUP entry;
application code does not call that entry as a normal JavaScript function.
Start with the function's description and example, then inspect FormulaFunction in the contracts package when
you need to define or register a custom function.
class FunctionRegistry extends IFunctionRegistryFunctionRegistry(options?: FunctionRegistryOptions): FunctionRegistryenforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidRequires post-initialization writes to occur during the owning editor's command dispatch.
get(name: string): FormulaFunction | undefinedhas(name: string): booleanReturns whether the requested entry exists.
list(): string[]Returns all registered entries.
register(fn: FormulaFunction): (): voidRegisters a formula function under its canonical and compatible names.
registerMany(functions: readonly FormulaFunction[]): (): voidRegisters multiple functions while publishing one combined invalidation.
subscribe(listener: (functionNames: readonly string[]): void): (): voidSubscribes to registrations and removals that can change formula results.
unregisterRegistration(id: number): voidRemoves one tokenized registration; disposal may dispatch an owner command.
static readonly symbol: typeof symbolDI token for resolving FunctionRegistry.
Tokenized editor-local external-service registry with isolated listener failures.
FormulaExternalServiceRegistry(warn?: (message: string, error: unknown): void): FormulaExternalServiceRegistrydestroy(ownerToken?: object): voidenforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidenforceTeardownBoundary(ownerToken: object): voidReserves cleanup of an assembled registry for its owning editor.
get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefinedinvalidate<T>(definition: FormulaExternalServiceDefinition<T>): voidregister<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): voidsubscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): voidunregisterRegistration(id: number): voidFunctionRegistry public API.
readonly excludedBuiltinNames?: readonly string[]Built-ins omitted from the initial catalog; hosts may register them later.
readonly includeGoogleFunctions?: booleanGoogle-specific functions require an explicit host contribution when disabled.
Caches reuse external formula results while preserving the engine’s status and invalidation rules.
class AggregationCache extends IAggregationCacheCaches incremental aggregate results for large formula ranges.
clear(): voidClears all caches.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds cache writes to the owning editor command dispatch after initialization.
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.
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.
startRowStart row (0-based).
startColStart column (0-based).
endRowEnd row (0-based).
endColEnd column (0-based).
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:
rowChanged row (0-based).
colChanged column (0-based).
oldValPrevious value.
newValNew value.
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.
setCount(startRow: number, startCol: number, endRow: number, endCol: number, count: number): voidStores a successfully calculated COUNT for a rectangular range.
setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): voidStores a successfully calculated SUM for a rectangular range.
static readonly symbol: typeof symbolclass AsyncFormulaServiceCache<TKey, TValue>Host-driven async cache. read() never starts work or returns a Promise.
AsyncFormulaServiceCache<TKey, TValue>(loader: (key: TKey): Promise<TValue>, warn?: (message: string, error: unknown): void): AsyncFormulaServiceCache<TKey, TValue>clear(): voidDrops values and ignores results from requests started before this boundary.
destroy(): voidload(key: TKey): Promise<void>Loads one value, deduplicating concurrent requests for the same key.
read(key: TKey): FormulaServiceCacheResult<TValue>subscribeInvalidation(listener: (): void): (): voidclass FormulaCubeCache extends FormulaCubeServiceHost-driven OLAP cache. Formula evaluation reads synchronously and never starts connection I/O.
FormulaCubeCache(loader: (query: FormulaCubeQuery): Promise<FormulaCubeResult>, warn?: (message: string, error: unknown): void): FormulaCubeCacheclear(): voiddestroy(): voidload(query: FormulaCubeQuery): Promise<void>subscribeInvalidation(listener: (): void): (): voidclass FormulaGoogleServiceCache extends FormulaGoogleServiceHost-driven cache for AI, import, finance, and translation formulas.
FormulaGoogleServiceCache(loader: (request: FormulaGoogleRequest): Promise<FormulaValue>, warn?: (message: string, error: unknown): void): FormulaGoogleServiceCacheclear(): voiddestroy(): voidload(request: FormulaGoogleRequest): Promise<void>subscribeInvalidation(listener: (): void): (): voidclass FormulaStockHistoryCache extends FormulaStockHistoryServiceHost-driven STOCKHISTORY cache; the loader owns transport, credentials, policy, and normalization.
FormulaStockHistoryCache(loader: (request: FormulaStockHistoryRequest): Promise<FormulaError | FormulaValue[][]>, warn?: (message: string, error: unknown): void): FormulaStockHistoryCacheclear(): voiddestroy(): voidload(request: FormulaStockHistoryRequest): Promise<void>read(request: FormulaStockHistoryRequest): FormulaServiceCacheResult<FormulaError | FormulaValue[][]>subscribeInvalidation(listener: (): void): (): voidclass FormulaTextServiceRegistry extends IFormulaTextServiceProviderDefault tokenized editor-local registry for metadata and cached external formula services.
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidgetLanguageService(): FormulaLanguageService | undefinedgetPhoneticReader(): FormulaPhoneticReader | undefinedregisterLanguageService(service: FormulaLanguageService): (): voidregisterPhoneticReader(reader: FormulaPhoneticReader): (): voidsubscribeInvalidation(listener: (): void): (): voidunregisterRegistration(id: number): voidclass FormulaWebServiceCache extends AsyncFormulaServiceCache<string, string | FormulaError>, FormulaWebServiceHost-driven WEBSERVICE cache; loaders own HTTP status checks, cancellation, and network policy.
FormulaWebServiceCache(loader: (url: string): Promise<string>, warn?: (message: string, error: unknown): void): FormulaWebServiceCachenumericDateText(value: FormulaValue, context: EvalContext): number | undefinedaddInFunctions: readonly FormulaFunction[]Calls a host-authorized add-in procedure by registration id or module signature.
Example: =CALL("example","entry","JJ",1) invokes entry with the argument 1.
Converts between the euro and legacy euro-member currencies using fixed EU rates.
Example: =EUROCONVERT(1.2,"DEM","EUR") returns 0.61.
Resolves a host-authorized add-in procedure to a stable numeric registration id.
Example: =REGISTER.ID("example","entry","JJ") returns the host's handle for entry.
Applies an aggregate operation while honoring options for hidden rows and errors.
=AGGREGATE(4,6,{1,2,3}) returns 3.Returns the arithmetic mean of numeric values.
=AVERAGE(10,20,30) returns 20.Counts numeric values in the supplied arguments and ranges.
=COUNT(10,20,30) returns 3.Calculates a subtotal for a range using a selected aggregation code.
=SUBTOTAL(9,A1:A3) returns the sum of A1:A3.Adds numeric values from arguments, cells, and ranges.
=SUM(10,20,30) returns 60.Adds values that satisfy one condition.
=SUMIF({1,2,3},">1",{10,20,30}) returns 50.Sums values whose corresponding ranges satisfy every criterion.
Returns the determinant of a square matrix.
=MDETERM({1,2;3,4}) returns -2.Returns the inverse matrix for a square, nonsingular matrix.
=MINVERSE({1,2;3,4}) returns {-2,1;1.5,-0.5}.Returns the matrix product of two compatible arrays.
=MMULT({1,2},{3;4}) returns 11.Returns an identity matrix of the requested size.
=MUNIT(2) returns {1,0;0,1}.Returns the proportion represented by one value or array within another.
=PERCENTOF({25},{100}) returns 0.25.Generates a sequential array from a starting value and step.
=SEQUENCE(2,3,0,2) returns {0,2,4;6,8,10}.Evaluates a power series from an initial value, step, and coefficients.
=SERIESSUM(2,0,1,{1,2,3}) returns 17.Multiplies corresponding array elements and adds the products.
=SUMPRODUCT({2,3,4},{10,20,30}) returns 200.Returns the sum of the squares of numeric values.
=SUMSQ(0,3) returns 9.Returns the sum of the differences between corresponding squares.
=SUMX2MY2({1,2},{3,4}) returns -20.Returns the sum of the sums of corresponding squares.
=SUMX2PY2({1,2},{3,4}) returns 30.Returns the sum of the squares of corresponding differences.
=SUMXMY2({1,2},{3,4}) returns 8.Returns the absolute value of a number.
=ABS(-2) returns 2.Returns e raised to the specified power.
=EXP(0) returns 1.Rounds a number down to the nearest integer.
=INT(-0.1) returns -1.Returns the natural logarithm of a positive number.
=LN(1) returns 0.Returns the logarithm of a number for a specified base.
=LOG(8,2) returns 3.Returns the base-10 logarithm of a positive number.
=LOG10(100) returns 2.Returns the remainder after division.
=MOD(-3,2) returns 1.Returns the mathematical constant pi.
=PI()*0 returns 0.Raises a number to a specified power.
=POWER(2,0) returns 1.Multiplies all numeric values in the supplied arguments.
=PRODUCT(1,2,3) returns 6.Returns the integer portion of a division.
=QUOTIENT(-10,3) returns -3.Returns -1, 0, or 1 according to the sign of a number.
=SIGN(0) returns 0.Returns the positive square root of a number.
=SQRT(0) returns 0.Returns the square root of a number multiplied by pi.
=SQRTPI(0) returns 0.Truncates a number toward zero to a specified number of digits.
=TRUNC(-3.9) returns -3.Converts a Roman numeral text value to an Arabic number.
=ARABIC("MCMXCIX") returns 1999.Converts a nonnegative integer to text in a selected radix.
=BASE(31,16) returns "1F".Returns the number of combinations for choosing items without repetition.
=COMBIN(8,2) returns 28.Returns the number of combinations for choosing items with repetition.
=COMBINA(4,3) returns 20.Converts text in a selected radix to a decimal number.
=DECIMAL("1010",2) returns 10.Returns the greatest common divisor of numeric values.
=GCD(24,36) returns 12.Returns the least common multiple of numeric values.
=LCM(4,6) returns 12.Returns the multinomial coefficient for a set of numbers.
=MULTINOMIAL(1,1,1) returns 6.Converts an Arabic number to Roman numeral text.
=ROMAN(2024) returns "MMXXIV".BETADIST compatibility formula: Returns the cumulative beta distribution using the legacy signature.
=BETADIST(2,8,10,1,3)BETAINV compatibility formula: Returns the inverse cumulative beta distribution.
=BETAINV(0.685470581,8,10,1,3)BINOMDIST compatibility formula: Returns a binomial probability using the legacy function name.
=BINOMDIST(6,10,0.5,FALSE)CEILING compatibility formula: Rounds a number up to a legacy significance multiple.
=CEILING(2.5,1)CHIDIST compatibility formula: Returns the right-tailed chi-square probability.
=CHIDIST(18.307,10)CHIINV compatibility formula: Returns the inverse right-tailed chi-square value.
=CHIINV(0.05,10)CHITEST compatibility formula: Returns the chi-square independence test probability.
=CHITEST({58,35;11,25},{45,48;24,22})compatibilityFunctions: readonly FormulaFunction[]CONFIDENCE compatibility formula: Returns a normal-distribution confidence interval.
=CONFIDENCE(0.05,2.5,50)COVAR compatibility formula: Returns population covariance for two data sets.
=COVAR({2,4,8},{5,11,12})CRITBINOM compatibility formula: Returns the smallest binomial value meeting a cumulative probability.
=CRITBINOM(6,0.5,0.75)EXPONDIST compatibility formula: Returns an exponential distribution value.
=EXPONDIST(0.2,10,TRUE)FDIST compatibility formula: Returns the right-tailed F distribution probability.
=FDIST(15.2069,6,4)FINV compatibility formula: Returns the inverse right-tailed F distribution.
=FINV(0.01,6,4)FLOOR compatibility formula: Rounds a number down to a legacy significance multiple.
=FLOOR(2.5,1)FTEST compatibility formula: Returns the two-tailed F-test probability.
=FTEST({1,2,3},{1,2,4})GAMMADIST compatibility formula: Returns a gamma distribution value.
=GAMMADIST(10,9,2,TRUE)GAMMAINV compatibility formula: Returns an inverse gamma distribution value.
=GAMMAINV(0.068094,9,2)HYPGEOMDIST compatibility formula: Returns the non-cumulative hypergeometric probability.
=HYPGEOMDIST(1,4,8,20)LOGINV compatibility formula: Returns the inverse lognormal distribution.
=LOGINV(0.039084,3.5,1.2)LOGNORMDIST compatibility formula: Returns the cumulative lognormal distribution.
=LOGNORMDIST(4,3.5,1.2)MODE compatibility formula: Returns the most frequent numeric value.
=MODE(1,1,2,3)NEGBINOMDIST compatibility formula: Returns the non-cumulative negative-binomial probability.
=NEGBINOMDIST(10,5,0.25)NORM.INV compatibility formula: Returns an inverse normal distribution value under the NORM.INV name.
=NORM.INV(0.908789,40,1.5)NORMDIST compatibility formula: Returns a normal distribution value.
=NORMDIST(42,40,1.5,TRUE)NORMSDIST compatibility formula: Returns the cumulative standard normal distribution.
=NORMSDIST(1.333333)NORMSINV compatibility formula: Returns the inverse standard normal distribution.
=NORMSINV(0.908789)PERCENTILE compatibility formula: Returns an inclusive percentile.
=PERCENTILE({1,2,3,4},0.5)PERCENTRANK compatibility formula: Returns an inclusive percentage rank.
=PERCENTRANK({1,2,3,4},3)POISSON compatibility formula: Returns a Poisson distribution value.
=POISSON(2,5,TRUE)QUARTILE compatibility formula: Returns an inclusive quartile.
=QUARTILE({1,2,3,4,5},1)RANK compatibility formula: Returns the rank of a number in a list.
=RANK(3,{1,2,3,4},0)STDEV compatibility formula: Returns the sample standard deviation.
=STDEV(1,2,3)STDEVP compatibility formula: Returns the population standard deviation.
=STDEVP(1,2,3)TDIST compatibility formula: Returns a one- or two-tailed Student t probability.
=TDIST(1.96,60,2)TINV compatibility formula: Returns the inverse two-tailed Student t value.
=TINV(0.05,10)TTEST compatibility formula: Returns a Student t-test probability.
=TTEST({1,2,3},{1,2,4},2,1)VARP compatibility formula: Returns the population variance.
=VARP(1,2,3)WEIBULL compatibility formula: Returns a Weibull distribution value.
=WEIBULL(105,20,100,TRUE)ZTEST compatibility formula: Returns the one-tailed z-test probability.
=ZTEST({3,6,7,8},4)Returns a typed KPI property member. Example: CUBEKPIMEMBER("Sales","Revenue KPI",KPIGoal).
Returns a typed cube member or tuple. Example: CUBEMEMBER("Sales","[Time].[Fiscal].[2004]").
Returns one property of a cube member. Example: CUBEMEMBERPROPERTY("Sales","[Time].[2004]","Name").
Returns the member at a one-based set rank. Example: CUBERANKEDMEMBER("Sales",A1,1).
Returns a typed OLAP set. Example: CUBESET("Sales","[Product].Members","Products").
Returns the item count of a CUBESET result. Example: CUBESETCOUNT(A1).
Returns an aggregated cube value. Example: CUBEVALUE("Sales","[Measures].[Profit]").
databaseFunctions: readonly FormulaFunction[]Returns the average of matching numeric database records.
=DAVERAGE(A1:C5,"Sales",E1:F2)Counts matching database records containing numbers.
=DCOUNT(A1:C5,"Sales",E1:F2)Counts matching nonblank database records.
=DCOUNTA(A1:C5,"Name",E1:F2)Returns the single field value from exactly one matching record.
=DGET(A1:C5,"Sales",E1:F2)Returns the largest matching numeric database value.
=DMAX(A1:C5,"Sales",E1:F2)Returns the smallest matching numeric database value.
=DMIN(A1:C5,"Sales",E1:F2)Multiplies matching numeric database values.
=DPRODUCT(A1:C5,"Sales",E1:F2)Returns the sample standard deviation of matching records.
=DSTDEV(A1:C5,"Sales",E1:F2)Returns the population standard deviation of matching records.
=DSTDEVP(A1:C5,"Sales",E1:F2)Sums matching numeric database values.
=DSUM(A1:C5,"Sales",E1:F2)Returns the sample variance of matching records.
=DVAR(A1:C5,"Sales",E1:F2)Returns the population variance of matching records.
=DVARP(A1:C5,"Sales",E1:F2)interface ExcelDateTimeParseOptions extends FormulaDateTimeParseOptionsOptions passed to locale-aware formula date/time parsers.
readonly locale?: FormulaDateTimeLocaleBuilt-in locale identifiers registered by sear-plugin-i18n.
| Member | Value |
|---|---|
English |
"en" |
Chinese |
"zh" |
Creates the default formula locale provider used when no i18n plugin is installed.
createExcelDateTimeLocale(input: BuiltInExcelDateTimeLocaleId | {
readonly locale: string;
readonly symbols?: FormulaDateTimeSymbols;
}): FormulaDateTimeLocaleCreates a built-in Excel-compatible date/time locale.
currentExcelDateTimeSerial(context: EvalContext): numberexcelTimeFraction(hour: number, minute: number, second: number): number | nullformatExcelDateTime(serial: number, pattern?: string): stringparseExcelDate(value: unknown, options?: ExcelDateTimeParseOptions): number | nullparseExcelDateTime(value: unknown, options?: ExcelDateTimeParseOptions): ParsedExcelDateTime | nullparseExcelTime(value: unknown, options?: ExcelDateTimeParseOptions): number | nullChinese Excel-style date/time text parser and formatter.
Chinese symbols consumed by the shared Excel-compatible date/time parser.
Legacy alias for the default parser, which now falls back to English symbols.
Creates an Excel date serial from year, month, and day parts.
=DATE(2024,2,29) returns 45351.Returns the elapsed days, months, or years between two dates.
=DATEDIF("1/1/2001","1/1/2003","Y") returns 2.dateTimeFunctions: readonly FormulaFunction[]Converts date text into an Excel date serial.
=DATEVALUE("22-MAY-2011") returns 40685.Returns the day of month for a date serial.
=DAY("2011-4-15") returns 15.Returns the number of days between an end date and a start date.
=DAYS("2021-12-31","2021-1-1") returns 364.Returns the day difference using a 360-day accounting year.
=DAYS360("2011-1-1","2011-12-31") returns 360.Returns the date serial offset by a whole number of months.
=EDATE("2011-1-15",2) returns 40617.English Excel-style date/time text parser and formatter.
English symbols consumed by the shared Excel-compatible date/time parser.
Returns the last day of the month offset from a start date.
=EOMONTH("2011-1-1",1) returns 40602.EPOCHTODATE converts a Unix timestamp to an Excel UTC date-time serial. Example: =EPOCHTODATE(0) returns 25569.
Returns the hour component from a time or date-time value.
=HOUR("2011-7-18 7:45") returns 7.Returns the ISO 8601 week number for a date.
=ISOWEEKNUM("2012-3-9") returns 10.Returns the minute component from a time or date-time value.
=MINUTE("12:45 PM") returns 45.Returns the month number for a date serial.
=MONTH("2011-4-15") returns 4.Counts whole workdays between two dates, excluding weekends and holidays.
=NETWORKDAYS("2012-10-1","2013-3-1",{"2012-11-22";"2012-12-4";"2013-1-21"}) returns 107.NETWORKDAYS.INTL: Counts workdays between dates with custom weekend rules. Example: =NETWORKDAYS.INTL(DATE(2006,1,1),DATE(2006,2,1),"0010001",{"2006/1/2","2006/1/16"}) returns 20.
Returns the current date and time as an Excel serial.
=NOW()-0.5 returns the serial for 12 hours before the injected clock time.Returns the second component from a time or date-time value.
=SECOND("4:48:18 PM") returns 18.Converts hour, minute, and second parts into a fraction of one day.
=TIME(12,0,0) returns 0.5.Converts time text into the fractional part of one day.
=TIMEVALUE("2:24 AM") returns 0.1.TO_DATE converts a number to its Excel date serial by removing its time fraction. Example: =TO_DATE(45351.75) returns 45351.
Returns the current date as an Excel serial without a time fraction.
=TODAY()+5 returns the serial for five days after the injected current date.Returns the day of week using the requested Excel return type.
=WEEKDAY("2008-2-14",2) returns 4.Returns the week number of a date using Excel week-numbering rules.
=WEEKNUM("2012-3-9",2) returns 11.Returns the date serial after moving a number of workdays from a start date.
=WORKDAY("2008-10-1",151,{"11/26/2008";"12/4/2008";"1/21/2009"}) returns 39938.WORKDAY.INTL: Returns a workday-offset date serial with custom weekend rules. Example: =WORKDAY.INTL(DATE(2012,1,1),30,17) returns 40944.
Returns the year for a date serial.
=YEAR("7/5/2025") returns 2025.Returns the fraction of a year represented by two dates.
=YEARFRAC("1/1/2012","7/30/2012",1) returns 0.5765027322404371.Coupon schedule resolved around a bond settlement date.
readonly basis: FinancialDayCountBasisreadonly couponsRemaining: numberreadonly daysFromPrevious: numberreadonly daysInPeriod: numberreadonly daysToNext: numberreadonly frequency: 1 | 2 | 4readonly nextCoupon: numberreadonly previousCoupon: numberreadonly initialGuess?: numberreadonly lowerBound?: numberreadonly maxIterations?: numberreadonly tolerance?: numberreadonly upperBound?: numbertype BondResult = number | FormulaErrortype DayCountResult = number | FormulaErrortype DepreciationResult = number | FormulaErrortype FinancialDayCountBasis = 0 | 1 | 2 | 3 | 4Excel financial day-count conventions.
type FinancialNumberResult = number | FormulaErrortype FinancialRootResult = number | FormulaErrorbondDuration(settlement: number, maturity: number, annualRate: number, annualYield: number, redemption?: number, frequencyValue?: number, basisValue?: number): BondResultComputes Macaulay duration from a clean bond price.
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.
collectFinancialCashFlows(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaErrorCollects a scalar, array, or range argument into finite numeric cash flows.
collectFinancialDateSerials(arg: FormulaArg | undefined, context: EvalContext, acceptFormattedText?: boolean): number[] | FormulaErrorDate arguments use whole serial days and reject boolean values.
collectFinancialScheduleRates(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaErrorMulti-cell schedules reject stored text rates even when the text is numeric.
collectIrrCashFlows(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaErrorcollectNpvCashFlows(arg: FormulaArg | undefined, context: EvalContext): number[] | FormulaErrorNPV ignores nonnumeric cells in references without consuming a period.
couponAmount(faceValue: number, annualRate: number, frequency: 1 | 2 | 4): number | FormulaErrorReturns the coupon amount for a face value and annual coupon rate.
decliningBalanceDepreciation(cost: number, salvage: number, life: number, period: number, factor?: number): DepreciationResultDeclining-balance depreciation for a one-based period.
financialDayCountDays(start: number, end: number, basis: FinancialDayCountBasis): DayCountResultReturns the number of days between two Excel serial dates for a basis.
Returns a standard #DIV/0! result for an undefined periodic payment.
Returns a standard #NUM! result for an invalid basis or date interval.
Returns a standard #VALUE! result for malformed financial inputs.
financialYearFraction(start: number, end: number, basis: FinancialDayCountBasis): DayCountResultReturns the Excel year fraction for a financial basis.
forEachFinancialCashFlow(arg: FormulaArg, context: EvalContext, callback: (value: number, index: number): boolean | void): FormulaError | undefinedStreams numeric values from a range without allocating an intermediate matrix.
futureValue(rate: number, periods: number, payment: number, presentValue: number, type?: number): FinancialNumberResultComputes the future value of a periodic annuity.
isFinancialMonthEnd(serial: number): booleanReturns whether an Excel serial date is the last calendar day of its month.
isTextualFinancialReference(arg: FormulaArg | undefined, context: EvalContext): booleannormalizeCouponFrequency(value: number): 1 | 2 | 4 | FormulaErrorValidates a bond frequency used by Excel financial functions.
normalizeFinancialBasis(value: number | undefined): FormulaError | FinancialDayCountBasisChecks and normalizes the five Excel day-count basis values.
oddLastRegularPeriodDays(lastCoupon: number, frequency: 1 | 2 | 4, basis: FinancialDayCountBasis): number | FormulaErrorReturns the basis-dependent length of a regular period after the final coupon date.
payment(rate: number, periods: number, presentValue: number, future?: number, type?: number): FinancialNumberResultComputes a periodic payment for an annuity.
periodicNpv(rate: number, cashFlows: readonly number[]): FinancialNumberResultComputes periodic NPV. The first value is discounted by one period.
readFinancialNumber(arg: FormulaArg | undefined, context: EvalContext, options?: { acceptLocalizedCurrency?: boolean }): FinancialNumberResultReads a scalar financial input, preserving formula errors.
resolveCouponSchedule(settlement: number, maturity: number, frequencyValue: number, basisValue?: number): FormulaError | CouponScheduleResolves the previous/next coupon dates and basis-dependent day counts.
resolveOddFirstCouponSchedule(settlement: number, maturity: number, firstCoupon: number, frequencyValue: number, basisValue?: number): FormulaError | CouponScheduleResolves an odd first coupon schedule anchored at its first payment date.
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.
straightLineDepreciation(cost: number, salvage: number, life: number): DepreciationResultStraight-line depreciation for one period.
sumOfYearsDepreciation(cost: number, salvage: number, life: number, period: number): DepreciationResultSum-of-years-digits depreciation for a one-based period.
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.
ACCRINT: accrued interest for a periodically paying security.
ACCRINTM: accrued interest for a security paying interest at maturity.
AMORDEGRC: declining-balance depreciation with a French accounting coefficient.
AMORLINC: straight-line depreciation prorated over the first period.
COUPDAYBS: days from the beginning of a coupon period to settlement.
COUPDAYS: number of days in the coupon period containing settlement.
COUPDAYSNC: days from settlement to the next coupon.
COUPNCD: next coupon date after settlement.
COUPNUM: number of coupons remaining after settlement.
COUPPCD: previous coupon date before settlement.
CUMIPMT: cumulative interest paid between two periods.
CUMPRINC: cumulative principal paid between two periods.
DB: fixed-declining balance depreciation.
DDB: double-declining or custom-factor depreciation.
DISC: annualized discount rate for a discounted security.
DOLLARDE: converts a fractional dollar price to a decimal price.
DOLLARFR: converts a decimal dollar price to a fractional price.
DURATION: Macaulay duration of a coupon security.
EFFECT: effective annual interest rate.
financialFunctions: readonly FormulaFunction[]All built-in financial worksheet functions.
FV: future value of an annuity.
FVSCHEDULE: future value using a series of variable rates.
INTRATE: annualized interest rate of a fully invested security.
IPMT: interest payment for a period.
IRR: periodic internal rate of return.
ISPMT: interest paid during a specific period of an investment.
MDURATION: modified duration of a coupon security.
MIRR: modified internal rate of return.
NOMINAL: nominal annual interest rate.
NPER: number of periods for an annuity.
NPV: net present value of periodic cash flows.
ODDFPRICE: clean price for a security with an odd first coupon period.
ODDFYIELD: yield for a security with an odd first coupon period.
ODDLPRICE: clean price for a security with an odd last coupon period.
ODDLYIELD: yield for a security with an odd last coupon period.
PDURATION: periods required for an investment to reach a target value.
PMT: periodic payment for an annuity.
PPMT: principal payment for a period.
PRICE: clean price of a coupon security.
PRICEDISC: price of a discounted security.
PRICEMAT: price of a security paying interest at maturity.
PV: present value of an annuity.
RATE: periodic interest rate for an annuity.
RECEIVED: amount received at maturity for a discounted security.
RRI: equivalent growth rate for an investment.
SLN: straight-line depreciation.
SYD: sum-of-years-digits depreciation.
TBILLEQ: bond-equivalent yield for a Treasury bill.
TBILLPRICE: price per 100 for a Treasury bill.
TBILLYIELD: discount yield for a Treasury bill price.
VDB: variable declining-balance depreciation.
XIRR: internal rate of return for irregular cash-flow dates.
XNPV: net present value for irregular cash-flow dates.
YIELD: yield of a coupon security.
YIELDDISC: yield of a discounted security.
YIELDMAT: yield of a security paying interest at maturity.
ADD returns the sum of two values. Example: =ADD(2,3) returns 5.
AI reads a Gemini result from a host-managed cache. Example: =AI("Summarize",A1) returns cached generated text.
ARRAYFORMULA exposes an expression's array result. Example: =ARRAYFORMULA({1,2}*2) returns {2,4}.
AVERAGE.WEIGHTED is the dotted Google Sheets alias. Example: =AVERAGE.WEIGHTED({10,20},{1,3}) returns 17.5.
COUNTUNIQUE counts distinct values. Example: =COUNTUNIQUE(1,1,2) returns 2.
DIVIDE divides one value by another. Example: =DIVIDE(6,2) returns 3.
EQ tests two values for equality. Example: =EQ(2,2) returns TRUE.
GOOGLEFINANCE reads market data from a host-managed cache. Example: =GOOGLEFINANCE("NASDAQ:GOOG","price") returns cached price data.
googleFunctions: readonly FormulaFunction[]GOOGLETRANSLATE reads a translation from a host-managed cache. Example: =GOOGLETRANSLATE("hello","en","zh-CN") returns cached text.
GT tests whether the first value is greater. Example: =GT(3,2) returns TRUE.
GTE tests whether the first value is at least the second. Example: =GTE(2,2) returns TRUE.
IMPORTDATA reads CSV or TSV data from a host-managed cache. Example: =IMPORTDATA("https://example.com/data.csv") returns cached rows.
IMPORTFEED reads RSS or Atom data from a host-managed cache. Example: =IMPORTFEED("https://example.com/feed.xml") returns cached feed rows.
IMPORTHTML reads an HTML table or list from a host-managed cache. Example: =IMPORTHTML("https://example.com","table",1) returns cached rows.
IMPORTRANGE reads another spreadsheet through a host-managed cache. Example: =IMPORTRANGE("sheet-id","A1:B2") returns cached cells.
IMPORTXML reads XPath-selected data from a host-managed cache. Example: =IMPORTXML("https://example.com","//title") returns cached nodes.
JOIN concatenates values with a delimiter. Example: =JOIN("-",{1,2,3}) returns "1-2-3".
LT tests whether the first value is smaller. Example: =LT(2,3) returns TRUE.
LTE tests whether the first value is no greater than the second. Example: =LTE(2,2) returns TRUE.
MINUS subtracts the second value from the first. Example: =MINUS(5,2) returns 3.
MULTIPLY multiplies two values. Example: =MULTIPLY(3,4) returns 12.
NE tests two values for inequality. Example: =NE(2,3) returns TRUE.
POW raises a base to an exponent. Example: =POW(2,3) returns 8.
QUERY runs a Google Visualization-style query over tabular data. Example: =QUERY({"A",1;"B",2},"select Col1 where Col2 > 1",0) returns "B".
SORTN returns the first ranked rows after sorting. Example: =SORTN({3;1;2},2) returns {1;2}.
SPARKLINE renders numeric data as a compact text sparkline. Example: =SPARKLINE({1,3,2}) returns a three-glyph trend.
SPLIT divides text into a spilling row. Example: =SPLIT("a,b,c",",") returns {"a","b","c"}.
TO_DOLLARS converts a value to a dollar amount. Example: =TO_DOLLARS(12.5) returns 12.5.
TO_PERCENT converts a decimal to its percentage value. Example: =TO_PERCENT(0.25) returns 0.25 for percentage formatting.
TO_PURE_NUMBER strips display formatting and returns a number. Example: =TO_PURE_NUMBER("42") returns 42.
TO_TEXT converts a scalar to text, retaining a referenced cell's number format. Example: =TO_TEXT(42) returns "42".
UMINUS reverses a number's sign. Example: =UMINUS(3) returns -3.
UNARY_PERCENT converts a percentage value to its decimal. Example: =UNARY_PERCENT(25) returns 0.25.
UPLUS returns the numeric value unchanged. Example: =UPLUS("3") returns 3.
Returns information about a referenced cell.
=CELL("row",B3)ERROR.TYPE: Returns the numeric code for an error value.
=ERROR.TYPE(NA())Returns host or workbook environment information.
=INFO("numfile")informationFunctions: readonly FormulaFunction[]ISBETWEEN tests whether a value lies between bounds. Example: =ISBETWEEN(5,1,10) returns TRUE.
Returns TRUE only for a genuinely empty referenced cell.
=ISBLANK(A1)ISDATE reports whether a value is a valid date or date serial. Example: =ISDATE("2024-02-29") returns TRUE.
ISEMAIL checks common email-address syntax without contacting a server. Example: =ISEMAIL("a@example.com") returns TRUE.
Returns TRUE for errors other than #N/A.
=ISERR(1/0)Returns TRUE for any formula error.
=ISERROR(1/0)Returns TRUE when a number is even.
=ISEVEN(4)Returns TRUE when a referenced cell contains a formula.
=ISFORMULA(A1)Returns TRUE for logical values.
=ISLOGICAL(TRUE)Returns TRUE only for #N/A.
=ISNA(NA())Returns TRUE for non-text values.
=ISNONTEXT(42)Returns TRUE for numeric values.
=ISNUMBER(42)Returns TRUE when a number is odd.
=ISODD(3)Returns TRUE when its argument preserves reference identity.
=ISREF(A1)Returns TRUE for text values.
=ISTEXT("text")ISURL checks whether text is an absolute URL. Example: =ISURL("https://example.com") returns TRUE.
Converts numbers, booleans, and other values to a numeric projection.
=N(TRUE)Returns the #N/A error value.
=NA()Returns the one-based index of a sheet.
=SHEET()Returns the number of sheets in the workbook.
=SHEETS()Returns historical market data from a host-managed synchronous cache.
=STOCKHISTORY("MSFT",DATE(2024,1,1))Returns the numeric type code for a formula value.
=TYPE(42)Returns TRUE when every supplied logical value is TRUE.
=AND(TRUE,1)Returns the logical value FALSE.
=FALSE()Returns one value when a condition is true and another when it is false.
Replaces a formula error with a fallback value.
=IFERROR(1/0,0) returns 0.Returns a fallback only when the input is #N/A.
=IFNA(NA(),0)Returns the value paired with the first TRUE condition.
=IFS(A1>90,"A",A1>80,"B",TRUE,"C")Evaluates sequential name/value bindings in a child lexical scope.
=LET(rate,2,amount,5,rate*amount) returns 10.logicalFunctions: readonly FormulaFunction[]Returns the inverse of a logical value.
=NOT(TRUE)Returns TRUE when any supplied logical value is TRUE.
=OR(FALSE,TRUE)Matches one expression and returns its paired result.
=SWITCH(2,1,"one",2,"two","other")Returns the logical value TRUE.
=TRUE()Returns TRUE when an odd number of values are TRUE.
=XOR(TRUE,FALSE)ADDRESS returns an A1 or R1C1 address. Example: =ADDRESS(2,3) returns $C$2.
AREAS counts areas in a reference. Example: =AREAS(A1:B2) returns 1.
ARRAY_CONSTRAIN limits an array to a row and column count. Example: =ARRAY_CONSTRAIN(A1:C3,2,1).
CHOOSE selects a value by index. Example: =CHOOSE(2,"A","B") returns B.
CHOOSECOLS selects columns from an array. Example: =CHOOSECOLS(A1:C2,1,3).
CHOOSEROWS selects rows from an array. Example: =CHOOSEROWS(A1:C3,1,3).
COLUMN returns column numbers for a reference. Example: =COLUMN(C5) returns 3.
COLUMNS returns the number of columns in a reference. Example: =COLUMNS(A1:C2) returns 3.
DROP removes rows and columns. Example: =DROP(A1:C3,1) removes the first row.
EXPAND pads an array. Example: =EXPAND(A1:B2,3,3,0).
FILTER returns rows matching a Boolean include array. Example: =FILTER(A1:B3,{TRUE;FALSE;TRUE}).
FLATTEN combines one or more arrays into a single column. Example: =FLATTEN(A1:B2,C1:C2).
FORMULATEXT returns source text for a formula cell. Example: =FORMULATEXT(A1).
GETPIVOTDATA reads a host pivot data service. Example: =GETPIVOTDATA("Sales",A1).
GROUPBY groups rows by a key and applies the supplied aggregation. Example: =GROUPBY(A2:A5,B2:B5,SUM).
HLOOKUP searches a table's first row. Example: =HLOOKUP("B",A1:C2,2,FALSE).
HSTACK joins arrays horizontally. Example: =HSTACK({1;2},{3;4}).
HYPERLINK returns display text for a host-rendered link. Example: =HYPERLINK("https://example.com","Open").
IMAGE reads a host-managed image cache. Example: =IMAGE("https://example.com/logo.png").
INDEX returns a value or subarray by row and column. Example: =INDEX(A1:C3,2,3).
INDIRECT resolves text to a reference. Example: =INDIRECT("A1") returns A1.
LOOKUP performs approximate vector lookup. Example: =LOOKUP(2,{1,2,3},{"A","B","C"}) returns B.
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.
MATCH returns the position of a lookup value. Example: =MATCH("B",{"A";"B"},0) returns 2.
OFFSET returns a shifted reference. Example: =OFFSET(A1,1,1) returns B2.
PIVOTBY creates a two-key summary with the supplied aggregation. Example: =PIVOTBY(A2:A5,B2:B5,C2:C5,SUM).
ROW returns row numbers for a reference. Example: =ROW(C5) returns 5.
ROWS returns the number of rows in a reference. Example: =ROWS(A1:C2) returns 2.
RTD reads a host-managed real-time data cache. Example: =RTD("provider",,"price","MSFT").
SORT orders rows by one column. Example: =SORT(A1:B3,1,1).
SORTBY orders rows using one or more key arrays. Example: =SORTBY(A1:B3,B1:B3,1).
TAKE keeps rows and columns. Example: =TAKE(A1:C3,2) keeps the first two rows.
TOCOL flattens an array into one column. Example: =TOCOL(A1:B2).
TOROW flattens an array into one row. Example: =TOROW(A1:B2).
TRANSPOSE swaps array rows and columns. Example: =TRANSPOSE(A1:B2).
TRIMRANGE removes fully blank outer rows and columns. Example: =TRIMRANGE(A1:D5).
UNIQUE returns distinct rows. Example: =UNIQUE({1;1;2}) returns 1 and 2.
Searches the first column of a table and returns a value from a selected column.
=VLOOKUP(2,{1,"A";2,"B"},2,FALSE) returns "B".VSTACK joins arrays vertically. Example: =VSTACK({1,2},{3,4}).
WRAPCOLS wraps a vector by columns. Example: =WRAPCOLS({1,2,3},2,0).
WRAPROWS wraps a vector by rows. Example: =WRAPROWS({1,2,3},2,0).
XLOOKUP searches a vector and returns a corresponding value. Example: =XLOOKUP(2,{1,2},{"A","B"}).
XMATCH returns a position with modern MATCH modes. Example: =XMATCH("B",{"A";"B"}).
Returns a random decimal number greater than or equal to 0 and less than 1.
=RAND() returns a value in the range [0,1).Generates an array of random numbers with the requested shape and bounds.
=RANDARRAY(1,4,5,5,TRUE) returns {5,5,5,5}.Returns a random integer between two inclusive bounds.
=RANDBETWEEN(7,7) returns 7.CEILING.MATH: Rounds a number up to the nearest multiple.
=CEILING.MATH(24.3,5) returns 25.CEILING.PRECISE: Rounds a number up to the nearest multiple, using an absolute direction.
=CEILING.PRECISE(-4.3,2) returns -4.Rounds a number away from zero to the nearest even integer.
=EVEN(1.5) returns 2.Returns the factorial of a nonnegative integer.
=FACT(5) returns 120.Returns the double factorial for nonnegative values.
=FACTDOUBLE(7) returns 105.FLOOR.MATH: Rounds a number down to the nearest multiple.
=FLOOR.MATH(-8.1,2) returns -10.FLOOR.PRECISE: Rounds a number down to the nearest multiple using an absolute direction.
=FLOOR.PRECISE(-3.2,1) returns -4.ISO.CEILING: Rounds a number up to the nearest multiple.
=ISO.CEILING(-4.3,2) returns -4.Rounds a number to the nearest specified multiple.
=MROUND(10,3) returns 9.Rounds a number away from zero to the nearest odd integer.
=ODD(0) returns 1.Rounds a number to a specified number of digits.
=ROUND(-1.475,2) returns -1.48.Rounds a number toward zero to a specified number of digits.
=ROUNDDOWN(-3.9,0) returns -3.Rounds a number away from zero to a specified number of digits.
=ROUNDUP(-3.1,0) returns -4.AVEDEV formula. Evaluates the Excel-compatible AVEDEV statistical function. Example: =AVEDEV(1,2,3).
AVERAGE_WEIGHTED formula. Computes a weighted arithmetic mean. Example: =AVERAGE_WEIGHTED({10,20},{1,3}) returns 17.5.
AVERAGEA formula. Evaluates the Excel-compatible AVERAGEA statistical function. Example: =AVERAGEA(1,2,3).
AVERAGEIF formula. Evaluates the Excel-compatible AVERAGEIF statistical function. Example: =AVERAGEIF(1,2,3).
AVERAGEIFS formula. Evaluates the Excel-compatible AVERAGEIFS statistical function. Example: =AVERAGEIFS(1,2,3).
BETA.DIST formula. Evaluates the Excel-compatible BETA.DIST statistical function. Example: =BETA.DIST(1,1,TRUE).
BETA.INV formula. Evaluates the Excel-compatible BETA.INV statistical function. Example: =BETA.INV(0.5,1,1).
BINOM.DIST formula. Evaluates the Excel-compatible BINOM.DIST statistical function. Example: =BINOM.DIST(1,1,TRUE).
BINOM.DIST.RANGE formula. Evaluates the Excel-compatible BINOM.DIST.RANGE statistical function. Example: =BINOM.DIST.RANGE(1,1,TRUE).
BINOM.INV formula. Evaluates the Excel-compatible BINOM.INV statistical function. Example: =BINOM.INV(0.5,1,1).
CHISQ.DIST formula. Evaluates the Excel-compatible CHISQ.DIST statistical function. Example: =CHISQ.DIST(1,1,TRUE).
CHISQ.DIST.RT formula. Evaluates the Excel-compatible CHISQ.DIST.RT statistical function. Example: =CHISQ.DIST.RT(1,1,TRUE).
CHISQ.INV formula. Evaluates the Excel-compatible CHISQ.INV statistical function. Example: =CHISQ.INV(0.5,1,1).
CHISQ.INV.RT formula. Evaluates the Excel-compatible CHISQ.INV.RT statistical function. Example: =CHISQ.INV.RT(0.5,1,1).
CHISQ.TEST formula. Evaluates the Excel-compatible CHISQ.TEST statistical function. Example: =CHISQ.TEST(1,2,3).
CONFIDENCE.NORM formula. Evaluates the Excel-compatible CONFIDENCE.NORM statistical function. Example: =CONFIDENCE.NORM(1,2,3).
CONFIDENCE.T formula. Evaluates the Excel-compatible CONFIDENCE.T statistical function. Example: =CONFIDENCE.T(1,2,3).
CORREL formula. Evaluates the Excel-compatible CORREL statistical function. Example: =CORREL(1,2,3).
COUNTA formula. Evaluates the Excel-compatible COUNTA statistical function. Example: =COUNTA(1,2,3).
COUNTBLANK formula. Evaluates the Excel-compatible COUNTBLANK statistical function. Example: =COUNTBLANK(1,2,3).
COUNTIF formula. Evaluates the Excel-compatible COUNTIF statistical function. Example: =COUNTIF(1,2,3).
COUNTIFS formula. Evaluates the Excel-compatible COUNTIFS statistical function. Example: =COUNTIFS(1,2,3).
COVARIANCE.P formula. Evaluates the Excel-compatible COVARIANCE.P statistical function. Example: =COVARIANCE.P({1,2,3},{2,3,4}).
COVARIANCE.S formula. Evaluates the Excel-compatible COVARIANCE.S statistical function. Example: =COVARIANCE.S({1,2,3},{2,3,4}).
DEVSQ formula. Evaluates the Excel-compatible DEVSQ statistical function. Example: =DEVSQ(1,2,3).
EXPON.DIST formula. Evaluates the Excel-compatible EXPON.DIST statistical function. Example: =EXPON.DIST(1,1,TRUE).
F.DIST formula. Evaluates the Excel-compatible F.DIST statistical function. Example: =F.DIST(1,1,TRUE).
F.DIST.RT formula. Evaluates the Excel-compatible F.DIST.RT statistical function. Example: =F.DIST.RT(1,1,TRUE).
F.INV formula. Evaluates the Excel-compatible F.INV statistical function. Example: =F.INV(0.5,1,1).
F.INV.RT formula. Evaluates the Excel-compatible F.INV.RT statistical function. Example: =F.INV.RT(0.5,1,1).
F.TEST formula. Evaluates the Excel-compatible F.TEST statistical function. Example: =F.TEST(1,2,3).
FISHER formula. Evaluates the Excel-compatible FISHER statistical function. Example: =FISHER(1,2,3).
FISHERINV formula. Evaluates the Excel-compatible FISHERINV statistical function. Example: =FISHERINV(0.5,1,1).
FORECAST formula. Evaluates the Excel-compatible FORECAST statistical function. Example: =FORECAST(1,2,3).
FORECAST.ETS formula. Evaluates the Excel-compatible FORECAST.ETS statistical function. Example: =FORECAST.ETS(1,2,3).
FORECAST.ETS.CONFINT formula. Evaluates the Excel-compatible FORECAST.ETS.CONFINT statistical function. Example: =FORECAST.ETS.CONFINT(1,2,3).
FORECAST.ETS.SEASONALITY formula. Evaluates the Excel-compatible FORECAST.ETS.SEASONALITY statistical function. Example: =FORECAST.ETS.SEASONALITY(1,2,3).
FORECAST.ETS.STAT formula. Evaluates the Excel-compatible FORECAST.ETS.STAT statistical function. Example: =FORECAST.ETS.STAT(1,2,3).
FORECAST.LINEAR formula. Evaluates the Excel-compatible FORECAST.LINEAR statistical function. Example: =FORECAST.LINEAR(1,2,3).
FREQUENCY formula. Evaluates the Excel-compatible FREQUENCY statistical function. Example: =FREQUENCY(1,2,3).
GAMMA formula. Evaluates the Excel-compatible GAMMA statistical function. Example: =GAMMA(1,2,3).
GAMMA.DIST formula. Evaluates the Excel-compatible GAMMA.DIST statistical function. Example: =GAMMA.DIST(1,1,TRUE).
GAMMA.INV formula. Evaluates the Excel-compatible GAMMA.INV statistical function. Example: =GAMMA.INV(0.5,1,1).
GAMMALN formula. Evaluates the Excel-compatible GAMMALN statistical function. Example: =GAMMALN(1,2,3).
GAMMALN.PRECISE formula. Evaluates the Excel-compatible GAMMALN.PRECISE statistical function. Example: =GAMMALN.PRECISE(1,2,3).
GAUSS formula. Evaluates the Excel-compatible GAUSS statistical function. Example: =GAUSS(1,2,3).
GEOMEAN formula. Evaluates the Excel-compatible GEOMEAN statistical function. Example: =GEOMEAN(1,2,3).
GROWTH formula. Evaluates the Excel-compatible GROWTH statistical function. Example: =GROWTH(1,2,3).
HARMEAN formula. Evaluates the Excel-compatible HARMEAN statistical function. Example: =HARMEAN(1,2,3).
HYPGEOM.DIST formula. Evaluates the Excel-compatible HYPGEOM.DIST statistical function. Example: =HYPGEOM.DIST(1,1,TRUE).
INTERCEPT formula. Evaluates the Excel-compatible INTERCEPT statistical function. Example: =INTERCEPT(1,2,3).
KURT formula. Evaluates the Excel-compatible KURT statistical function. Example: =KURT(1,2,3).
LARGE formula. Evaluates the Excel-compatible LARGE statistical function. Example: =LARGE(1,2,3).
LINEST formula. Evaluates the Excel-compatible LINEST statistical function. Example: =LINEST(1,2,3).
LOGEST formula. Evaluates the Excel-compatible LOGEST statistical function. Example: =LOGEST(1,2,3).
LOGNORM.DIST formula. Evaluates the Excel-compatible LOGNORM.DIST statistical function. Example: =LOGNORM.DIST(1,1,TRUE).
LOGNORM.INV formula. Evaluates the Excel-compatible LOGNORM.INV statistical function. Example: =LOGNORM.INV(0.5,1,1).
MARGINOFERROR formula. Estimates the normal confidence margin for a sample. Example: =MARGINOFERROR(0.95,A1:A10).
MAX formula. Evaluates the Excel-compatible MAX statistical function. Example: =MAX(1,2,3).
MAXA formula. Evaluates the Excel-compatible MAXA statistical function. Example: =MAXA(1,2,3).
MAXIFS formula. Evaluates the Excel-compatible MAXIFS statistical function. Example: =MAXIFS(1,2,3).
MEDIAN formula. Evaluates the Excel-compatible MEDIAN statistical function. Example: =MEDIAN(1,2,3).
MIN formula. Evaluates the Excel-compatible MIN statistical function. Example: =MIN(1,2,3).
MINA formula. Evaluates the Excel-compatible MINA statistical function. Example: =MINA(1,2,3).
MINIFS formula. Evaluates the Excel-compatible MINIFS statistical function. Example: =MINIFS(1,2,3).
MODE.MULT formula. Evaluates the Excel-compatible MODE.MULT statistical function. Example: =MODE.MULT(1,2,3).
MODE.SNGL formula. Evaluates the Excel-compatible MODE.SNGL statistical function. Example: =MODE.SNGL(1,2,3).
NEGBINOM.DIST formula. Evaluates the Excel-compatible NEGBINOM.DIST statistical function. Example: =NEGBINOM.DIST(1,1,TRUE).
NORM.DIST formula. Evaluates the Excel-compatible NORM.DIST statistical function. Example: =NORM.DIST(1,1,TRUE).
NORM.S.DIST formula. Evaluates the Excel-compatible NORM.S.DIST statistical function. Example: =NORM.S.DIST(1,1,TRUE).
NORM.S.INV formula. Evaluates the Excel-compatible NORM.S.INV statistical function. Example: =NORM.S.INV(0.5,1,1).
NORMINV formula. Evaluates the Excel-compatible NORMINV statistical function. Example: =NORMINV(0.5,1,1).
PEARSON formula. Evaluates the Excel-compatible PEARSON statistical function. Example: =PEARSON(1,2,3).
PERCENTILE.EXC formula. Evaluates the Excel-compatible PERCENTILE.EXC statistical function. Example: =PERCENTILE.EXC(1,2,3).
PERCENTILE.INC formula. Evaluates the Excel-compatible PERCENTILE.INC statistical function. Example: =PERCENTILE.INC(1,2,3).
PERCENTRANK.EXC formula. Evaluates the Excel-compatible PERCENTRANK.EXC statistical function. Example: =PERCENTRANK.EXC(1,2,3).
PERCENTRANK.INC formula. Evaluates the Excel-compatible PERCENTRANK.INC statistical function. Example: =PERCENTRANK.INC(1,2,3).
PERMUT formula. Evaluates the Excel-compatible PERMUT statistical function. Example: =PERMUT(1,2,3).
PERMUTATIONA formula. Evaluates the Excel-compatible PERMUTATIONA statistical function. Example: =PERMUTATIONA(1,2,3).
PHI formula. Evaluates the Excel-compatible PHI statistical function. Example: =PHI(1,2,3).
POISSON.DIST formula. Evaluates the Excel-compatible POISSON.DIST statistical function. Example: =POISSON.DIST(1,1,TRUE).
PROB formula. Evaluates the Excel-compatible PROB statistical function. Example: =PROB(1,2,3).
QUARTILE.EXC formula. Evaluates the Excel-compatible QUARTILE.EXC statistical function. Example: =QUARTILE.EXC(1,2,3).
QUARTILE.INC formula. Evaluates the Excel-compatible QUARTILE.INC statistical function. Example: =QUARTILE.INC(1,2,3).
RANK.AVG formula. Evaluates the Excel-compatible RANK.AVG statistical function. Example: =RANK.AVG(1,2,3).
RANK.EQ formula. Evaluates the Excel-compatible RANK.EQ statistical function. Example: =RANK.EQ(1,2,3).
RSQ formula. Evaluates the Excel-compatible RSQ statistical function. Example: =RSQ(1,2,3).
SKEW formula. Evaluates the Excel-compatible SKEW statistical function. Example: =SKEW(1,2,3).
SKEW.P formula. Evaluates the Excel-compatible SKEW.P statistical function. Example: =SKEW.P(1,2,3).
SLOPE formula. Evaluates the Excel-compatible SLOPE statistical function. Example: =SLOPE(1,2,3).
SMALL formula. Evaluates the Excel-compatible SMALL statistical function. Example: =SMALL(1,2,3).
STANDARDIZE formula. Evaluates the Excel-compatible STANDARDIZE statistical function. Example: =STANDARDIZE(1,2,3).
STDEV.P formula. Evaluates the Excel-compatible STDEV.P statistical function. Example: =STDEV.P(1,2,3).
STDEV.S formula. Evaluates the Excel-compatible STDEV.S statistical function. Example: =STDEV.S(1,2,3).
STDEVA formula. Evaluates the Excel-compatible STDEVA statistical function. Example: =STDEVA(1,2,3).
STDEVPA formula. Evaluates the Excel-compatible STDEVPA statistical function. Example: =STDEVPA(1,2,3).
STEYX formula. Evaluates the Excel-compatible STEYX statistical function. Example: =STEYX(1,2,3).
T.DIST formula. Evaluates the Excel-compatible T.DIST statistical function. Example: =T.DIST(1,1,TRUE).
T.DIST.2T formula. Evaluates the Excel-compatible T.DIST.2T statistical function. Example: =T.DIST.2T(1,1,TRUE).
T.DIST.RT formula. Evaluates the Excel-compatible T.DIST.RT statistical function. Example: =T.DIST.RT(1,1,TRUE).
T.INV formula. Evaluates the Excel-compatible T.INV statistical function. Example: =T.INV(0.5,1,1).
T.INV.2T formula. Evaluates the Excel-compatible T.INV.2T statistical function. Example: =T.INV.2T(0.5,1,1).
T.TEST formula. Evaluates the Excel-compatible T.TEST statistical function. Example: =T.TEST(1,2,3).
TREND formula. Evaluates the Excel-compatible TREND statistical function. Example: =TREND(1,2,3).
TRIMMEAN formula. Evaluates the Excel-compatible TRIMMEAN statistical function. Example: =TRIMMEAN(1,2,3).
VAR formula. Estimates sample variance for compatibility with legacy Excel workbooks. Example: =VAR(1,2,3).
VAR.P formula. Evaluates the Excel-compatible VAR.P statistical function. Example: =VAR.P(1,2,3).
VAR.S formula. Evaluates the Excel-compatible VAR.S statistical function. Example: =VAR.S(1,2,3).
VARA formula. Evaluates the Excel-compatible VARA statistical function. Example: =VARA(1,2,3).
VARPA formula. Evaluates the Excel-compatible VARPA statistical function. Example: =VARPA(1,2,3).
WEIBULL.DIST formula. Evaluates the Excel-compatible WEIBULL.DIST statistical function. Example: =WEIBULL.DIST(1,1,TRUE).
Z.TEST formula. Evaluates the Excel-compatible Z.TEST statistical function. Example: =Z.TEST(1,2,3).
createFormulaTextLocale(input: {
readonly calculationModeLabel?: (mode: "Automatic" | "Manual"): string;
readonly characterCode?: (text: string): number;
readonly characterFromCode?: (code: number): string | undefined;
readonly charWidth: CharWidth;
readonly compareText?: (left: string, right: string): number;
readonly locale: string;
readonly toFullWidth?: (text: string): string;
readonly toHalfWidth?: (text: string): string;
readonly toJis?: (text: string): string;
}): FormulaTextLocaleCreates a byte-oriented text locale from a character-width strategy.
formatBahtText(value: number): string | undefinedConverts a finite number to Excel-style Thai baht and satang text.
Converts an array to concise or strict text. Example: ARRAYTOTEXT({1,"A"},1) returns "{1,"A"}".
Converts full-width DBCS characters to half-width characters. Example: ASC("ABC") returns "ABC".
Spells a number as Thai baht and satang. Example: BAHTTEXT(1234) returns Thai amount text.
Returns the character for a code-page number. Example: CHAR(65) returns "A".
Excel-compatible CJK text locale where wide CJK code points count as two bytes.
Removes ASCII control characters 0 through 31. Example: CLEAN(CHAR(9)&"A") returns "A".
Returns the code of the first character. Example: CODE("A") returns 65.
Joins text and ranges without a delimiter. Example: CONCAT("A",1) returns "A1".
Legacy text concatenation. Example: CONCATENATE("Hello"," World") returns "Hello World".
Converts half-width characters to full-width DBCS characters. Example: DBCS("ABC") returns "ABC".
Reads language detection from the host cache. Example: DETECTLANGUAGE("hello") commonly returns "en".
Formats a number as currency text. Example: DOLLAR(1234.5,2) returns "$1,234.50".
Compares two strings with case sensitivity. Example: EXACT("A","a") returns FALSE.
Finds case-sensitive text and returns a one-based position. Example: FIND("b","abc") returns 2.
Finds case-sensitive text using locale-defined DBCS byte positions. Example: FINDB("b", "abc") returns 2.
Formats rounded fixed-decimal text. Example: FIXED(1234.567,1) returns "1,234.6".
Converts half-width text to Japanese full-width text. Example: JIS("ABC カ") returns "ABC カ".
Returns characters from the start of text. Example: LEFT("Sale",2) returns "Sa".
Returns leading text limited by a locale-defined DBCS byte count. Example: LEFTB("abc", 2) returns "ab".
Returns the UTF-16 character count used by Excel compatibility mode. Example: LEN("Excel") returns 5.
Returns text length measured in locale-defined DBCS bytes. Example: LENB("abc") returns 3.
Converts letters to lowercase. Example: LOWER("Excel") returns "excel".
Returns a substring by one-based start and length. Example: MID("Fluid Flow",7,4) returns "Flow".
Returns text from a locale-defined DBCS byte position. Example: MIDB("abc", 2, 1) returns "b".
Converts a nonnegative number to one of the supported Chinese numeral styles.
Parses numeric text with explicit separators. Example: NUMBERVALUE("2.500,27",",",".") returns 2500.27.
Returns stored phonetic metadata for a cell. Example: PHONETIC(A1) returns its furigana when available.
Capitalizes each word and lowercases remaining letters. Example: PROPER("this is A TITLE") returns "This Is A Title".
Extracts regex matches or capture groups. Example: REGEXEXTRACT("A12","[0-9]+") returns "12".
REGEXMATCH tests whether text matches a regular expression. Example: =REGEXMATCH("A12","[0-9]+") returns TRUE.
Replaces all or one regex match. Example: REGEXREPLACE("A12","[0-9]+","#") returns "A#".
Tests whether text matches a regular expression. Example: REGEXTEST("A12","[0-9]+") returns TRUE.
Replaces characters at a one-based position. Example: REPLACE("abc",2,1,"X") returns "aXc".
Replaces text at a locale-defined DBCS byte position. Example: REPLACEB("abc", 2, 1, "x") returns "axc".
Repeats text a specified number of times. Example: REPT("-",3) returns "---".
Returns characters from the end of text. Example: RIGHT("Sale",2) returns "le".
Returns trailing text limited by a locale-defined DBCS byte count. Example: RIGHTB("abc", 2) returns "bc".
Finds text case-insensitively with Excel wildcards. Example: SEARCH("b*","abc") returns 2.
Finds case-insensitive text using locale-defined DBCS byte positions. Example: SEARCHB("B", "abc") returns 2.
Excel-compatible text locale where every Unicode code point counts as one byte.
Replaces matching text, optionally only one occurrence. Example: SUBSTITUTE("a-b","-","/") returns "a/b".
Returns text values and an empty string for non-text values. Example: T("Excel") returns "Excel".
Formats a value with an Excel format code. Example: TEXT(1234.5,"#,##0.00") returns "1,234.50".
Returns text after a delimiter occurrence. Example: TEXTAFTER("red-blue","-") returns "blue".
Returns text before a delimiter occurrence. Example: TEXTBEFORE("red-blue","-") returns "red".
textFunctions: readonly FormulaFunction[]Joins values with a delimiter and optional empty-value filtering. Example: TEXTJOIN(",",TRUE,"A","B") returns "A,B".
Splits text into a spill matrix. Example: TEXTSPLIT("A,B",",") returns {"A","B"}.
Reads a previously loaded translation from the host cache. Example: TRANSLATE("hello", "en", "es") reads the cached result.
Removes outer ASCII spaces and collapses internal runs. Example: TRIM(" a b ") returns "a b".
Returns the Unicode character for a code point. Example: UNICHAR(9733) returns "★".
Returns the Unicode code point of the first character. Example: UNICODE("★") returns 9733.
Converts letters to uppercase. Example: UPPER("Excel") returns "EXCEL".
Converts common numeric text to a number. Example: VALUE("$1,234.50") returns 1234.5.
Converts one value to concise or strict text. Example: VALUETOTEXT("A",1) returns ""A"".
Returns the arccosine of a number in radians.
=ACOS(1) returns 0.Returns the inverse hyperbolic cosine of a number.
=ACOSH(2) returns approximately 1.316957897.Returns the arccotangent of a number in radians.
=ACOT(1) returns pi/4.Returns the inverse hyperbolic cotangent of a number.
=ACOTH(2) returns approximately 0.549306144.Returns the arcsine of a number in radians.
=ASIN(0) returns 0.Returns the inverse hyperbolic sine of a number.
=ASINH(0) returns 0.Returns the arctangent of a number in radians.
=ATAN(0) returns 0.Returns the angle from an X and Y coordinate pair in radians.
=ATAN2(1,0) returns 0.Returns the inverse hyperbolic tangent of a number.
=ATANH(0) returns 0.Returns the cosine of an angle in radians.
=COS(0) returns 1.Returns the hyperbolic cosine of a number.
=COSH(0) returns 1.Returns the cotangent of an angle in radians.
=COT(RADIANS(45)) returns 1.Returns the hyperbolic cotangent of a number.
=COTH(1) returns approximately 1.313035285.Returns the cosecant of an angle in radians.
=CSC(PI()/2) returns 1.Returns the hyperbolic cosecant of a number.
=CSCH(1) returns approximately 0.850918128.Converts an angle from radians to degrees.
=DEGREES(PI()) returns 180.Converts an angle from degrees to radians.
=RADIANS(180) returns pi.Returns the secant of an angle in radians.
=SEC(0) returns 1.Returns the hyperbolic secant of a number.
=SECH(0) returns 1.Returns the sine of an angle in radians.
=SIN(0) returns 0.Returns the hyperbolic sine of a number.
=SINH(0) returns 0.Returns the tangent of an angle in radians.
=TAN(0) returns 0.Returns the hyperbolic tangent of a number.
=TANH(0) returns 0.Encodes text as an RFC 3986 UTF-8 URL component. Example: ENCODEURL("a b") returns "a%20b".
Extracts XPath matches from XML as a spilling column. Example: FILTERXML("<r><v>A</v></r>","//v") returns A.
webFunctions: readonly FormulaFunction[]Reads response text from a host-loaded HTTP cache. Example: WEBSERVICE("https://example.com/data.xml") returns cached XML.
Host-neutral formula values, evaluation contracts, registries, references, and external-service boundaries.
This package defines the values and service interfaces consumed by formula features. IFormulaParser describes
parsing, IFormulaEvaluator describes evaluation, IDependencyGraph describes recalculation dependencies, and
IFunctionRegistry describes function lookup. The TypeScript implementations live in
@searsuite/sear-domain-formula-engine-ts and are selected through dependency injection.
Use these interfaces when building a plugin or host that must work with a different formula implementation. Use the TypeScript package when you need its concrete parser, evaluator, or built-in functions.
interface IFormulaParser
IFormulaParser: unknownHost-neutral contract for turning formula text into a reusable syntax tree.
Parsing identifies operators and references but does not calculate cell values. The same tree can be inspected for dependencies or rewritten after rows and columns move. Formula evaluation is a separate contract.
symbol: typeof symbolextractDependencies(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.
// =SUM(A1:C100) + D5
extractDependencies(ast) → [
{ kind: FormulaNodeKind.Range, start: [0,0], end: [99,2] },
{ kind: FormulaNodeKind.Cell, row: 4, col: 3 }
]parse(formula: string): 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.
formulaFormula string including the leading '='.
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:
A formula =B3 in A2, after inserting one row below row 1, becomes =B4.
A formula =SUM(A1:A3) in A4, after deleting row 2, becomes =SUM(A1:#REF!).Type contract carried by the canonical FormulaNodeKind value.
| Member | Value |
|---|---|
Number |
"number" |
String |
"string" |
Boolean |
"boolean" |
Error |
"error" |
Name |
"name" |
Tuple |
"tuple" |
Intersection |
"intersection" |
Cell |
"cell" |
Range |
"range" |
WorkbookCell |
"workbookCell" |
Spill |
"spill" |
WorkbookRange |
"workbookRange" |
ColumnRange |
"columnRange" |
RowRange |
"rowRange" |
Array |
"array" |
Missing |
"missing" |
Call |
"call" |
Invoke |
"invoke" |
Binary |
"binary" |
Unary |
"unary" |
type BinaryOp = "+" | "-" | "*" | "/" | "^" | "&" | "=" | "<>" | "<" | ">" | "<=" | ">="Supported binary formula operators.
type FormulaAST = {
kind: typeof FormulaNodeKind.Number;
rawLiteral?: string;
value: number;
} | {
kind: typeof FormulaNodeKind.String;
value: string;
} | {
kind: typeof FormulaNodeKind.Boolean;
value: boolean;
} | {
code: FormulaErrorCode;
kind: typeof FormulaNodeKind.Error;
} | {
kind: typeof FormulaNodeKind.Name;
name: string;
} | {
items: FormulaAST[];
kind: typeof FormulaNodeKind.Tuple;
} | {
kind: typeof FormulaNodeKind.Intersection;
left: FormulaAST;
right: FormulaAST;
} | {
kind: typeof FormulaNodeKind.Array;
rows: FormulaAST[][];
} | { kind: typeof FormulaNodeKind.Missing } | {
absCol: boolean;
absRow: boolean;
col: number;
kind: typeof FormulaNodeKind.Cell;
row: number;
} | {
kind: typeof FormulaNodeKind.Spill;
reference: Extract<FormulaAST, { kind: typeof FormulaNodeKind.Cell | typeof FormulaNodeKind.WorkbookCell }>;
} | {
absEndCol: boolean;
absEndRow: boolean;
absStartCol: boolean;
absStartRow: boolean;
end: [number, number];
kind: typeof FormulaNodeKind.Range;
start: [number, number];
} | {
absCol: boolean;
absRow: boolean;
col: number;
kind: typeof FormulaNodeKind.WorkbookCell;
row: number;
sheetName: string;
} | {
absEndCol: boolean;
absEndRow: boolean;
absStartCol: boolean;
absStartRow: boolean;
end: [number, number];
kind: typeof FormulaNodeKind.WorkbookRange;
sheetName: string;
start: [number, number];
} | {
absEndCol: boolean;
absStartCol: boolean;
endCol: number;
kind: typeof FormulaNodeKind.ColumnRange;
startCol: number;
} | {
absEndRow: boolean;
absStartRow: boolean;
endRow: number;
kind: typeof FormulaNodeKind.RowRange;
startRow: number;
} | {
args: FormulaAST[];
kind: typeof FormulaNodeKind.Call;
name: string;
} | {
args: FormulaAST[];
callee: FormulaAST;
kind: typeof FormulaNodeKind.Invoke;
} | {
kind: typeof FormulaNodeKind.Binary;
left: FormulaAST;
op: BinaryOp;
right: FormulaAST;
} | {
kind: typeof FormulaNodeKind.Unary;
op: UnaryOp;
operand: FormulaAST;
}Serializable formula abstract syntax tree.
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.
interface IFormulaWorkbookMetadataProvider
IFormulaWorkbookMetadataProvider: unknownSupplies workbook facts to a mounted Sheet formula evaluator.
symbol: typeof symbolreadWorkbook(): FormulaWorkbookMetadata | undefinedPosition of the formula currently being evaluated.
Platform-neutral identity of one cell visible to formula evaluation.
One range cell with optional visibility and source metadata.
readonly col: numberreadonly filtered?: booleanreadonly formulaName?: stringreadonly row: numberreadonly source?: "value" | "empty" | "formula"readonly value: FormulaValueA function argument that intentionally retains reference identity.
readonly kind: "reference"readonly reference: ResolvedFormulaRangeOptions used when resolving text, names, or dynamic references.
readonly currentCell?: FormulaCellPositionreadonly style?: FormulaReferenceStyleHost-owned resolver for names and text references.
resolve(referenceText: string, options?: FormulaReferenceResolutionOptions): FormulaError | ResolvedFormulaRangeReference identity returned by reference-preserving functions.
readonly kind: "reference"readonly reference: ResolvedFormulaRangeStable workbook sheet identity and one-based display position.
Read-only workbook facts consumed by information formulas.
readonly currentSheetId?: stringreadonly currentSheetName?: stringreadonly sheets: readonly FormulaSheetMetadata[]Concrete finite range resolved against sheet bounds.
Type contract carried by the canonical FormulaRangeSourceKind value.
| Member | Value |
|---|---|
CurrentSheet |
"currentSheet" |
WorkbookSheet |
"workbookSheet" |
type FormulaRangeSource = { kind: typeof FormulaRangeSourceKind.CurrentSheet } | {
kind: typeof FormulaRangeSourceKind.WorkbookSheet;
sheetName: string;
}Source owner for a resolved formula range.
type FormulaReferenceStyle = "A1" | "R1C1"Reference notation accepted by a reference resolver.
mapFormulaReferenceNodes(ast: FormulaAST, map: (node: FormulaReferenceNode): FormulaAST): FormulaASTTraverses expression containers while preserving unchanged node identities.
interface IDependencyGraph
IDependencyGraph: unknownreadonly pendingCount: numberNumber of dirty formulas still waiting for evaluation.
readonly size: numberTotal number of formula cells currently in the graph.
symbol: typeof symbolclear(): voidClears all graph data.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds mutations to the owning editor command dispatch after initialization.
getDependencies(formulaKey: number): readonly Dependency[]Gets the range-level dependencies owned by one formula cell.
Returned dependencies are defensive copies and must not expose mutable graph internals. Non-formula cells return an empty array.
ReturnsRange-level Dependency list used by the formula.
formulaKeyCellKey for the formula cell.
getDependents(key: number): number[]Gets every formula that depends on one cell.
Uses three reverse-lookup indexes:
ReturnsCellKeys for all formulas that depend on that cell.
keyCellKey for the referenced cell.
getFormulaKeys(): readonly number[]Gets formula cells currently registered in the graph.
The returned array is a stable snapshot for diagnostics and host status views. Mutating it must not affect graph internals.
ReturnsCellKeys for every formula cell with registered dependencies.
getLastCycleKeys(): number[]Cycle nodes detected by the last markDirty call.
Formulas in a cycle should display the #REF! error. markDirty detects cycles by topological elimination: repeatedly remove ready nodes; the remaining nodes are part of cycles.
getNextReadyBatch(viewport: Set<number>, maxCount: number): number[]Gets currently dirty formulas that can be evaluated immediately.
"Ready" means all dependencies for the formula are clean and there are no dirty dependencies. Viewport formulas are returned first so visible results update before off-screen ones.
ReturnsCellKeys for formulas that can be evaluated immediately.
viewportCellKeys currently inside the viewport.
maxCountMaximum number of formulas to return.
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.
keyCellKey for the formula to inspect.
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.
keyCellKey for the formula that has finished evaluating.
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().
changedKeysCellKeys for cells whose values changed.
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.
changesStructural change list.
removeCell(formulaKey: number): voidRemoves one formula cell.
Clears the formula's:
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.
formulaKeyCellKey for the formula cell.
depsRange-level Dependency list used by the formula.
Inclusive source bounds and displacement for reference-preserving cell movement.
readonly columnOffset: numberreadonly end: readonly [number, number]readonly includeUnqualified?: booleanFalse when inspecting qualified references from a different sheet.
readonly rowOffset: numberreadonly sheetName?: stringWhen supplied, qualified references to this sheet also follow the move.
readonly start: readonly [number, number]Selects the reference namespace rewritten by a structure permutation.
readonly includeUnqualified?: booleanreadonly sheetName?: stringResult of shifting one coordinate through structure changes.
Formula-aware row or column move.
Type contract carried by StructureChangeAxis.
| Member | Value |
|---|---|
Col |
"col" |
Row |
"row" |
Type contract carried by StructureChangeKind.
| Member | Value |
|---|---|
Delete |
"delete" |
Insert |
"insert" |
Move |
"move" |
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.
type FormulaDynamicDependencyRegistrar = (reference: ResolvedFormulaRange): voidCallback used to publish dynamic formula dependency edges.
type StructureChange = StructureInsertDeleteChange | StructureMoveChangetype StructureChangeType = MatrixOTActionName.RowInsert | MatrixOTActionName.RowDelete | MatrixOTActionName.RowMove | MatrixOTActionName.ColInsert | MatrixOTActionName.ColDelete | MatrixOTActionName.ColMoveMatrix structure action understood by formula reference transforms.
assertSupportedStructureChange(change: StructureChange): voidValidates indices on a formula structure change before rebasing.
getStructureChangeAxis(change: StructureChange): StructureChangeAxis | undefinedReturns the axis affected by one structure change.
getStructureChangeKind(change: StructureChange): StructureChangeKind | undefinedReturns whether one structure change inserts, deletes, or moves coordinates.
matrixOperationsToStructureChanges(operations: readonly OTOperation[]): StructureChange[]Converts Matrix OT operations into formula structure changes.
matrixOperationToStructureChange(operation: OTOperation): StructureChange | nullConverts one Matrix OT structure operation into a formula structure change.
moveFormulaReferences(ast: FormulaAST, move: FormulaRangeMove): FormulaASTMoves referenced identities, including absolute references, without rebasing unrelated references.
reorderFormulaReferences(ast: FormulaAST, changes: readonly StructureMoveChange[], options?: FormulaStructureMoveOptions): FormulaASTReorders reference identities (including absolute references) through the entire permutation.
shiftStructureCoordinate(input: {
readonly absolute?: boolean;
readonly axis: StructureChangeAxis;
readonly changes: readonly StructureChange[];
readonly coordinate: number;
}): ShiftedStructureCoordinateShifts one coordinate through formula structure changes.
FormulaStructureChangeActionNames: readonly StructureChangeType[]Matrix OT action names that participate in formula reference rebasing.
Public coercion and argument-reading SDK for built-in and third-party formula functions.
FormulaFunctionArguments(args: readonly FormulaArg[], context: EvalContext): FormulaFunctionArgumentsboolean(index: number, fallback?: boolean): boolean | FormulaErrorReads a boolean argument from booleans, numbers, or TRUE/FALSE text.
integer(index: number, fallback?: number): number | FormulaErrorReads a truncated integer argument.
isMissing(index: number): booleanReturns whether an argument was omitted.
number(index: number, fallback?: number): number | FormulaErrorReads and coerces one argument to a finite number.
reference(index: number): FormulaError | ResolvedFormulaRangeReads a reference argument without materializing it.
text(index: number, fallback?: string): string | FormulaErrorReads and coerces one argument to text using spreadsheet-compatible scalar rules.
value(index: number): FormulaValueReads one scalar argument while preserving formula errors.
interface IFormulaEvaluator
IFormulaEvaluator: unknownsymbol: typeof symbolevaluate(ast: FormulaAST, context: EvalContext): FormulaValueEvaluates one AST.
Recursively traverses the AST, performs operations, and handles error propagation:
ReturnsCalculated result.
astParsed formula AST.
contextEvaluation context that provides cell-value reads.
evaluateBatch(asts: {
ast: FormulaAST;
key: number;
}[], context: EvalContext): EvalResult[]Batch evaluation.
The TS implementation can call evaluate one by one. A WASM implementation can process all ASTs on the Rust side in one pass, avoiding 100K JS <-> WASM boundary crossings.
ReturnsEvaluation result list.
astsAST list to evaluate; each item contains a CellKey and its AST.
contextEvaluation context.
registerFunction(fn: FormulaFunction): voidRegisters a custom function.
After registration, formulas can call the function by name. For example, registering AVERAGE allows =AVERAGE(A1:A10).
interface IFunctionRegistry
IFunctionRegistry: unknownsymbol: typeof symbolenforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidRequires post-initialization writes to occur during the owning editor's command dispatch.
get(name: string): FormulaFunction | undefinedGets a function definition by name.
ReturnsFunction definition, or undefined when it is not registered.
nameFunction name, case-insensitive.
has(name: string): booleanChecks whether a function has been registered.
nameFunction name, case-insensitive.
list(): string[]Lists all registered function names.
ReturnsFunction names in uppercase.
register(fn: FormulaFunction): (): voidRegisters a formula function.
fnFunction definition; name is stored in uppercase automatically.
registerMany(functions: readonly FormulaFunction[]): (): voidRegisters a group of formula functions and publishes one combined change notification.
functionsFunction definitions in registration precedence order.
subscribe(listener: (functionNames: readonly string[]): void): (): voidSubscribes to registrations and removals that can change formula results.
unregisterRegistration(id: number): voidRemoves one tokenized registration; disposal may dispatch an owner command.
Runtime contract implemented by built-in and third-party formula functions.
allowReferencesOutsideHostShape?: booleanPass reference coordinates to the function even when outside the host's materialized sheet shape.
Default display format when this function is the formula's outermost call.
lazy?: booleanname: stringnamedConstants?: Readonly<Record<string, FormulaValue>>volatile?: booleanvolatileOnViewport?: booleanRe-evaluate when the first visible cell changes.
evaluate(args: FormulaArg[], context: EvalContext): FormulaValueincrementalUpdate(prevResult: FormulaValue, changedCells: CellChange[], args: FormulaAST[], context: EvalContext): FormulaValueinterface IAggregationCache
IAggregationCache: unknownsymbol: typeof symbolclear(): voidClears all caches.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidBinds cache writes to the owning editor command dispatch after initialization.
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.
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.
startRowStart row (0-based).
startColStart column (0-based).
endRowEnd row (0-based).
endColEnd column (0-based).
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:
rowChanged row (0-based).
colChanged column (0-based).
oldValPrevious value.
newValNew value.
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.
setCount(startRow: number, startCol: number, endRow: number, endCol: number, count: number): voidStores a successfully calculated COUNT for a rectangular range.
setSum(startRow: number, startCol: number, endRow: number, endCol: number, sum: number): voidStores a successfully calculated SUM for a rectangular range.
interface IFormulaCalculationTraceProvider
IFormulaCalculationTraceProvider: unknownRead-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.
symbol: typeof symbolDI token for resolving IFormulaCalculationTraceProvider.
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.
listenerCallback invoked for future calculation trace events.
interface IFormulaIterationSettingsProvider
IFormulaIterationSettingsProvider: unknownOptional editor-local provider for circular formula calculation.
symbol: typeof symbolHost-provided services and data readers used during formula evaluation.
arrayFormulaMode?: "dynamic" | "legacy"rootFormulaCall?: booleanTrue only while evaluating the outermost function call in a formula cell.
currentDateTime(): numberevaluateArrayFormula(ast: FormulaAST, scope?: FormulaEvaluationScope): FormulaValueevaluateFormula(ast: FormulaAST, scope?: FormulaEvaluationScope): FormulaValuegetCellValue(row: number, col: number): FormulaValuegetSheetShape(): [rowCount: number, colCount: number]getSpillValue(row: number, col: number, sheetName?: string): FormulaValue | undefinedReads the complete result at a dynamic-array anchor for the postfix # operator.
getWorkbookCellValue(sheetName: string, row: number, col: number): FormulaValueisCellInBounds(row: number, col: number): booleanisCellOccupied(row: number, col: number): booleaniterateRange(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>iterateRangeCells(startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>iterateWorkbookRange(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaValue>iterateWorkbookRangeCells(sheetName: string, startRow: number, startCol: number, endRow: number, endCol: number): Iterable<FormulaRangeCell>publishRichResult(result: FormulaRichResult | undefined): voidCaptures a rich result for the outermost formula call.
random(): numberreadReference(reference: ResolvedFormulaRange): FormulaValueOne result produced during formula batch evaluation.
Shared metadata attached to every calculation trace event.
readonly sequence: numberHost-neutral execution budget for formula evaluation.
readonly maxSteps: numberconsumeStep(): booleanLexical scope for formula-local names.
readonly parent?: FormulaEvaluationScopeget(name: string): FormulaValue | undefinedset(name: string, value: FormulaValue): voidVersioned presentation-neutral formula function metadata.
readonly category: stringreadonly example: stringreadonly externalServices?: readonly string[]readonly maxArguments?: numberAuthoritative upper argument bound. Omit for variadic or illustrative signatures.
readonly minArguments?: numberAuthoritative lower argument bound. Omit when a signature is illustrative only.
readonly parameters: readonly FormulaFunctionParameterDescriptor[]readonly returnKind?: "array" | "scalar" | "scalar-or-array"readonly summary: stringreadonly version: 1One function parameter exposed to formula-authoring tools.
readonly accepts?: readonly FormulaFunctionArgumentKind[]readonly description: stringreadonly name: stringreadonly optional?: booleanreadonly repeating?: booleanPer-editor calculation policy for circular formula dependencies.
type FormulaCalculationTraceEvent = FormulaBatchFlushedEvent | FormulaRecalculationCompletedEvent | FormulaErrorChangedEvent | FormulaDependenciesChangedEventFormula calculation trace event union.
type FormulaCalculationTraceEventPayload = conditionalTrace event payload before the provider assigns its sequence number.
type FormulaCalculationTraceListener = (event: FormulaCalculationTraceEvent): voidListener invoked synchronously for calculation trace events.
type FormulaFunctionArgumentKind = "any" | "number" | "text" | "boolean" | "cell" | "range" | "array" | "reference" | "function" | "rich"Coarse argument kinds stable across formula-engine implementations.
Stable formula calculation trace event ids.
readonly BatchFlushed: "formula.batchFlushed"readonly DependenciesChanged: "formula.dependenciesChanged"readonly ErrorChanged: "formula.errorChanged"readonly RecalculationCompleted: "formula.recalculationCompleted"FormulaAST is the parsed expression. FormulaValue is the result a function or evaluator can return;
FormulaArg represents an argument passed to a function. References and ranges use the FormulaReference*
and FormulaRange* contracts, so a function can read cells without owning the Sheet document.
If you are implementing a function, start with FormulaFunction and EvalContext. If you are integrating an
evaluator, start with IFormulaEvaluator and the reference-resolution contracts.
Value transition for one formula-visible cell.
Serializable formula error value.
kind: "error"Text value carrying an explicit numeric coercion policy.
Tuple expression preserving the identity of its items.
readonly items: readonly FormulaValue[]readonly kind: "tuple"Type contract carried by the canonical FormulaErrorCode value.
| Member | Value |
|---|---|
Reference |
"#REF!" |
DivisionByZero |
"#DIV/0!" |
Name |
"#NAME?" |
Value |
"#VALUE!" |
NotAvailable |
"#N/A" |
NullIntersection |
"#NULL!" |
Spill |
"#SPILL!" |
Calculation |
"#CALC!" |
Number |
"#NUM!" |
type ErrorCode = FormulaErrorCodeStandard Excel-compatible error code.
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.
type FormulaArray = FormulaValue[][]Rectangular two-dimensional formula result represented as nested rows.
Host-neutral result projected by a formula cell renderer.
type FormulaValue = null | number | string | boolean | FormulaText | FormulaError | FormulaReferenceValue | FormulaTupleValue | FormulaCubeMemberValue | FormulaCubeSetValue | FormulaValue[]Scalar, collection, error, or reference result produced by formulas.
createFormulaError<T>(code: T): FormulaError & { code: T }Creates a validated serializable formula error value.
isFormulaArgumentKind<K>(arg: FormulaArgumentLike | null | undefined, ...kinds: readonly K[]): argNarrows a formula argument to one or more discriminant kinds.
isFormulaError(value: unknown): valueReturns whether a formula value is an error value.
isFormulaErrorCode(code: unknown): codeReports whether a runtime value is a canonical formula error code.
interface IFormulaResultProvider
IFormulaResultProvider: unknownRead-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.
symbol: typeof symbolDI token for resolving IFormulaResultProvider.
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.
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.
rowRow index (0-based).
colColumn index (0-based).
getFormulaResultFormat(row: number, col: number): CellFormat | undefinedDerived format for a numeric formula result; explicit cell formatting takes precedence.
interface IFormulaRichResultProvider
IFormulaRichResultProvider: unknownRead-only provider for non-text visual results produced by formula cells.
symbol: typeof symbolgetFormulaRichResult(row: number, col: number): FormulaRichResult | undefinedinterface IFormulaSourceProvider
IFormulaSourceProvider: unknownRead-only provider for the formula source text shown while editing.
symbol: typeof symbolDI token for resolving IFormulaSourceProvider.
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.
interface IFormulaStatusProvider
IFormulaStatusProvider: unknownRead-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.
symbol: typeof symbolDI token for resolving IFormulaStatusProvider.
getFormulaCellStatus(row: number, col: number): FormulaCellStatusGets a stable formula status snapshot for one sheet cell.
ReturnsFormula status with defensive copies of dependency arrays.
rowRow index (0-based).
colColumn index (0-based).
interface FormulaBatchFlushedEvent extends FormulaCalculationTraceEventBaseEvent emitted when one batch of derived results is flushed.
readonly generation: numberreadonly pendingCount: numberreadonly results: readonly FormulaFlushedCellResult[]readonly type: "formula.batchFlushed"Read-only cell facts consumed by information formulas.
readonly formula?: stringreadonly labelPrefix?: stringreadonly locked?: booleanreadonly numberFormat?: stringreadonly reference: FormulaMetadataCellReferencereadonly source: FormulaCellSourcereadonly value: FormulaValuereadonly width?: numberRead-only formula status snapshot for one sheet cell.
readonly col: numberreadonly dependencies: readonly Dependency[]readonly dependents: readonly number[]readonly dirty: booleanreadonly errorCode: FormulaErrorCode | undefinedreadonly formula: string | undefinedreadonly isFormulaCell: booleanreadonly result: FormulaValue | undefinedreadonly row: numberinterface FormulaDependenciesChangedEvent extends FormulaCalculationTraceEventBaseEvent emitted when one formula cell's dependency edges change.
readonly col: numberreadonly dependencies: readonly Dependency[]readonly key: numberreadonly previousDependencies: readonly Dependency[]readonly row: numberreadonly type: "formula.dependenciesChanged"interface FormulaErrorChangedEvent extends FormulaCalculationTraceEventBaseEvent emitted when one formula cell's error code changes.
readonly col: numberreadonly errorCode: FormulaErrorCode | undefinedreadonly generation: numberreadonly key: numberreadonly previousErrorCode: FormulaErrorCode | undefinedreadonly row: numberreadonly type: "formula.errorChanged"One cell result written during a formula batch flush.
readonly col: numberreadonly errorCode: FormulaErrorCode | undefinedreadonly key: numberreadonly previousResult: FormulaValue | undefinedreadonly result: FormulaValuereadonly row: numberHost-owned, synchronous metadata projection consumed during formula evaluation.
readCell(reference: FormulaMetadataCellReference): FormulaCellMetadata | undefinedreadEnvironment(): FormulaEnvironmentMetadata | undefinedreadVisibleOrigin(): FormulaMetadataCellReference | undefinedreadWorkbook(): FormulaWorkbookMetadata | undefinedinterface FormulaRecalculationCompletedEvent extends FormulaCalculationTraceEventBaseEvent emitted when one recalculation generation completes.
readonly batchCount: numberreadonly flushedCellCount: numberreadonly generation: numberreadonly pendingCount: 0readonly type: "formula.recalculationCompleted"type FormulaCellSource = "empty" | "value" | "formula"Origin of a persisted cell, kept distinct from its calculated value.
FormulaBatchFlushedEventType: "formula.batchFlushed"Stable event id for a formula batch flush.
FormulaDependenciesChangedEventType: "formula.dependenciesChanged"Stable event id for a formula dependency transition.
FormulaErrorChangedEventType: "formula.errorChanged"Stable event id for a formula error transition.
FormulaRecalculationCompletedEventType: "formula.recalculationCompleted"Stable event id for formula recalculation completion.
interface IFormulaDateSystemProvider
IFormulaDateSystemProvider: unknownEditor-local source for the workbook date serial system.
symbol: typeof symbolinterface IFormulaLocaleProvider
IFormulaLocaleProvider: unknownEditor-local locale provider consumed by formula evaluation hosts.
symbol: typeof symbolDI token for resolving IFormulaLocaleProvider.
Returns the current date/time locale strategy for formula functions.
Returns the current text byte/width locale strategy for formula functions.
interface IFormulaTextServiceProvider
IFormulaTextServiceProvider: unknownOptional editor-local providers for metadata- and service-backed text formulas.
symbol: typeof symbolDI token for host adapters that supply text-formula services.
enforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidgetLanguageService(): FormulaLanguageService | undefinedgetPhoneticReader(): FormulaPhoneticReader | undefinedregisterLanguageService(service: FormulaLanguageService): (): voidregisterPhoneticReader(reader: FormulaPhoneticReader): (): voidsubscribeInvalidation(listener: (): void): (): voidunregisterRegistration(id: number): voidLocale-specific date/time parsing and formatting used by formulas.
readonly locale: stringreadonly symbols?: FormulaDateTimeSymbolsformatDateTime(serial: number, pattern?: string): stringparseDateTime(value: unknown, options?: FormulaDateTimeParseOptions): FormulaDateTimeParseResult | nullLocale-specific AM/PM token.
Locale-specific month-name token.
Options passed to locale-aware formula date/time parsers.
readonly currentDateTime?: numberParsed Excel-compatible date/time serial and source components.
Locale-specific symbols consumed by the shared date/time parser.
readonly meridiems?: readonly FormulaDateTimeMeridiemSymbol[]readonly months?: readonly FormulaDateTimeMonthSymbol[]readonly units?: FormulaDateTimeUnitSymbolsLocale-specific date-unit tokens.
Synchronous cache view for host-managed language services.
readonly defaultTargetLanguage?: stringdetectLanguage(text: string): FormulaLanguageServiceResultsubscribeInvalidation(listener: (): void): (): voidtranslate(text: string, sourceLanguage: string | undefined, targetLanguage: string): FormulaLanguageServiceResultReads persisted phonetic text without coupling formulas to a cell schema.
getCellPhonetic(row: number, col: number): string | undefinedgetWorkbookCellPhonetic(sheetName: string, row: number, col: number): string | undefinedLocale-specific byte and width transforms for legacy text functions.
readonly currencySymbol?: stringreadonly locale: stringbyteLength(text: string): numbercalculationModeLabel(mode: "Automatic" | "Manual"): stringcharacterCode(text: string): numbercharacterFromCode(code: number): string | undefinedcompareText(left: string, right: string): numberfindByBytes(text: string, search: string, startByte: number, caseSensitive: boolean): numberformatCurrency(number: number, decimals: number): stringreplaceByBytes(text: string, startByte: number, byteLength: number, replacement: string): stringsliceByBytes(text: string, startByte: number, byteLength: number): stringtoFullWidth(text: string): stringtoHalfWidth(text: string): stringtoJis(text: string): stringWorkbook date serial systems supported by formula evaluation.
| Member | Value |
|---|---|
Excel1900 |
1900 |
Excel1904 |
1904 |
type FormulaLanguageServiceResult = FormulaServiceCacheResult<string>Synchronous result exposed by a host-managed language-service cache.
Canonical service identity used by cached language formulas and their hosts.
interface IFormulaExternalServiceProvider extends FormulaExternalServiceReader
IFormulaExternalServiceProvider: unknownEditor-owned registry used by hosts to publish services and cache invalidation.
symbol: symboldestroy(ownerToken?: object): voidenforceCommandBoundary(isCommandExecuting: (): boolean, dispatchRemoval: (id: number): void): voidenforceTeardownBoundary(ownerToken: object): voidinvalidate<T>(definition: FormulaExternalServiceDefinition<T>): voidregister<T>(definition: FormulaExternalServiceDefinition<T>, service: T): (): voidsubscribeInvalidation(listener: (serviceIds: readonly string[]): void): (): voidunregisterRegistration(id: number): voidIdentifies one procedure exposed by a host-managed add-in.
Host-owned native add-in boundary used by CALL and REGISTER.ID. Implementations must enforce authorization and isolation outside formula evaluation.
call(request: FormulaAddInCall): FormulaServiceCacheResult<FormulaValue>resolveRegistration(request: FormulaAddInRegistrationRequest): FormulaServiceCacheResult<number>interface FormulaDirectAddInCall extends FormulaAddInRegistrationRequestInvokes a host-authorized procedure by module signature.
Optional host facts exposed without leaking platform-native APIs.
readonly calculationMode?: "Automatic" | "Manual"readonly directory?: stringreadonly operatingSystem?: stringreadonly system?: stringreadonly version?: stringinterface FormulaExternalServiceDefinition<T>Typed identity for one synchronous service view consumed by formulas.
readonly id: stringreadonly subscribeInvalidation?: (service: T, listener: (): void): (): voidreadonly type?: TRead-only external-service view exposed during formula evaluation.
get<T>(definition: FormulaExternalServiceDefinition<T>): T | undefinedInvokes a procedure previously resolved by REGISTER.ID.
readonly arguments: readonly FormulaValue[]readonly kind: "registered"readonly registrationId: numberSupported host add-in invocation request.
type FormulaAddInRegistrationId = numberStable numeric handle for one host-authorized add-in procedure.
type FormulaServiceCacheResult = {
readonly status: typeof FormulaServiceCacheStatus.Ready;
readonly value: T;
} | {
readonly status: typeof FormulaServiceCacheStatus.Pending | typeof FormulaServiceCacheStatus.Unavailable;
}Synchronous cache result; asynchronous work stays outside formula evaluation.
defineFormulaExternalService<T>(id: string, options?: Pick<FormulaExternalServiceDefinition<T>, "subscribeInvalidation">): FormulaExternalServiceDefinition<T>Creates a stable external-service definition shared by hosts and plugins.
Typed identity used to publish a host-specific add-in implementation.
Canonical states of a host-managed formula service cache.
readonly Pending: "pending"readonly Ready: "ready"CUBE member or tuple identity with its display caption.
readonly caption: stringreadonly connection: stringreadonly expression: stringreadonly kind: "cube-member"Host-owned synchronous OLAP cache view. Loading and connection I/O stay outside evaluation.
CUBE set identity with its display caption.
readonly caption: stringreadonly connection: stringreadonly count?: numberreadonly expression: stringreadonly kind: "cube-set"Query passed to a host-owned pivot data provider.
readonly dataField: stringreadonly filters: readonly {
field: string;
item: string;
}[]readonly pivotReference: stringHost service used by GETPIVOTDATA.
getData(query: FormulaPivotDataQuery): FormulaValueType contract carried by the canonical FormulaCubeKpiProperty value.
| Member | Value |
|---|---|
KPIValue |
1 |
KPIGoal |
2 |
KPIStatus |
3 |
KPITrend |
4 |
KPIWeight |
5 |
KPICurrentTimeMember |
6 |
type FormulaCubeMemberExpression = string | FormulaCubeMemberValue | readonly FormulaCubeMemberExpression[]Serializable member or tuple expression accepted by CUBE services.
type FormulaCubeQuery = {
readonly caption?: string;
readonly connection: string;
readonly kind: "kpi-member";
readonly kpiName: string;
readonly property: FormulaCubeKpiProperty;
} | {
readonly caption?: string;
readonly connection: string;
readonly expression: FormulaCubeMemberExpression;
readonly kind: "member";
} | {
readonly connection: string;
readonly kind: "member-property";
readonly member: FormulaCubeMemberExpression;
readonly property: string;
} | {
readonly caption?: string;
readonly connection: string;
readonly kind: "ranked-member";
readonly rank: number;
readonly set: string | FormulaCubeSetValue;
} | {
readonly caption?: string;
readonly connection: string;
readonly expression: string;
readonly kind: "set";
readonly sortBy?: string;
readonly sortOrder?: number;
} | {
readonly kind: "set-count";
readonly set: FormulaCubeSetValue;
} | {
readonly connection: string;
readonly kind: "value";
readonly members: readonly FormulaCubeMemberExpression[];
}Serializable query handled by a host-owned CUBE service.
Value returned from a host-owned CUBE service.
Typed identity used to publish a host-specific CUBE implementation.
Typed identity for the host pivot-data service.
Stable CUBE KPI property identifiers.
Serializable request used by host-backed Google-compatible formulas.
readonly arguments: readonly FormulaValue[]readonly functionName: stringSynchronous cache view. Hosts load values outside formula evaluation.
subscribeInvalidation(listener: (): void): (): voidHost-neutral hyperlink result projected by a formula renderer.
Host policy for validating and normalizing hyperlink targets.
normalizeTarget(target: string): string | undefinedopenTarget(target: string): voidOpens a validated target in the host; omitted by non-interactive hosts.
Host-neutral image resource returned by an image loader.
readonly assetId: stringreadonly intrinsicHeight?: numberreadonly intrinsicWidth?: numberreadonly source: stringHost-neutral image result projected by a formula renderer.
Host-owned image loader used by IMAGE.
load(source: string): Promise<void>read(source: string): FormulaServiceCacheResult<FormulaImageResource>subscribeInvalidation(listener: (): void): (): voidStable key used to read one RTD subscription.
Host-owned RTD service.
Normalized request key for a historical market-data lookup.
Synchronous view over historical market data loaded outside formula evaluation.
read(request: FormulaStockHistoryRequest): FormulaServiceCacheResult<FormulaError | FormulaValue[][]>subscribeInvalidation(listener: (): void): (): voidSynchronous view of HTTP response text loaded explicitly by the host.
read(url: string): FormulaServiceCacheResult<string | FormulaError>subscribeInvalidation(listener: (): void): (): voidHost-neutral service identity shared by Google-compatible cached formulas.
Typed identity for the host hyperlink service.
Typed identity for the host image service.
Typed identity for the host RTD service.
Stable external-service identity used by STOCKHISTORY and host caches.
FormulaWebLimits: Readonly<{
textLength: 32767;
urlLength: 2048;
}>Excel limits applied independently of the host's transport/security policy.
Shared identity for WEBSERVICE cache registration and recalculation.
Sparse matrix storage, structural row and column operations, dimensions, and serialization.
class ColumnShapeDimensionsCSRMatrix extends DimensionsCSRMatrixSpecialized subclass of DimensionsCSRMatrix for tracking column widths.
ColumnShapeDimensionsCSRMatrix(...args: [data: {
data: number[];
indices: number[];
indptr: number[];
}, shape: [number, number]]): ColumnShapeDimensionsCSRMatrixConstructs a DimensionsCSRMatrix instance.
argsSame parameters as CSRMatrix constructor
name: stringStable matrix name used in diagnostics and serialized metadata.
Inherited from DimensionsCSRMatrix.
class CSRMatrix<T> extends SparseMatrix<T>Sparse two-dimensional storage for Sheet values.
A row pointer identifies each row's stored entries, so empty cells do not
occupy a value slot. getItem returns the configured default or null for
an absent entry. Use forEachStored when a reader needs only populated
cells rather than visiting every coordinate in a large Sheet.
Committed matrices can be locked against direct writes. Transaction staging works on a separate mutable copy and replaces the committed value afterward.
name: stringThe name of the matrix state.
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.
targetIndexThe index where the new column should be inserted.
colAn array representing the column to be added. The length of this array must match the number of rows in the matrix.
Adds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
colThe column index.
valueThe value to add.
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.
targetIndexThe index at which to add the row.
rowThe row to add.
clone(): thisCreates an independent copy of this value and its mutable data.
cloneCommittedView(detachExtra?: (value: unknown): unknown): thisDetaches subclass-private slots while sharing already frozen sparse storage.
cloneDetached(cloneValue: (value: T): T): thisCopies stored values for a detached snapshot without probing empty cells.
cloneForCommit(cloneValue: <V>(value: V): V): thisCopies a matrix for immediate commit, retaining shared styles and reusing validated immutable cells.
cloneForStaging(cloneValue?: <Value>(value: Value): Value): thisCopies visible sparse state without invoking subclass constructors or clone hooks.
deleteColumns(targetIndex: number, numDeleteColumns?: number): CSRMatrix<T>Deletes one or more columns from the matrix starting at the specified index.
ReturnsThe updated matrix instance.
ThrowsIf the range of columns to be deleted exceeds the current number of columns.
targetIndexThe index of the first column to be deleted.
numDeleteColumnsThe number of columns to delete. Defaults to 1.
deleteRows(targetIndex: number, numDeleteRows?: number): CSRMatrix<T>Deletes rows from the matrix starting at the specified index.
ReturnsThe current instance for chaining.
ThrowsWill throw an error if the number of rows to delete is out of bounds.
targetIndexThe index at which to start deleting rows.
numDeleteRowsThe number of rows to delete.
dispatch(operations: MatrixOTOperation<T>[]): CSRMatrix<T>Applies a set of matrix operations to the current matrix.
ReturnsThe updated matrix instance.
operationsAn array of operations to be applied to the matrix.
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).
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.
forEachStoredInRow(row: number, callback: (value: T, col: number): void): voidVisits the CSR segment for one row in O(stored entries in that row).
Converts a dense array to a CSRMatrix.
ReturnsThe current instance for chaining.
denseArrayThe dense array to convert.
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.
rowThe row index.
colThe column index.
lockMutations(): voidPrevents writes to a committed matrix while leaving clones mutable for transaction staging.
readStoredColumn(columnIndex: number): T | null[]Reads stored values in one column as a dense snapshot with null gaps.
removeItem(row: number, col: number): CSRMatrix<T> | undefinedRemoves an item from the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
colThe column index.
swapColumn(targetIndex: number, sourceIndex: number): CSRMatrix<T>Swaps two columns in the matrix at the specified indices.
ReturnsThe updated matrix instance.
targetIndexThe index of the first column to be swapped.
sourceIndexThe index of the second column to be swapped.
Swaps two rows in the matrix.
ReturnsThe current instance for chaining.
targetIndexThe index of the target row.
sourceIndexThe index of the source row.
toArray(): T[][]Converts the matrix to a 2D array representation.
ReturnsA 2D array representing the matrix, with each element initialized to null if not set.
static fromRowEntries<M>(this: (data: undefined, shape: [number, number]): M, shape: [number, number], entries: Iterable<readonly [number, number, Parameters<M["addItem"]>[2]]>): MBuilds an independent matrix in row order, applying each subclass's ordinary value validation.
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:
Use Cases:
// 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 rowsDimensionsCSRMatrix(...args: [data: {
data: number[];
indices: number[];
indptr: number[];
}, shape: [number, number]]): DimensionsCSRMatrixConstructs a DimensionsCSRMatrix instance.
argsSame parameters as CSRMatrix constructor
addColumn(targetIndex: number, column: number | null[]): thisInserts a column while omitting values equal to the configured default dimension.
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.
rowMatrix row receiving the dimension value.
colMatrix column receiving the dimension value.
valueRequested dimension size.
addRow(targetIndex: number, row: number | null[]): thisInserts a row while omitting values equal to the configured default dimension.
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 once
// If column widths are [100, 150, 200]
const left = matrix.getDimensionLeftBoundaryByIndex(2); // Returns 250 (100 + 150)colIndexThe column index (0-based)
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 once
// If column widths are [100, 150, 200]
const right = matrix.getDimensionRightBoundaryByIndex(1); // Returns 250 (100 + 150)colIndexThe column index (0-based)
getDimensionsMap(): number[]Computes and returns the cumulative dimension map.
The dimensions map stores the cumulative sum of all dimension values up to each column. For example, if dimensions are [10, 20, 30], the map is [10, 30, 60]. This allows O(1) lookups of boundaries without recalculating sums.
Result is cached until the matrix is modified. Cache is automatically invalidated when rows/columns are added, deleted, or modified.
ReturnsArray where element i contains the sum of dimensions 0..i Time Complexity: O(rows * cols) on first call or after modification, O(1) for cached result
const matrix = new DimensionsCSRMatrix(...);
const map = matrix.getDimensionsMap(); // [10, 30, 60]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)
// If column widths are [100, 150, 200] with cumulative [100, 250, 450]
const col = matrix.getLeftBoundaryColIndexByDimension(200); // Returns 1 (in column 1)dimensionThe cumulative dimension value to search for
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)
// If column widths are [100, 150, 200] with cumulative [100, 250, 450]
const col = matrix.getRightBoundaryColIndexByDimension(250); // Returns 1 (column 1 ends at 250)dimensionThe cumulative dimension value to search for
setDefaultValue(value: number): voidSets the dimension fallback and removes matching entries so only overrides remain stored.
valueDefault row height or column width returned for absent entries.
Inherited from CSRMatrix.
class MatrixSerializationError extends SearErrorError thrown when a persisted sparse matrix payload cannot be decoded.
MatrixSerializationError(code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT", message: string, details?: SearErrorDetails): MatrixSerializationErrorreadonly code: "SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT"Stable machine-readable error code.
class RowShapeDimensionsCSRMatrix extends DimensionsCSRMatrixSpecialized subclass of DimensionsCSRMatrix for tracking row heights.
RowShapeDimensionsCSRMatrix(...args: [data: {
data: number[];
indices: number[];
indptr: number[];
}, shape: [number, number]]): RowShapeDimensionsCSRMatrixConstructs a DimensionsCSRMatrix instance.
argsSame parameters as CSRMatrix constructor
name: stringStable matrix name used in diagnostics and serialized metadata.
Inherited from DimensionsCSRMatrix.
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:
Used primarily in spreadsheet applications where you need to manage both cell content and the visual layout (dimensions) of rows and columns.
const state: ISheetState<string> = {
sheetData: new CSRMatrix<string>(...),
rowSizes: new RowShapeDimensionsCSRMatrix(...),
columnSizes: new ColumnShapeDimensionsCSRMatrix(...)
};Matrix storing column dimension values (typically column widths in pixels). Single row matrix with numCols entries, one width per column. Use getDimensionLeftBoundaryByIndex/getDimensionRightBoundaryByIndex for layout calculations.
Example: ColumnShapeDimensionsCSRMatrix with values [100, 150, 200] means
Matrix storing row dimension values (typically row heights in pixels). Single column matrix with numRows entries, one height per row. Use getDimensionLeftBoundaryByIndex/getDimensionRightBoundaryByIndex for layout calculations.
Example: RowShapeDimensionsCSRMatrix with values [30, 25, 40] means
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
interface SerializedSparseMatrix<TValue>Sparse matrix payload used by package-level serializers.
readonly defaultValue?: TValueOptional sparse fallback value returned by the runtime matrix for absent entries.
readonly entries: readonly SerializedSparseMatrixEntry<TValue>[]Stored non-default entries.
readonly shape: readonly [number, number]Matrix shape as [rows, columns].
interface SerializedSparseMatrixEntry<TValue>Sparse matrix entry stored independently from the runtime CSR implementation.
Machine-readable matrix serialization error code type.
| Member | Value | Description |
|---|---|---|
invalidFormat |
"SEAR_MATRIX_SERIALIZATION_INVALID_FORMAT" |
The persisted matrix payload does not match the expected shape. |
deserializeSparseMatrix<TValue, TMatrix>(payload: unknown, MatrixClass: SparseMatrixFactory<TMatrix, TValue>, path: string): TMatrixDeserializes a generic sparse matrix payload into the requested runtime matrix class.
serializeSparseMatrix<TValue>(matrix: RuntimeSparseMatrix<TValue>): SerializedSparseMatrix<TValue>Serializes a sparse runtime matrix without depending on CSR internals.
Stable machine-readable error codes owned by matrix serialization helpers.
Inclusive bounds used by matrix range movement.
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.
createMatrixRangeReorderOperations<T>(matrix: CSRMatrix<T>, range: {
readonly end: readonly [number, number];
readonly start: readonly [number, number];
}, destinationOf: (row: number): number): UpdateCellOTOperation<T | null>[]Reorders only stored cells and clears vacated coordinates from the original snapshot.
hasMatrixRangeMoveConflict<T>(matrix: CSRMatrix<T>, source: MatrixMoveRange, destination: MatrixMoveRange): booleanTests for explicit destination entries not already owned by the source range.
Operational-transformation primitives for matrices, rectangles, and rich documents.
TransactionOTRegistry chooses the transform for concurrent operations. Use the built-in registry when a host must rebase local and remote changes.
Base class for Operational Transformation implementations.
Concrete domains provide the actual apply, append, compose, and transform semantics while sharing validation and creation helpers here.
readonly name: stringHuman-readable OT implementation name for diagnostics and debugging.
static append(destination: OTOperation[], current: OTOperation): voidAppends one operation into a composed destination list.
ThrowsSearError until implemented by a concrete OT class.
static apply(snapshot: unknown, operations: OTOperation[]): voidApplies operations to a domain snapshot.
ThrowsSearError until implemented by a concrete OT class.
static checkValidOp(operations: OTOperation[]): voidValidates the structural contract common to all operations.
ThrowsSearError when an operation is missing its path.
operationsOperations that must each carry an array path.
static compose(operation1: OTOperation[], operation2: OTOperation[]): OTOperation[]Composes two sequential operation lists into one equivalent list.
ThrowsSearError until implemented by a concrete OT class.
static create(data?: OTOperation[]): OTOperation[]Creates an operation list snapshot.
ReturnsA mutable operation list detached from the caller's array.
dataOptional operations to clone into the new list.
static transform(operation: OTOperation[], otherOperation: OTOperation[], type: OTTransformPriority): OTOperation[]Transforms an operation list against concurrent operations.
ThrowsSearError until implemented by a concrete OT class.
class TransactionOTError extends SearErrorPublic error for invalid or unavailable transaction OT behavior.
TransactionOTError(code: TransactionOTErrorCode, message: string, details?: SearErrorDetails): TransactionOTErrorreadonly code: TransactionOTErrorCodeStable machine-readable identifier for this error category.
Local registry of versioned OT families and explicit pair transformations.
decode(id: string, version: number, payload: unknown): OTOperation[]Decodes a wire payload through its registered family definition.
destroy(): voidPermanently clears the registry.
encode<OperationType>(definition: TransactionOTDefinition<OperationType>, operations: readonly OperationType[]): OTEncodedValueEncodes and validates one operation family payload.
invert<OperationType>(definition: TransactionOTDefinition<OperationType>, operations: readonly OperationType[]): OperationType[]Inverts operations through their family definition.
registerIndependent(left: TransactionOTDefinition, right: TransactionOTDefinition): (): voidRegisters two families as independent, so pair transformation is explicit identity.
registerRelation<Left, Right>(relation: OTTransformRelation<Left, Right>): (): voidRegisters one explicit relation. Reverse lookup uses the same implementation with swapped branches.
registerType<OperationType>(definition: TransactionOTDefinition<OperationType>): (): voidRegisters one operation family and returns an idempotent disposer.
requireType(id: string, version: number): TransactionOTDefinitionResolves a registered operation family.
transformPair<Left, Right>(leftDefinition: TransactionOTDefinition<Left>, leftOperations: readonly Left[], rightDefinition: TransactionOTDefinition<Right>, rightOperations: readonly Right[], priority: OTTransformPriority): OTTransformPair<Left, Right>Rebases two concurrent operation lists through their registered relation.
Minimal operation contract shared by every domain OT implementation.
p: OTOperationPathPath locating the operation target inside the snapshot.
interface OTTransformPair<Left, Right>Pair transformation result preserving both concurrent branches.
interface OTTransformRelation<Left, Right>Domain-specific transformation relation between two operation families.
readonly left: TransactionOTDefinition<Left>readonly right: TransactionOTDefinition<Right>transformPair(left: readonly Left[], right: readonly Right[], priority: OTTransformPriority): OTTransformPair<Left, Right>interface TransactionOTDefinition<OperationType>Stable, versioned operation family shared by history and collaboration.
decode(payload: unknown): OperationType[]encode(operations: readonly OperationType[]): OTEncodedValueinvert(operations: readonly OperationType[]): OperationType[]isOperation(operation: OTOperation): operationTie-break direction used when two concurrent operations target the same position.
| Member | Value |
|---|---|
LEFT |
"left" |
RIGHT |
"right" |
Stable errors raised by transaction OT definitions and registries.
| Member | Value |
|---|---|
InvalidDefinition |
"SEAR_TRANSACTION_OT_INVALID_DEFINITION" |
InvalidPayload |
"SEAR_TRANSACTION_OT_INVALID_PAYLOAD" |
TypeConflict |
"SEAR_TRANSACTION_OT_TYPE_CONFLICT" |
TypeNotRegistered |
"SEAR_TRANSACTION_OT_TYPE_NOT_REGISTERED" |
RelationConflict |
"SEAR_TRANSACTION_OT_RELATION_CONFLICT" |
RelationNotRegistered |
"SEAR_TRANSACTION_OT_RELATION_NOT_REGISTERED" |
InvertUnsupported |
"SEAR_TRANSACTION_OT_INVERT_UNSUPPORTED" |
RegistryDestroyed |
"SEAR_TRANSACTION_OT_REGISTRY_DESTROYED" |
type Operation = MatrixOTOperation<unknown> | UpdateRectOTOperation | RichDocOTOperationBuilt-in operation union. Third-party callers use OTOperation as their open base contract.
type OTEncodedValue = null | boolean | number | string | readonly OTEncodedValue[] | { readonly [key: string]: OTEncodedValue }JSON-compatible values accepted by collaboration transports.
Creates an isolated registry containing all built-in OT definitions and relations.
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.
OTClone<T>(object: T): TDeep-clones JSON-compatible OT payloads before mutation or composition.
transactionOTTypeKey(definition: Pick<TransactionOTDefinition, "id" | "version">): stringReturns the wire identity of one versioned OT family.
Built-in MatrixOT family shared by matrix-backed transaction owners.
MatrixTransactionOTRelation: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>Matrix-to-matrix pair transformation used by every matrix-backed owner.
Built-in rich-document operation family.
Rich-document pair transformation.
interface DeleteColOTOperation<T> extends OTOperationDeletes one column and carries the deleted column payload for inversion.
interface DeleteRowOTOperation<T> extends OTOperationDeletes one row and carries the deleted row payload for inversion.
interface InsertColOTOperation<T> extends OTOperationInserts one column at the target column index.
interface InsertRowOTOperation<T> extends OTOperationInserts one row at the target row index.
interface MoveColOTOperation<T> extends OTOperationExchanges the column at the path index with the column index encoded by cm.
interface MoveRowOTOperation<T> extends OTOperationExchanges the row at the path index with the row index encoded by rm.
interface ResizeColOTOperation extends OTOperationUpdates one column dimension in a dimension matrix.
interface ResizeRowOTOperation extends OTOperationUpdates one row dimension in a dimension matrix.
type MatrixStructureOTOperation = InsertRowOTOperation<T> | DeleteRowOTOperation<T> | MoveRowOTOperation<T> | InsertColOTOperation<T> | DeleteColOTOperation<T> | MoveColOTOperation<T>Structural matrix operations that shift row or column coordinates.
createDeleteColOTOperation<T>(path: readonly number[], values: readonly T | null[]): DeleteColOTOperation<T>Creates a semantic column-delete operation carrying the deleted values required for inversion.
createDeleteRowOTOperation<T>(path: readonly number[], values: readonly T | null[]): DeleteRowOTOperation<T>Creates a semantic row-delete operation carrying the deleted values required for inversion.
createInsertColOTOperation<T>(path: readonly number[], values: readonly T | null[]): InsertColOTOperation<T>Creates a semantic column-insert operation without changing the MatrixOT wire shape.
createInsertRowOTOperation<T>(path: readonly number[], values: readonly T | null[]): InsertRowOTOperation<T>Creates a semantic row-insert operation without changing the MatrixOT wire shape.
createMoveColOTOperation(path: readonly number[], destination: readonly number[]): MoveColOTOperation<unknown>Creates a semantic column-move operation.
createMoveRowOTOperation(path: readonly number[], destination: readonly number[]): MoveRowOTOperation<unknown>Creates a semantic row-move operation.
createResizeColOTOperation(path: readonly number[], value: number | null, previousValue: number | null): ResizeColOTOperationCreates a semantic column-resize operation.
createResizeRowOTOperation(path: readonly number[], value: number | null, previousValue: number | null): ResizeRowOTOperationCreates a semantic row-resize operation.
isMatrixStructureOperation<T>(operation: OTOperation): operationNarrows an OT operation to one of the row or column structure operations.
isResizeColOperation(operation: OTOperation): operationNarrows an OT operation to a column-resize operation with a present action payload.
isResizeRowOperation(operation: OTOperation): operationNarrows an OT operation to a row-resize operation with a present action payload.
Operational Transformation implementation for CSRMatrix-backed sheet state.
MatrixOT owns cell updates, row/column structure edits, dimension resize operations, and the transform rules that keep concurrent matrix changes convergent.
static append<U>(destination: MatrixOTOperation<U>[], current: MatrixOTOperation<U>): voidAppends one component into a composed matrix operation list.
destinationComposition destination mutated in place.
currentOperation to append.
static apply<U, S>(snapshot: S, operations: MatrixOTOperation<U>[]): SApplies operations to a CSR matrix snapshot.
ReturnsThe same snapshot instance after mutation.
snapshotMutable CSR-backed state.
operationsMatrix operations to apply.
static commonLengthForOps<U>(operation1: MatrixOTOperation<U>, operation2: MatrixOTOperation<U>): numberComputes the common parent depth used by component transformation.
ReturnsThe depth of the shared parent segment.
operation1First operation whose parent path is compared.
operation2Second operation whose parent path is compared.
static compose<U>(operation1: MatrixOTOperation<U>[], operation2: MatrixOTOperation<U>[]): MatrixOTOperation<U>[]Composes two sequential matrix operation lists.
ReturnsEquivalent composed operation list.
operation1Earlier operation list.
operation2Later operation list.
static invert<U>(operations: MatrixOTOperation<U>[]): MatrixOTOperation<U>[]Inverts an operation list in rollback order.
ReturnsOperations that undo the input when applied in order.
operationsForward operations to invert.
static invertComponent<U>(currentOperation: MatrixOTOperation<U>): MatrixOTOperation<U>Builds the inverse of one matrix component.
ReturnsA component that restores the previous matrix state.
currentOperationComponent to invert.
static transform<U>(operation: MatrixOTOperation<U>[], otherOperation: MatrixOTOperation<U>[], type: OTTransformPriority): MatrixOTOperation<U>[]Transforms concurrent Matrix OT operations into a convergent pair.
static transformComponent<U>(destination: MatrixOTOperation<U>[], currentOperation: MatrixOTOperation<U>, otherOperation: MatrixOTOperation<U>, type: OTTransformPriority): MatrixOTOperation<U>[]Transforms one matrix component over one concurrent component.
ReturnsThe destination list after appending any transformed component.
destinationOutput list receiving the transformed component or no-op.
currentOperationOperation being rebased.
otherOperationConcurrent operation already applied on the target branch.
typeTie-break side for equal-position edits.
static transformComponentX<U>(left: MatrixOTOperation<U>, right: MatrixOTOperation<U>, destLeft: MatrixOTOperation<U>[], destRight: MatrixOTOperation<U>[]): voidTransforms one Matrix OT component against another concurrent component.
static transformX<U>(leftOperation: MatrixOTOperation<U>[], rightOperation: MatrixOTOperation<U>[]): MatrixOTOperation<U>[][]Transforms one Matrix OT operation against a concurrent operation.
Operational Transformation implementation for sheet rectangle state.
RectOT applies direct rectangle updates and matrix structure operations that shift row/column coordinates inside the rectangle.
Applies rectangle operations to a mutable Rect snapshot.
ReturnsThe same rectangle after mutation.
snapshotRectangle to mutate.
operationsOperations to apply in order.
Inverts a rectangle operation list using the rectangle state before each component.
ReturnsOperations that undo the input when applied in order.
operationsForward operations to invert.
beforeRectRectangle state before any forward operations are applied.
static invertComponent(currentOperation: RectOTOperation, beforeRect?: Rect): RectOTOperationBuilds the inverse of one rectangle operation.
ReturnsAn operation that restores the previous rectangle state.
currentOperationOperation to invert.
beforeRectRectangle state before the forward update operation.
interface UpdateCellOTOperation<T> extends OTOperationUpdates a single cell and carries both forward and previous values.
interface UpdateRectOTOperation extends OTOperationReplaces a rectangle's two corner points.
Compact command keys persisted in matrix OT payloads.
| Member | Value |
|---|---|
ColDelete |
"cd" |
ColInsert |
"ci" |
ColMove |
"cm" |
ResizeCol |
"rc" |
ResizeRow |
"rr" |
RowDelete |
"rd" |
RowInsert |
"ri" |
RowMove |
"rm" |
UpdateCell |
"uc" |
Compact command keys persisted in rectangle OT payloads.
| Member | Value |
|---|---|
UpdateRect |
"ur" |
Distinguishes ordinary replacement from relocation that preserves independently owned cell state.
| Member | Value |
|---|---|
Relocation |
"relocation" |
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.
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.
createUpdateRectOTOperation(path: readonly number[], start: readonly [number, number], end: readonly [number, number]): UpdateRectOTOperationCreates a semantic rectangle update without changing the RectOT wire shape.
isMatrixOperation(operation: OTOperation): operationNarrows an operation to any operation understood by MatrixOT.
isUpdateCellOperation<T>(operation: OTOperation): operationNarrows an OT operation to an update-cell operation with a present action payload.
Rich-document operations target nodes, text, and attributes in the document tree.
Operational Transformation implementation for the JSON rich-document model.
RichDocOT applies node, text, and attribute operations and rebases concurrent edits so document trees converge across collaboration clients.
static append(destination: RichDocOTOperation[], current: RichDocOTOperation): voidAppends one rich-document operation into a composed destination list.
destinationComposition destination mutated in place.
currentOperation to append.
static apply(snapshot: NodeSchema, operations: RichDocOTOperation[]): NodeSchemaApplies rich-document operations to a mutable node snapshot.
ReturnsThe same snapshot instance after mutation.
snapshotRoot node to mutate.
operationsOperations to apply in order.
static compose(operation1: RichDocOTOperation[], operation2: RichDocOTOperation[]): RichDocOTOperation[]Composes two sequential rich-document operation lists.
ReturnsEquivalent composed operation list.
operation1Earlier operation list.
operation2Later operation list.
static create(data?: RichDocOTOperation[]): RichDocOTOperation[]Creates a detached rich-document operation list.
ReturnsA mutable operation list owned by the caller.
dataOptional operation list to clone.
static invert(operations: RichDocOTOperation[]): RichDocOTOperation[]Creates the inverse operation list for a committed rich-document change.
static transform(operation: RichDocOTOperation[], otherOperation: RichDocOTOperation[], type: OTTransformPriority): RichDocOTOperation[]Transforms one rich-document operation list against concurrent operations.
ReturnsThe operation list rebased over otherOperation.
operationOperation list being rebased.
otherOperationConcurrent operation list already applied on the target branch.
typeTie-break side for equal-position edits.
interface DeleteNodeOTOperation extends OTOperationDeletes a node and carries the removed payload for inversion.
Deleted node payload.
p: OTOperationPathTarget node path.
interface DeleteStringOTOperation extends OTOperationDeletes text from a leaf text node and carries the removed string.
interface InsertNodeOTOperation extends OTOperationInserts a node into a parent content array.
Node payload inserted at the target path.
p: OTOperationPathTarget insertion path.
interface InsertStringOTOperation extends OTOperationInserts text into a leaf text node.
interface MoveNodeOTOperation extends OTOperationMoves a node within its parent content array.
interface ReplaceNodeOTOperation extends OTOperationReplaces one node in a content array while retaining both sides for OT inversion.
Node payload removed from the target path.
Node payload inserted at the target path.
p: OTOperationPathTarget node path.
interface UpdateAttrsOTOperation extends OTOperationUpdates one node attribute and carries both previous and next values.
Persisted rich-document node schema shared by document runtime, commands, and OT.
attrs?: Record<string, any>Node attributes for styles, formatting, and feature-owned metadata.
Child rich-document nodes.
id?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
text?: stringOptional text content for leaf text nodes.
type: stringDomain node type identifier.
interface TextSchema extends NodeSchemaPersisted text-bearing rich-document node schema.
text: stringOptional text content for leaf text nodes.
Compact operation keys persisted in rich-document OT payloads.
| Member | Value |
|---|---|
NodeDelete |
"nd" |
NodeInsert |
"ni" |
NodeMove |
"nm" |
StringDelete |
"sd" |
StringInsert |
"si" |
UpdateAttrs |
"ua" |
type RichDocOTOperation = InsertNodeOTOperation | DeleteNodeOTOperation | ReplaceNodeOTOperation | MoveNodeOTOperation | InsertStringOTOperation | DeleteStringOTOperation | UpdateAttrsOTOperationEvery operation understood by RichDocOT.
type RichDocOTOperationPath = OTOperationPathPath into a rich-document tree; numeric segments address content arrays and string segments address attrs.
Sparse Sheet data, dimensions and immutable commit contracts.
class SheetDataEngine extends DataEngineData engine specialization for sheet matrix state.
initialize(): voidInitializes sheet data projections.
class SheetMatrix extends CSRMatrix<CellMatrixElement>SheetMatrix public API.
SheetMatrix(data?: {
data: CellMatrixElement[];
indices: number[];
indptr: number[];
}, shape?: [number, number]): SheetMatrixConstructs a CSRMatrix instance.
dataThe data for the matrix.
shapeThe shape of the matrix as [numRows, numCols].
clone(): thisCopies stored cell payloads as well as sparse indexes.
Inherited from CSRMatrix.
class VisibleRowDimensions extends DimensionsCSRMatrixDimension view shared by layout, hit testing, and rendering.
VisibleRowDimensions(source: DimensionsCSRMatrix, visibility: SheetRowVisibility): VisibleRowDimensionsgetDefaultValue(): number | undefinedReturns the configured fallback used for absent sparse entries, if one exists.
getDimensionsMap(): number[]Computes and returns the cumulative dimension map.
The dimensions map stores the cumulative sum of all dimension values up to each column. For example, if dimensions are [10, 20, 30], the map is [10, 30, 60]. This allows O(1) lookups of boundaries without recalculating sums.
Result is cached until the matrix is modified. Cache is automatically invalidated when rows/columns are added, deleted, or modified.
ReturnsArray where element i contains the sum of dimensions 0..i Time Complexity: O(rows * cols) on first call or after modification, O(1) for cached result
const matrix = new DimensionsCSRMatrix(...);
const map = matrix.getDimensionsMap(); // [10, 30, 60]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.
rowThe row index.
Inherited from DimensionsCSRMatrix.
Read-only live cell-data projection exposed by SheetDataPlugin.
readonly shape: readonly number[]forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (cell: CellMatrixElement, row: number, column: number): void): voidgetItem(row: number, column: number): CellMatrixElement | nullsummarizeRange(startRow: number, startColumn: number, endRow: number, endColumn: number): {
readonly nonEmptyCount: number;
readonly numericCount: number;
readonly sum: number;
}Summarizes stored values in an inclusive range. Only finite numbers contribute to the sum and numeric count.
interface SheetCommitNotification extends SheetProjectionInvalidationImmutable publication consumed through independent state queries.
readonly changedOwners: readonly OwnerKey[]Stable identities of owners whose state was published in this commit.
readonly revision: numberMonotonically increasing revision of successfully published state.
Minimal query registry surface consumed by SheetDataPlugin.
register(definition: ReadSheetCellDataQueryDefinition, handler: (input: void): SheetCellDataReader): (): voidExplicit invalidation of derived Sheet projections after a successful command.
readonly interactionChanged: booleanWhether the commit changed editor-local interaction state.
readonly projections: readonly OwnerKey[]Neutral derived projections invalidated by this commit.
A Sheet presentation contribution that can suppress rows without changing their stored heights.
isRowFiltered(row: number): booleanPersisted cell payload stored in the sheet matrix.
formula?: stringFormula source text for formula cells; calculated results live in formula plugin state.
formulaEvaluationMode?: "dynamic" | "legacy"Array evaluation mode used when the formula was entered.
type: stringCell type identifier owned by the cell type catalog.
value?: unknownRaw value whose shape is owned by the cell type.
cloneCellMatrixElement<T>(value: T): TIsolates serializable cell payloads from callers holding an earlier value.
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.
matrixProjection matrix before the transaction.
operationsSource transaction operations.
createInvertibleProjection-specific operation builder.
createInvertibleSheetDataOperation(matrix: SheetMatrix, operation: Operation): MatrixOTOperation<CellMatrixElement> | nullConverts one external sheet-data operation into an invertible MatrixOT component.
ReturnsMatrix operation carrying enough state for inversion, or null when unrelated.
matrixCurrent sheet matrix snapshot used to fill missing previous payloads.
operationIncoming operation from a transaction.
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.
matrixMatrix to read.
colIndexColumn index to snapshot.
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.
matrixMatrix to read.
rowIndexRow index to snapshot.
readSheetColumnSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads column dimensions published by SheetResizePlugin.
readSheetDataMatrix(dataEngine: DataEngine): SheetMatrix | nullReads the persisted cell matrix published by SheetDataPlugin.
readSheetRawRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads the resize owner's stored row heights, without presentation visibility.
readSheetRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads row dimensions published by SheetResizePlugin.
readSheetRowVisibility(dataEngine: DataEngine): SheetRowVisibility | nullReads the optional row visibility projection published by the filter owner.
registerReadSheetCellDataQuery(queries: SheetDataQueryRegistry, read: (): SheetMatrix): voidRegisters the live, read-only cell-data projection owned by SheetDataPlugin.
ReadSheetCellDataQuery: ReadSheetCellDataQueryDefinitionReads the mounted editor's live cell matrix without creating a document snapshot.
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"DataEngine field for column dimensions owned by SheetResizePlugin.
SheetDataFieldNamespace: "SheetDataFields"Shared DataEngine view containing Sheet feature projections.
SheetDataMatrixFieldKey: "sheet.data"DataEngine field owned by SheetDataPlugin.
SheetRowSizesFieldKey: "sheet.resize.rowSizes"DataEngine field for row dimensions owned by SheetResizePlugin.
SheetRowVisibilityFieldKey: "sheet.filter.rowVisibility"Neutral field contract re-exported by the plugin that owns the contribution.
Typed data ownership, field projection, and state registry contracts.
Sheet content, formatting, formulas, selection, and dimensions have separate owners. A feature registers the state
it owns and publishes typed reads or operations for that state. SearState and the domain contracts give the
runtime a way to compose those contributions without turning the base cell value into a universal feature object.
Document state is durable editor or Workbook content. Session state is local state captured for remounting, such as a viewport. Derived state is computed from other values, such as formula results or render projections. Host state includes transport and product UI. A consumer should choose the corresponding query, observation, or export contract rather than assuming every visible value is stored in the document.
DataEngine fields and visual readers project owner state for consumers. The owner registers its field key and typed reader; a renderer or host consumes that projection. A missing sparse entry means the current default applies, so merely reading or painting a cell does not create persisted state.
Use when: defining a new state-owning feature or reading its value in another layer. Mutate through the owning feature's command, and use its projection for reads. Portable OT operations describe committed changes, while export codecs describe durable file data; neither is inferred from a visual projection.
Base registry for plugin-owned data engines.
Concrete engines can register custom data types by plugin key while exposing their own initialization and read APIs.
enforceWriteBoundary(token: object): voidRestricts registered state and view changes to the owning runtime after setup.
getDataType<T>(key: OwnerKey): T | undefinedRetrieves a plugin-owned data value.
ReturnsRegistered value, or void 0 when absent.
keyPlugin key to read.
getDataTypeOptions(key: OwnerKey): DataEngineRegistrationOptions<unknown> | undefinedReads registration metadata for a plugin-owned data value.
ReturnsRegistration metadata, or void 0 when the key is not registered.
keyPlugin key to inspect.
getDataViewFieldKeys(viewKey: string): string[]Lists fields registered for one named data view.
ReturnsField names in registration order.
viewKeyNamed data view to inspect.
getRegisteredDataTypeKey(key: string): OwnerKey | undefinedResolves a transport-safe plugin-key string to the registered key object.
StateOwnerKey construction intentionally creates a unique identity, so remote transports must resolve the received string back to this registry's existing key before creating a transaction for PluginManager.
ReturnsRegistered StateOwnerKey, or void 0 when no state owner has that key.
keyStable key string carried by a transport message.
hasDataType(key: OwnerKey): booleanReports whether a plugin state has been registered with this engine.
ReturnsTrue when the key owns a DataEngine-visible state value.
keyPlugin key to inspect.
abstract initialize(): voidInitializes engine-owned registries or projections.
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.
viewKeyNamed data view containing the field.
fieldKeyField to read.
registerDataType<StateType>(key: OwnerKey, value: StateType, options?: DataEngineRegistrationOptions<StateType>, token?: object): voidRegisters a plugin-owned data value.
keyPlugin key owning the data.
valueData value to store.
registerDataViewField<StateType>(ownerKey: OwnerKey, 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.
ownerKeyPlugin key whose current state feeds the selector.
fieldNamed view field selector.
replaceDataType(key: OwnerKey, value: unknown, token?: object): voidReplaces a plugin-owned data value.
keyPlugin key owning the data.
valueNew data value.
static readonly symbol: typeof symbolDI token for resolving the abstract data engine singleton.
class DataViewFieldDuplicateError extends SearErrorError thrown when two different state owners try to publish the same data view field.
DataViewFieldDuplicateError(details: {
existingOwnerKey: string;
fieldKey: string;
ownerKey: string;
viewKey: string;
}): DataViewFieldDuplicateErrorCreates a duplicate data view field error.
detailsView key, field key, existing owner, and conflicting owner.
readonly code: "DATA_VIEW_FIELD_DUPLICATE"Stable machine-readable code for duplicate data view field registrations.
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.
abstract name: stringStable state name used when registering state in plugin/core maps.
addListener(listener: Listener): voidRegisters a listener for future state changes.
listenerCallback invoked after notifyListeners().
abstract dispatch(operations: StateOperation[]): thisApplies OT operations to this state object.
ReturnsThe current state instance for chaining.
operationsOperations owned by the concrete state implementation.
abstract 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.
rowRow or first path coordinate.
colColumn or second path coordinate.
removeListener(listener: Listener): voidRemoves a previously registered listener.
listenerCallback to detach from this state object.
class StateKernel<Owner, Transaction, Effect>Atomic state staging and ordered commit notifications, independent of input and rendering.
StateKernel<Owner, Transaction, Effect>(adapter: StateKernelAdapter<Owner, Transaction>, onError?: (error: unknown): void): StateKernel<Owner, Transaction, Effect>Creates a kernel over exclusively owned state and no-throw publication operations.
revision: numberCurrent state-publication revision; failed and preview batches do not advance it.
begin(): StateKernelBatch<Owner, Transaction>Begins a detached batch; the caller may discard it without publishing anything.
commit(batch: StateKernelBatch<Owner, Transaction>, effect?: Effect): StateKernelCommit<Owner, Transaction, Effect>Publishes all prepared owner states before any listener can run.
destroy(): voidReleases subscriptions without invoking presentation cleanup or changing stored data.
notify(commit: StateKernelCommit<Owner, Transaction, Effect>): voidReleases a commit after composition-owned post-commit work, preserving nested commit order.
subscribe(listener: (commit: StateKernelCommit<Owner, Transaction, Effect>): void): (): voidObserves completed publications; subscriptions own no document state.
class StateKernelBatch<Owner, Transaction>Prospective owner states isolated from committed data until the entire batch succeeds.
StateKernelBatch<Owner, Transaction>(adapter: StateKernelAdapter<Owner, Transaction>, revision: number): StateKernelBatch<Owner, Transaction>Batches are created by StateKernel.begin().
preview(): ReadonlyMap<Owner, unknown>Returns detached staged states for non-publishing validation.
publish(adapter: StateKernelAdapter<Owner, Transaction>, revision: number): ReadonlyMap<Owner, readonly Transaction[]>Prepares every owner before the runtime publishes any state.
read(owner: Owner): unknownReads prospective state for projection planning, falling back to the current owner.
stage(transaction: Transaction): booleanApplies an operation to each interested owner using independent mutable copies.
class StatePlugin<State, Transaction>State ownership and reduction without any scene, input, or drawing contract.
StatePlugin<State, Transaction>(state: State): StatePlugin<State, Transaction>Adopts initial state; the composition root subsequently installs its write boundary.
abstract apply(state: State, transaction: Transaction): State | nullReduces a detached prospective state; null means this transaction did not change it.
enforceStateWriteBoundary(commitToken: object): voidReserves state replacement for successful kernel publication.
getState(): StateReads this owner's currently committed value.
hasStateWriteBoundary(): booleanReports whether a kernel has adopted this owner.
setState(state: State, commitToken?: object): voidPublishes a prepared state using the composition root's exclusive token.
interface DataEngineRegistrationOptions<StateType>Metadata associated with one DataEngine state registration.
readonly dataView?: readonly DataEngineViewFieldRegistration<StateType>[]Field selectors contributed by the registered state to named data views.
interface DataEngineViewFieldRegistration<StateType>Field metadata associated with one DataEngine state registration.
readonly fieldKey: stringField name written into the named view.
readonly required?: booleanWhen false, missing owner state or void field values do not make the containing view unavailable.
readonly select: (state: StateType): unknownReads the field value from the current owner state.
readonly viewKey: stringNamed read model that receives the selected field.
interface StateKernelAdapter<Owner, Transaction>State-owner operations used by the transaction kernel without a presentation dependency.
apply(owner: Owner, state: unknown, transaction: Transaction): unknownclone(state: unknown): unknownforEachOwner(transaction: Transaction, visit: (owner: Owner): void): voidprepare(owner: Owner, state: unknown): unknownpublish(states: ReadonlyMap<Owner, unknown>): voidPublishes already prepared states. This runtime-owned operation must not throw.
read(owner: Owner): unknownReads the composed semantic style for one cell without exposing drawing types.
interface StateKernelCommit<Owner, Transaction, Effect>One successful state publication, optionally accompanied by composition-owned effects.
type DataEngineViewFieldSelector = { select(state: StateType): unknown }["select"]Selector used to publish one registered state field into a named data view.
type StateOwnerKey = OwnerKeyNamed owner identity; registry membership uses object identity, not just the label.
Transaction contracts for pipelines and operation ownership.
class Transaction<OperationType>Transaction public API.
readonly meta: Record<string, unknown>Metadata attached to Transaction.
readonly operations: OperationType[]Operations carried by Transaction.
Stable plugin key for Transaction.
addOperation(operations: OperationType[]): voidAdds the operation.
getMeta<T>(key: string): T | undefinedReturns the meta.
setMeta(key: string, value: unknown): thisUpdates the meta.
Stable transaction origins observed by cross-cutting runtime features.
| Member | Value |
|---|---|
History |
"history" |
Local |
"local" |
Remote |
"remote" |
type TransactionPluginKey = OwnerKeyStable owner key accepted by a transaction.
createTransaction<OperationType>(pluginKey: OwnerKey, operations?: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): Transaction<OperationType>Creates a transaction with copied operations and metadata.
TRANSACTION_ORIGIN_META_KEY: "transaction:origin"Metadata key describing where a transaction originated.
Stable workbook and Sheet identities, structure, and document-state contracts.
WorkbookDocumentState holds stable Sheet identities, order, names, visibility, and each Sheet's document state.
WorkbookSessionState holds local values needed to remount the active Sheet. Internal references use stable
sheetId values so renaming a Sheet changes its label without changing its identity.
The Workbook assembly mounts one active Sheet editor. Before switching, it captures that Sheet's document and local session, tears down the editor, and mounts the next Sheet. Switching back restores the captured session; viewport state does not become durable Workbook content.
addWorkbookSheet(), moveWorkbookSheet(), and related operations describe structural changes. The Workbook
assembly stages add, remove, move, rename, hide, and unhide commands as Workbook transactions, with history
separate from edits inside a mounted Sheet.
Use when: managing several Sheets or resolving references across them. Keep structural reads and identity in the Workbook domain; use the active Sheet editor and its feature commands for cell content or appearance. Formula references and collaboration channels use stable Sheet identities rather than mutable display names.
class WorkbookError extends SearErrorError thrown when workbook state or workbook references violate their domain contract.
WorkbookError(code: WorkbookErrorCode, message: string, details?: SearErrorDetails): WorkbookErrorreadonly code: WorkbookErrorCodeStable machine-readable error code.
interface AddWorkbookSheetInput<SheetState>Input accepted by addWorkbookSheet.
readonly index?: numberOptional insertion index; defaults to appending after the current last sheet.
readonly sheet: WorkbookSheetDescriptorDescriptor for the sheet being inserted.
readonly sheetState: SheetStateInitial state payload for the inserted sheet.
interface CreateWorkbookDocumentStateInput<SheetState>Input accepted by createWorkbookDocumentState.
readonly id: stringStable workbook id used by persistence and collaboration rooms.
readonly metadata?: Readonly<Record<string, unknown>>Extension-owned serializable metadata copied onto the workbook state.
readonly sheets: readonly WorkbookSheetDescriptor[]Ordered sheet descriptors.
readonly sheetStates: WorkbookSheetStateMap<SheetState>Per-sheet state payloads keyed by sheet id.
Input accepted by moveWorkbookSheet.
Input accepted by removeWorkbookSheet.
readonly sheetId: stringSheet id to remove.
Input accepted by renameWorkbookSheet.
interface UpdateWorkbookSheetStateInput<SheetState>Input accepted by updateWorkbookSheetState.
readonly sheetId: stringSheet id whose state payload should be replaced.
readonly sheetState: SheetStateReplacement sheet state payload.
interface WorkbookDocumentState<SheetState>Workbook state containing sheet metadata plus per-sheet state payloads.
SheetState is generic so this package stays independent from sheet, render,
formula, and assembly packages.
readonly id: stringStable workbook id used by persistence and collaboration rooms.
readonly metadata?: Readonly<Record<string, unknown>>Extension-owned serializable metadata that does not affect core workbook semantics.
readonly sheets: readonly WorkbookSheetDescriptor[]Ordered sheet descriptors; array order is the persisted tab order.
readonly sheetStates: WorkbookSheetStateMap<SheetState>Per-sheet state payloads keyed by stable sheet id.
Workbook-level sheet metadata.
The containing WorkbookDocumentState.sheets array is the only source of sheet order;
descriptors intentionally do not carry a separate order field.
readonly color?: stringOptional UI tab color owned by the workbook host.
readonly id: stringStable sheet id used by workbook state, collaboration envelopes, and formula dependencies.
readonly metadata?: Readonly<Record<string, unknown>>Extension-owned serializable metadata that does not affect core workbook semantics.
readonly name: stringUnique user-facing sheet name used when displaying formula references.
Machine-readable workbook error code type.
| Member | Value | Description |
|---|---|---|
duplicateSheetId |
"SEAR_WORKBOOK_DUPLICATE_SHEET_ID" |
A sheet id appears more than once in one workbook. |
duplicateSheetName |
"SEAR_WORKBOOK_DUPLICATE_SHEET_NAME" |
A sheet name appears more than once in one workbook. |
sheetNotFound |
"SEAR_WORKBOOK_SHEET_NOT_FOUND" |
A requested sheet id is not present in the workbook. |
workbookEmpty |
"SEAR_WORKBOOK_EMPTY" |
A workbook document contains no sheets. |
invalidSheetName |
"SEAR_WORKBOOK_INVALID_SHEET_NAME" |
A workbook sheet name is empty or otherwise invalid. |
sheetStateMissing |
"SEAR_WORKBOOK_SHEET_STATE_MISSING" |
A workbook sheet state entry is missing for a declared sheet. |
invalidSheetIndex |
"SEAR_WORKBOOK_INVALID_SHEET_INDEX" |
A sheet insertion index is outside the legal sheet-list boundary. |
cannotRemoveLastSheet |
"SEAR_WORKBOOK_CANNOT_REMOVE_LAST_SHEET" |
A workbook operation attempted to remove the final sheet. |
cannotHideAllSheets |
"SEAR_WORKBOOK_CANNOT_HIDE_ALL_SHEETS" |
A workbook operation attempted to hide every sheet. |
invalidReference |
"SEAR_WORKBOOK_INVALID_REFERENCE" |
A cross-sheet formula reference has invalid coordinates. |
invalidCellKey |
"SEAR_WORKBOOK_INVALID_CELL_KEY" |
A serialized workbook cell key cannot be parsed. |
type WorkbookId = stringStable workbook identifier used by host-level workbook registries.
type WorkbookSheetId = stringStable sheet identifier used inside workbook metadata and cross-sheet references.
type WorkbookSheetStateMap = Readonly<Record<WorkbookSheetId, SheetState>>Map from workbook sheet id to the host-selected sheet state payload.
createWorkbookDocumentState<SheetState>(input: CreateWorkbookDocumentStateInput<SheetState>): WorkbookDocumentState<SheetState>Creates a validated workbook state using array order as the sheet tab order.
addWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: AddWorkbookSheetInput<SheetState>): WorkbookDocumentState<SheetState>Adds a sheet descriptor and its initial state payload without mutating the source workbook.
getWorkbookSheetDescriptor<SheetState>(state: WorkbookDocumentState<SheetState>, sheetId: string): WorkbookSheetDescriptor | nullReturns the descriptor for a sheet id, or null when the sheet is absent.
getWorkbookSheetState<SheetState>(state: WorkbookDocumentState<SheetState>, sheetId: string): SheetState | nullReturns one sheet state payload, or null when the sheet is absent.
moveWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: MoveWorkbookSheetInput): WorkbookDocumentState<SheetState>Moves a sheet descriptor to a new tab index without mutating the source workbook.
removeWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: RemoveWorkbookSheetInput): WorkbookDocumentState<SheetState>Removes a sheet descriptor and its state payload without mutating the source workbook.
renameWorkbookSheet<SheetState>(state: WorkbookDocumentState<SheetState>, input: RenameWorkbookSheetInput): WorkbookDocumentState<SheetState>Renames a workbook sheet without mutating the source workbook.
updateWorkbookSheetState<SheetState>(state: WorkbookDocumentState<SheetState>, input: UpdateWorkbookSheetStateInput<SheetState>): WorkbookDocumentState<SheetState>Replaces one sheet state payload without mutating the source workbook.
validateWorkbookDocumentState<SheetState>(state: WorkbookDocumentState<SheetState>): voidValidates the workbook structural invariants shared by commands and persistence.
Stable machine-readable error codes owned by the workbook domain package.
Parsed workbook formula reference bound to a stable sheet id.
readonly range: WorkbookRangeReferenceNormalized workbook range. Single-cell references use the same start and end coordinate.
readonly sheetId: stringStable sheet id resolved from the user-facing formula sheet name.
Qualified cell reference used by workbook-level formulas and dependency graphs.
Qualified whole-column range reference used by workbook-level formulas.
Qualified rectangular range reference used by workbook-level formulas.
Qualified whole-row range reference used by workbook-level formulas.
Stable workbook coordinate axis-name type.
| Member | Value |
|---|---|
row |
"row" |
col |
"col" |
Stable workbook reference property-name type.
| Member | Value |
|---|---|
sheetId |
"sheetId" |
row |
"row" |
col |
"col" |
start |
"start" |
end |
"end" |
startCol |
"startCol" |
endCol |
"endCol" |
startRow |
"startRow" |
endRow |
"endRow" |
type WorkbookCellKey = stringSerialized key for a workbook-qualified formula cell.
type WorkbookFormulaReference = WorkbookCellReference | WorkbookRangeReference | WorkbookColumnRangeReference | WorkbookRowRangeReferenceAny workbook-qualified formula reference supported by the workbook protocol.
type WorkbookReferenceDiagnosticField = WorkbookReferenceField | templateLiteral | templateLiteralDiagnostic field path emitted by workbook reference validation errors.
createWorkbookCellKey(reference: WorkbookCellReference): stringCreates a stable string key for a workbook-qualified cell reference.
formatParsedWorkbookFormulaReference(reference: ParsedWorkbookFormulaReference, sheets: readonly WorkbookSheetDescriptor[]): stringFormats a parsed workbook formula reference with the current user-facing sheet name.
formatWorkbookCellReference(reference: WorkbookCellReference, sheetName: string): stringFormats a workbook-qualified cell reference using a caller-provided sheet name.
formatWorkbookRangeReference(reference: WorkbookRangeReference, sheetName: string): stringFormats a workbook-qualified rectangular range reference using a caller-provided sheet name.
isValidWorkbookReference(reference: unknown): referenceReports whether an unknown value is any valid workbook-qualified formula reference.
isWorkbookCellReference(reference: unknown): referenceReports whether an unknown value is a valid workbook-qualified cell reference.
isWorkbookColumnRangeReference(reference: unknown): referenceReports whether an unknown value is a valid workbook-qualified whole-column range reference.
isWorkbookRangeReference(reference: unknown): referenceReports whether an unknown value is a valid workbook-qualified rectangular range reference.
isWorkbookRowRangeReference(reference: unknown): referenceReports whether an unknown value is a valid workbook-qualified whole-row range reference.
normalizeWorkbookColumnRangeReference(reference: WorkbookColumnRangeReference): WorkbookColumnRangeReferenceNormalizes a whole-column reference so the start column is before the end column.
Normalizes a range reference so start is top-left and end is bottom-right.
Normalizes a whole-row reference so the start row is before the end row.
parseWorkbookCellKey(key: string): WorkbookCellReferenceParses a string produced by createWorkbookCellKey back into a cell reference.
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.
Tuple positions for workbook range coordinates.
readonly col: 1readonly row: 0Stable coordinate axis names used by tuple-backed workbook range references.
Stable property names used by workbook-qualified formula references.
Web toolbar controls for standalone rich-document commands and observations.
class SearWebDocToolbar extends SearToolbarBrowser controls for commands installed in a standalone document editor.
SearWebDocToolbar(editor: Host): SearWebDocToolbarstatic readonly symbol: typeof symbolDI token for resolving SearToolbar.
Web workbook Sheet tabs and Sheet-structure commands.
class SheetBottomBarAdapter<TTarget, TOptions>Platform-neutral lifecycle contract for a complete bottom-bar renderer.
static readonly symbol: symbolclass SheetStatusBarAdapter<TTarget>Platform-neutral lifecycle contract for a sheet status-bar renderer.
abstract destroy(): voidabstract mount(target: TTarget, model: SheetStatusBarModel): voidabstract update(model: SheetStatusBarModel): voidstatic readonly symbol: symbolclass SheetTabBarAdapter<TTarget>Platform-neutral lifecycle contract for a sheet tab-bar renderer.
abstract destroy(): voidabstract mount(target: TTarget, model: SheetTabBarModel): voidabstract update(model: SheetTabBarModel): voidstatic readonly symbol: symbolInput passed when the bottom bar needs a new sheet payload.
Workbook binding used by SearWebBottomBar.
readonly createSheetState?: (input: SearWebBottomBarCreateSheetStateInput): SheetDocumentStateCreates the initial SheetDocumentState for a newly added sheet.
readonly editor: WorkbookEditorWorkbook editor whose command bus owns sheet-list actions.
Platform-neutral view model for status and zoom controls.
readonly focusHighlightEnabled?: booleanreadonly onViewOptionsClick?: (): voidreadonly onZoomInClick: (): voidreadonly onZoomOutClick: (): voidreadonly statusText: stringreadonly zoomEnabled: booleanreadonly zoomText: stringStable sheet item data shared by all tab-bar renderers.
Platform-neutral view model for the sheet tabs segment.
readonly onActivateSheetClick: (sheetId: string): voidreadonly onAddSheetClick: (): voidreadonly onDeleteSheet?: (sheetId: string): voidreadonly onMoveSheet?: (sheetId: string, targetSheetId: string, before: boolean): voidreadonly onRenameSheet?: (sheetId: string, name: string): string | nullreadonly sheets: readonly SheetTabBarItem[]class SearWebBottomBar extends SheetBottomBarAdapter<HTMLElement, SearWebBottomBarMountOptions>Browser DOM implementation of the bottom sheet tab/status bar.
SearWebBottomBar(platform: Platform): SearWebBottomBarConstructs a bottom bar adapter bound to one platform.
destroy(): voidmount(target: HTMLElement, options?: SearWebBottomBarMountOptions): voidstatic readonly symbol: typeof symbolDI token for resolving the browser bottom bar adapter.
class WebSheetStatusBar extends SheetStatusBarAdapter<HTMLElement>Browser DOM adapter for the status and zoom segment of the bottom bar.
destroy(): voidmount(target: HTMLElement, model: SheetStatusBarModel): voidupdate(model: SheetStatusBarModel): voidclass WebSheetTabBar extends SheetTabBarAdapter<HTMLElement>Browser DOM adapter for the sheet tabs segment of the bottom bar.
WebSheetTabBar(actions?: HTMLElement): WebSheetTabBarOptional host controls displayed between Add Sheet and the sheet tabs.
destroy(): voidmount(target: HTMLElement, model: SheetTabBarModel): voidupdate(model: SheetTabBarModel): voidMount options for the browser bottom bar.
readonly statusBar?: SheetStatusBarAdapter<HTMLElement>Optional status adapter. Hosts may provide a custom implementation.
readonly statusText?: stringStatus text shown at the right edge.
readonly tabBar?: SheetTabBarAdapter<HTMLElement>Optional tabs adapter. Hosts may provide a custom implementation.
readonly workbook?: SearWebBottomBarWorkbookBindingOptional workbook binding. Without it, the bottom bar renders the static replica.
readonly zoomText?: stringZoom label shown in the bottom bar.
SHEET_BOTTOM_BAR_CSS: "\n.sear-sheet-bottom-bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 36px;\n padding: 0 10px 0 12px;\n border: 1px solid rgba(23, 26, 29, 0.08);\n border-bottom: 0;\n border-radius: 0;\n background: #f6f7fa;\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);\n color: rgba(23, 24, 28, 0.78);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", Arial, sans-serif;\n font-size: 12px;\n line-height: 1;\n user-select: none;\n}\n\n.sear-sheet-bottom-bar button {\n border: 0;\n appearance: none;\n font: inherit;\n color: inherit;\n}\n\n.sear-sheet-bottom-bar__tabs-panel,\n.sear-sheet-bottom-bar__status-panel {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.sear-sheet-bottom-bar__tabs-panel {\n gap: 8px;\n min-width: 0;\n flex: 1 1 auto;\n}\n\n.sear-sheet-bottom-bar__status-panel {\n gap: 6px;\n margin-left: auto;\n}\n\n.sear-sheet-bottom-bar__icon-button,\n.sear-sheet-bottom-bar__grid,\n.sear-sheet-bottom-bar__zoom-button,\n.sear-sheet-bottom-bar__add {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: transparent;\n cursor: default;\n}\n\n.sear-sheet-bottom-bar__icon-button {\n width: 22px;\n height: 22px;\n color: #79829a;\n}\n\n.sear-sheet-bottom-bar__add {\n width: 22px;\n height: 22px;\n color: #7a8297;\n}\n\n.sear-sheet-bottom-bar__tabs {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n overflow-x: auto;\n scrollbar-width: none;\n}\n\n.sear-sheet-bottom-bar__tabs::-webkit-scrollbar {\n display: none;\n}\n\n.sear-sheet-bottom-bar__tab {\n min-width: 74px;\n max-width: 160px;\n height: 28px;\n padding: 0 12px;\n border-radius: 6px;\n background: rgba(255, 255, 255, 0.66);\n box-shadow: 0 1px 2px rgba(23, 26, 29, 0.04);\n color: rgba(23, 24, 28, 0.72);\n font-size: 13px;\n font-weight: 500;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-top: 2px solid var(--sear-sheet-tab-color, transparent);\n}\n\n.sear-sheet-bottom-bar__tab--active {\n background: #fff;\n color: #256cfb;\n font-weight: 600;\n}\n\n.sear-sheet-bottom-bar__tab--drop-before {\n box-shadow: inset 3px 0 #256cfb;\n}\n\n.sear-sheet-bottom-bar__tab--drop-after {\n box-shadow: inset -3px 0 #256cfb;\n}\n\n.sear-sheet-bottom-bar__rename {\n min-width: 74px;\n max-width: 160px;\n width: 120px;\n height: 28px;\n padding: 0 8px;\n border: 1px solid #256cfb;\n border-radius: 4px;\n background: #fff;\n color: #17181c;\n font: inherit;\n user-select: text;\n}\n\n.sear-sheet-bottom-bar__context-menu {\n position: fixed;\n z-index: 10000;\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 150px;\n padding: 5px;\n border: 1px solid #d9dce2;\n border-radius: 6px;\n background: #fff;\n box-shadow: 0 5px 18px rgba(23, 26, 29, 0.14);\n color: #17181c;\n font-size: 13px;\n}\n\n.sear-sheet-bottom-bar__context-menu button {\n border: 0;\n border-radius: 4px;\n padding: 7px 10px;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n.sear-sheet-bottom-bar__context-menu button:hover,\n.sear-sheet-bottom-bar__context-menu button:focus-visible {\n background: #eef3ff;\n}\n\n.sear-sheet-bottom-bar__context-menu button:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n.sear-sheet-bottom-bar__context-menu span {\n padding: 7px 10px;\n line-height: 1.4;\n}\n\n.sear-sheet-bottom-bar__status {\n color: rgba(23, 24, 28, 0.48);\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n}\n\n.sear-sheet-bottom-bar__grid {\n width: 22px;\n height: 22px;\n color: #7182ac;\n}\n\n.sear-sheet-bottom-bar__grid[aria-pressed=\"true\"] {\n background: #e4e9f2;\n color: #374968;\n}\n\n.sear-sheet-bottom-bar__divider {\n width: 1px;\n height: 20px;\n margin: 0 4px 0 6px;\n background: rgba(23, 26, 29, 0.08);\n}\n\n.sear-sheet-bottom-bar__zoom-button {\n width: 22px;\n height: 22px;\n color: rgba(23, 24, 28, 0.86);\n}\n\n.sear-sheet-bottom-bar__zoom-value {\n min-width: 46px;\n color: rgba(23, 24, 28, 0.86);\n font-size: 13px;\n font-weight: 500;\n text-align: center;\n white-space: nowrap;\n}\n\n.sear-sheet-bottom-bar svg {\n display: block;\n flex: 0 0 14px;\n width: 14px;\n height: 14px;\n}\n\n.sear-sheet-bottom-bar button:hover {\n background: rgba(23, 26, 29, 0.05);\n border-radius: 5px;\n}\n\n.sear-sheet-bottom-bar button:disabled {\n cursor: default;\n opacity: 0.4;\n}\n\n.sear-sheet-bottom-bar button:disabled:hover {\n background: transparent;\n}\n\n.sear-sheet-bottom-bar__tab:hover {\n background: #fff;\n}\n\n.sear-sheet-bottom-bar__toast {\n position: fixed;\n bottom: 24px;\n left: 50%;\n z-index: 10000;\n padding: 9px 16px;\n border-radius: 6px;\n background: rgba(54, 55, 56, 0.96);\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n color: #fff;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n pointer-events: none;\n transform: translateX(-50%);\n}\n\n@media (max-width: 600px) {\n .sear-sheet-bottom-bar__tabs-panel {\n flex: 1 1 0;\n }\n\n .sear-sheet-bottom-bar__tabs {\n flex: 1 1 0;\n scrollbar-width: thin;\n touch-action: pan-x;\n }\n\n .sear-sheet-bottom-bar__tabs::-webkit-scrollbar {\n display: block;\n height: 4px;\n }\n\n .sear-sheet-bottom-bar__status-panel {\n flex: 0 0 auto;\n gap: 4px;\n margin-left: 4px;\n }\n\n .sear-sheet-bottom-bar__status {\n display: none;\n }\n}\n"CSS injected by SearWebBottomBar for the browser sheet bottom bar.
Web Sheet toolbar controls built on typed commands and observations.
ensureSheetToolbarCommands(commands: SheetCommandBus, core: SearCoreSheet): voidEnsures web toolbar hosts receive the official sheet command surface.
registerSheetToolbarCommands(commands: SheetCommandBus, core: SearCoreSheet): voidRegisters official sheet commands needed by web toolbar hosts.
Web implementations supplied by a Sheet host at its composition root.
readonly clipboard: typeof WebSheetClipboardreadonly createTextShaper: (context: RenderContext): WebTextShaperreadonly fileDownload: typeof WebFileDownloadreadonly userInteraction: typeof WebUserInteractionServicereadonly webServiceClient: typeof WebFetchServiceClientreadonly xmlDocumentParser: typeof WebXmlDocumentParserreadonly xmlXPathEngine: typeof WebXmlXPathEngineclass SearWebToolbar extends SearToolbarBrowser DOM toolbar implementation for the sheet editor.
SearWebToolbar(searCore: SearCoreSheet, platform: Platform, embeddedEditor: SheetEmbeddedEditor, clipboard: SheetClipboard, userInteraction: UserInteractionService, commands?: SheetCommandBus, history?: SheetHistoryStatusProvider, queries?: SheetQueryRegistry, observations?: ObservationRegistry, fileDownload?: FileDownload, sheetTextInput?: TextInput, formulaResults?: IFormulaResultProvider, keyboardRouter?: KeyboardRouter): SearWebToolbarConstructs the toolbar adapter for one sheet editor.
static readonly symbol: typeof symbolDI token for resolving the web toolbar adapter.
class WebFormulaBar extends SearFormulaBarWeb formula input surface backed by the Sheet editor's own edit session.
WebFormulaBar(platform: Platform, commands: SheetCommandBus, queries: SheetQueryRegistry, observations: ObservationRegistry, core: SearCoreSheet, sheetTextInput: TextInput, richResults?: IFormulaRichResultProvider): WebFormulaBarstatic readonly symbol: typeof symbolclass WebSheetClipboard extends SheetClipboardBrowser Clipboard API adapter; DOM events never cross this boundary.
read(): Promise<SheetClipboardPayload | null>write(payload: SheetClipboardPayload): Promise<void>class HeadlessToolbar extends SearToolbarToolbar implementation for hosts without a UI surface.
static readonly symbol: symbolDI token for resolving HeadlessToolbar.
Platform-neutral toolbar lifecycle contract.
static readonly symbol: symbolDI token for resolving SearToolbar.
type ConditionalRuleBounds = unknowntype ConditionalRuleListRow = unknownreadonly alignBottom: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.96 1142 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 1182)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 160 1150)\" d=\"M1.6 0L1.6 24Q1.6193 24.6707 1.1314 25.1314Q0.6707 25.6193 0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0ZM21.6 0L21.6 24Q21.6193 24.6707 21.1314 25.1314Q20.6707 25.6193 20 25.6Q19.3293 25.6193 18.8686 25.1314Q18.3807 24.6707 18.4 24L18.4 0Q18.3807 -0.6707 18.8686 -1.1314Q19.3293 -1.6193 20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0ZM11.6 10L11.6 24Q11.6193 24.6707 11.1314 25.1314Q10.6707 25.6193 10 25.6Q9.3293 25.6193 8.8686 25.1314Q8.3807 24.6707 8.4 24L8.4 10Q8.3807 9.3293 8.8686 8.8686Q9.3293 8.3807 10 8.4Q10.6707 8.3807 11.1314 8.8686Q11.6193 9.3293 11.6 10Z\"/></svg>"readonly alignCenter: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.19 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 1029)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM7 8.4L25 8.4Q25.6707 8.3807 26.1314 8.8686Q26.6193 9.3293 26.6 10Q26.6193 10.6707 26.1314 11.1314Q25.6707 11.6193 25 11.6L7 11.6Q6.3293 11.6193 5.8686 11.1314Q5.3807 10.6707 5.4 10Q5.3807 9.3293 5.8686 8.8686Q6.3293 8.3807 7 8.4ZM0 18.4L32 18.4Q32.6707 18.3807 33.1314 18.8686Q33.6193 19.3293 33.6 20Q33.6193 20.6707 33.1314 21.1314Q32.6707 21.6193 32 21.6L0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686Q-0.6707 18.3807 0 18.4ZM7 28.4L25 28.4Q25.6707 28.3807 26.1314 28.8686Q26.6193 29.3293 26.6 30Q26.6193 30.6707 26.1314 31.1314Q25.6707 31.6193 25 31.6L7 31.6Q6.3293 31.6193 5.8686 31.1314Q5.3807 30.6707 5.4 30Q5.3807 29.3293 5.8686 28.8686Q6.3293 28.3807 7 28.4Z\"/></svg>"readonly alignLeft: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.92 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 1029)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 8.4L18 8.4Q18.6707 8.3807 19.1314 8.8686Q19.6193 9.3293 19.6 10Q19.6193 10.6707 19.1314 11.1314Q18.6707 11.6193 18 11.6L0 11.6Q-0.6707 11.6193 -1.1314 11.1314Q-1.6193 10.6707 -1.6 10Q-1.6193 9.3293 -1.1314 8.8686Q-0.6707 8.3807 0 8.4ZM0 18.4L32 18.4Q32.6707 18.3807 33.1314 18.8686Q33.6193 19.3293 33.6 20Q33.6193 20.6707 33.1314 21.1314Q32.6707 21.6193 32 21.6L0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686Q-0.6707 18.3807 0 18.4ZM0 28.4L18 28.4Q18.6707 28.3807 19.1314 28.8686Q19.6193 29.3293 19.6 30Q19.6193 30.6707 19.1314 31.1314Q18.6707 31.6193 18 31.6L0 31.6Q-0.6707 31.6193 -1.1314 31.1314Q-1.6193 30.6707 -1.6 30Q-1.6193 29.3293 -1.1314 28.8686Q-0.6707 28.3807 0 28.4Z\"/></svg>"readonly alignMiddle: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1004.38 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1014 1043)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1020 1027)\" d=\"M1.6 0L1.6 10Q1.6193 10.6707 1.1314 11.1314Q0.6707 11.6193 0 11.6Q-0.6707 11.6193 -1.1314 11.1314Q-1.6193 10.6707 -1.6 10L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0ZM21.6 0L21.6 10Q21.6193 10.6707 21.1314 11.1314Q20.6707 11.6193 20 11.6Q19.3293 11.6193 18.8686 11.1314Q18.3807 10.6707 18.4 10L18.4 0Q18.3807 -0.6707 18.8686 -1.1314Q19.3293 -1.6193 20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0ZM1.6 22L1.6 32Q1.6193 32.6707 1.1314 33.1314Q0.6707 33.6193 0 33.6Q-0.6707 33.6193 -1.1314 33.1314Q-1.6193 32.6707 -1.6 32L-1.6 22Q-1.6193 21.3293 -1.1314 20.8686Q-0.6707 20.3807 0 20.4Q0.6707 20.3807 1.1314 20.8686Q1.6193 21.3293 1.6 22ZM21.6 22L21.6 32Q21.6193 32.6707 21.1314 33.1314Q20.6707 33.6193 20 33.6Q19.3293 33.6193 18.8686 33.1314Q18.3807 32.6707 18.4 32L18.4 22Q18.3807 21.3293 18.8686 20.8686Q19.3293 20.3807 20 20.4Q20.6707 20.3807 21.1314 20.8686Q21.6193 21.3293 21.6 22Z\"/></svg>"readonly alignRight: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"488.96 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 498 1029)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM14 8.4L32 8.4Q32.6707 8.3807 33.1314 8.8686Q33.6193 9.3293 33.6 10Q33.6193 10.6707 33.1314 11.1314Q32.6707 11.6193 32 11.6L14 11.6Q13.3293 11.6193 12.8686 11.1314Q12.3807 10.6707 12.4 10Q12.3807 9.3293 12.8686 8.8686Q13.3293 8.3807 14 8.4ZM0 18.4L32 18.4Q32.6707 18.3807 33.1314 18.8686Q33.6193 19.3293 33.6 20Q33.6193 20.6707 33.1314 21.1314Q32.6707 21.6193 32 21.6L0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686Q-0.6707 18.3807 0 18.4ZM14 28.4L32 28.4Q32.6707 28.3807 33.1314 28.8686Q33.6193 29.3293 33.6 30Q33.6193 30.6707 33.1314 31.1314Q32.6707 31.6193 32 31.6L14 31.6Q13.3293 31.6193 12.8686 31.1314Q12.3807 30.6707 12.4 30Q12.3807 29.3293 12.8686 28.8686Q13.3293 28.3807 14 28.4Z\"/></svg>"readonly alignTop: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.15 1019 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 842 1027)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 848 1035)\" d=\"M1.6 0L1.6 24Q1.6193 24.6707 1.1314 25.1314Q0.6707 25.6193 0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0ZM11.6 0L11.6 14Q11.6193 14.6707 11.1314 15.1314Q10.6707 15.6193 10 15.6Q9.3293 15.6193 8.8686 15.1314Q8.3807 14.6707 8.4 14L8.4 0Q8.3807 -0.6707 8.8686 -1.1314Q9.3293 -1.6193 10 -1.6Q10.6707 -1.6193 11.1314 -1.1314Q11.6193 -0.6707 11.6 0ZM21.6 0L21.6 24Q21.6193 24.6707 21.1314 25.1314Q20.6707 25.6193 20 25.6Q19.3293 25.6193 18.8686 25.1314Q18.3807 24.6707 18.4 24L18.4 0Q18.3807 -0.6707 18.8686 -1.1314Q19.3293 -1.6193 20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0Z\"/></svg>"readonly allBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.90 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 154 1704)\" width=\"32\" height=\"32\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 1704)\" d=\"M17.6 0L17.6 14.4L32 14.4Q32.6707 14.3807 33.1314 14.8686Q33.6193 15.3293 33.6 16Q33.6193 16.6707 33.1314 17.1314Q32.6707 17.6193 32 17.6L17.6 17.6L17.6 32Q17.6193 32.6707 17.1314 33.1314Q16.6707 33.6193 16 33.6Q15.3293 33.6193 14.8686 33.1314Q14.3807 32.6707 14.4 32L14.4 17.6L0 17.6Q-0.6707 17.6193 -1.1314 17.1314Q-1.6193 16.6707 -1.6 16Q-1.6193 15.3293 -1.1314 14.8686Q-0.6707 14.3807 0 14.4L14.4 14.4L14.4 0Q14.3807 -0.6707 14.8686 -1.1314Q15.3293 -1.6193 16 -1.6Q16.6707 -1.6193 17.1314 -1.1314Q17.6193 -0.6707 17.6 0Z\"/></svg>"readonly autoSum: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"661.94 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 675 2258)\" d=\"M22 1.6L3.2 1.6L13.28 15.04Q13.6087 15.4638 13.6 16Q13.6087 16.5362 13.28 16.96L3.2 30.4L22 30.4Q22.6707 30.3807 23.1314 30.8686Q23.6193 31.3293 23.6 32Q23.6193 32.6707 23.1314 33.1314Q22.6707 33.6193 22 33.6L0 33.6Q-0.2597 33.6005 -0.506 33.5179Q-0.7525 33.4363 -0.96 33.28Q-1.5082 32.893 -1.5839 32.2263Q-1.6979 31.565 -1.28 31.04L10 16L-1.28 0.96Q-1.4363 0.7525 -1.5179 0.506Q-1.6005 0.2597 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L22 -1.6Q22.6707 -1.6193 23.1314 -1.1314Q23.6193 -0.6707 23.6 0Q23.6193 0.6707 23.1314 1.1314Q22.6707 1.6193 22 1.6Z\"/></svg>"readonly bold: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.85 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 162 627)\" d=\"M-1.6 32L-1.6 16.1009Q-1.6015 16.0511 -1.6 16Q-1.6015 15.9489 -1.6 15.8991L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L10 -1.6Q13.9764 -1.6 16.7882 1.2118Q19.6 4.0236 19.6 8Q19.6 11.9764 16.7882 14.7882Q16.4999 15.0765 16.1994 15.3353Q17.5981 16.0217 18.7882 17.2118Q21.6 20.0235 21.6 24Q21.6 27.9765 18.7882 30.7882Q15.9765 33.6 12 33.6L0 33.6Q-0.6707 33.6193 -1.1314 33.1314Q-1.6193 32.6707 -1.6 32ZM10 14.4Q12.651 14.4 14.5255 12.5255Q16.4 10.651 16.4 8Q16.4 5.349 14.5255 3.4745Q12.651 1.6 10 1.6L1.6 1.6L1.6 14.4L10 14.4ZM1.6 30.4L12 30.4Q14.651 30.4 16.5255 28.5255Q18.4 26.651 18.4 24Q18.4 21.349 16.5255 19.4745Q14.651 17.6 12 17.6L1.6 17.6L1.6 30.4Z\"/></svg>"readonly clearFormat: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.04 2373 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324.657 2382.06)\" d=\"M0.0008 23.8634Q-1.6 22.2303 -1.6 19.9434Q-1.6 17.6566 0.0121 16.0121L16.0234 0.0008Q17.6566 -1.6 19.9434 -1.6Q22.2303 -1.6 23.8748 0.0121L33.6861 9.8234Q35.2869 11.4566 35.2869 13.7434Q35.2869 16.0303 33.6748 17.6748L18.2748 33.0748Q18.0504 33.3009 17.7557 33.4216Q17.4619 33.5446 17.1434 33.5434L10.3434 33.5434Q10.0249 33.5446 9.7311 33.4216Q9.4364 33.3009 9.2121 33.0748L0.0121 23.8748L0.0008 23.8634ZM11.0062 30.3434L16.4807 30.3434L31.4121 15.4121Q32.0869 14.7235 32.0869 13.7434Q32.0869 12.7633 31.4008 12.0634L21.6121 2.2748Q20.9235 1.6 19.9434 1.6Q18.9633 1.6 18.2634 2.2861L2.2748 18.2748Q1.6 18.9633 1.6 19.9434Q1.6 20.92 2.2811 21.6184L11.0062 30.3434Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 331 2398)\" d=\"M1.0966 -1.1651L18.0966 14.8349Q18.5982 15.2805 18.5993 15.9515Q18.6389 16.6214 18.1651 17.0966Q17.7195 17.5982 17.0485 17.5993Q16.3786 17.6389 15.9034 17.1651L-1.0966 1.1651Q-1.5982 0.7195 -1.5993 0.0485Q-1.6389 -0.6214 -1.1651 -1.0966Q-0.7195 -1.5982 -0.0485 -1.5993Q0.6214 -1.6389 1.0966 -1.1651Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 343 2414)\" d=\"M16 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L16 -1.6Q16.6707 -1.6193 17.1314 -1.1314Q17.6193 -0.6707 17.6 0Q17.6193 0.6707 17.1314 1.1314Q16.6707 1.6193 16 1.6Z\"/></svg>"readonly columnWidth: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.21 5573 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 498 5579)\" width=\"32\" height=\"28\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 514 5579)\" d=\"M1.6 0L1.6 28Q1.6193 28.6707 1.1314 29.1314Q0.6707 29.6193 0 29.6Q-0.6707 29.6193 -1.1314 29.1314Q-1.6193 28.6707 -1.6 28L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 502 5608)\" d=\"M6.1314 1.1314L3.8627 3.4L20.1373 3.4L17.8686 1.1314Q17.3807 0.6707 17.4 0Q17.3807 -0.6707 17.8686 -1.1314Q18.3293 -1.6193 19 -1.6Q19.6707 -1.6193 20.1314 -1.1314L25.1314 3.8686Q25.6193 4.3293 25.6 5Q25.6193 5.6707 25.1314 6.1314L20.1314 11.1314Q19.6707 11.6193 19 11.6Q18.3293 11.6193 17.8686 11.1314Q17.3807 10.6707 17.4 10Q17.3807 9.3293 17.8686 8.8686L20.1373 6.6L3.8627 6.6L6.1314 8.8686Q6.6193 9.3293 6.6 10Q6.6193 10.6707 6.1314 11.1314Q5.6707 11.6193 5 11.6Q4.3293 11.6193 3.8686 11.1314L-1.1314 6.1314Q-1.6193 5.6707 -1.6 5Q-1.6193 4.3293 -1.1314 3.8686L3.8686 -1.1314Q4.3293 -1.6193 5 -1.6Q5.6707 -1.6193 6.1314 -1.1314Q6.6193 -0.6707 6.6 0Q6.6193 0.6707 6.1314 1.1314Z\"/></svg>"readonly comment: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.96 2650 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 2659)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0L33.6 23Q33.6193 23.6707 33.1314 24.1314Q32.6707 24.6193 32 24.6L21.5612 24.6L11.9995 32.2494Q11.4878 32.6835 10.8233 32.5902Q10.1545 32.5353 9.7506 31.9995Q9.5798 31.7871 9.4902 31.5296Q9.3994 31.2726 9.4 31L9.4 24.6L0 24.6Q-0.6707 24.6193 -1.1314 24.1314Q-1.6193 23.6707 -1.6 23L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM1.6 21.4L11 21.4Q11.6707 21.3807 12.1314 21.8686Q12.6193 22.3293 12.6 23L12.6 27.671L20.0005 21.7506Q20.2129 21.5798 20.4704 21.4902Q20.7274 21.3994 21 21.4L30.4 21.4L30.4 1.6L1.6 1.6L1.6 21.4Z\"/></svg>"readonly conditionalFormatting: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.04 5696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" fill-opacity=\"0.42\" transform=\"matrix(1 0 0 1 496 5702)\" width=\"36\" height=\"12\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" fill-opacity=\"0.22\" transform=\"matrix(1 0 0 1 496 5714)\" width=\"36\" height=\"12\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" fill-opacity=\"0.08\" transform=\"matrix(1 0 0 1 496 5726)\" width=\"36\" height=\"12\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 5702)\" width=\"36\" height=\"36\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 496 5714)\" d=\"M0 -1.6L36 -1.6Q36.6707 -1.6193 37.1314 -1.1314Q37.6193 -0.6707 37.6 0Q37.6193 0.6707 37.1314 1.1314Q36.6707 1.6193 36 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 10.4L36 10.4Q36.6707 10.3807 37.1314 10.8686Q37.6193 11.3293 37.6 12Q37.6193 12.6707 37.1314 13.1314Q36.6707 13.6193 36 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4Z\"/></svg>"readonly copy: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"660.47 342 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 680 360)\" width=\"22\" height=\"22\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 672 352)\" d=\"M20 1.6L1.6 1.6L1.6 20Q1.6193 20.6707 1.1314 21.1314Q0.6707 21.6193 0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L20 -1.6Q20.6707 -1.6193 21.1314 -1.1314Q21.6193 -0.6707 21.6 0Q21.6193 0.6707 21.1314 1.1314Q20.6707 1.6193 20 1.6Z\"/></svg>"readonly currency: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"145.10 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 160 1427)\" d=\"M1.302 -0.93L10 11.2473L18.698 -0.93Q19.0722 -1.487 19.737 -1.5782Q20.3954 -1.7075 20.93 -1.302Q21.487 -0.9278 21.5782 -0.263Q21.7075 0.3954 21.302 0.93L11.6 14.5127L11.6 32Q11.6193 32.6707 11.1314 33.1314Q10.6707 33.6193 10 33.6Q9.3293 33.6193 8.8686 33.1314Q8.3807 32.6707 8.4 32L8.4 14.5127L-1.302 0.93Q-1.7075 0.3954 -1.5782 -0.263Q-1.487 -0.9278 -0.93 -1.302Q-0.3954 -1.7075 0.263 -1.5782Q0.9278 -1.487 1.302 -0.93Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 161 1448)\" d=\"M0 -1.6L18 -1.6Q18.6707 -1.6193 19.1314 -1.1314Q19.6193 -0.6707 19.6 0Q19.6193 0.6707 19.1314 1.1314Q18.6707 1.6193 18 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 4.4L18 4.4Q18.6707 4.3807 19.1314 4.8686Q19.6193 5.3293 19.6 6Q19.6193 6.6707 19.1314 7.1314Q18.6707 7.6193 18 7.6L0 7.6Q-0.6707 7.6193 -1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686Q-0.6707 4.3807 0 4.4Z\"/></svg>"readonly cut: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"488.87 342 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 349)\" cx=\"5\" cy=\"5\" r=\"5\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 373)\" cx=\"5\" cy=\"5\" r=\"5\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 505 357)\" d=\"M1.1314 -1.1314L26.1314 23.8686Q26.6193 24.3293 26.6 25Q26.6193 25.6707 26.1314 26.1314Q25.6707 26.6193 25 26.6Q24.3293 26.6193 23.8686 26.1314L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 505 350)\" d=\"M26.1314 1.1314L1.1314 26.1314Q0.6707 26.6193 0 26.6Q-0.6707 26.6193 -1.1314 26.1314Q-1.6193 25.6707 -1.6 25Q-1.6193 24.3293 -1.1314 23.8686L23.8686 -1.1314Q24.3293 -1.6193 25 -1.6Q25.6707 -1.6193 26.1314 -1.1314Q26.6193 -0.6707 26.6 0Q26.6193 0.6707 26.1314 1.1314Z\"/></svg>"readonly dataValidation: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.03 4373 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 4379)\" width=\"24\" height=\"24\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 518 4399)\" d=\"M1.1314 5.8686L5.8428 10.5801L14.7318 -0.9755Q15.1255 -1.519 15.7931 -1.5866Q16.4557 -1.6925 16.9755 -1.2682Q17.5189 -0.8745 17.5866 -0.2069Q17.6925 0.4557 17.2682 0.9755L7.2682 13.9755Q7.2366 14.0167 7.2023 14.0557Q7.1681 14.0947 7.1314 14.1314Q6.6707 14.6193 6 14.6Q5.3293 14.6193 4.8686 14.1314L-1.1314 8.1314Q-1.6193 7.6707 -1.6 7Q-1.6193 6.3293 -1.1314 5.8686Q-0.6707 5.3807 0 5.4Q0.6707 5.3807 1.1314 5.8686Z\"/></svg>"readonly decimalMinus: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"832.90 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 843.8 1450.8)\" cx=\"3.2\" cy=\"3.2\" r=\"3.2\"/><ellipse xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 853.4 1428)\" cx=\"7.6\" cy=\"13\" rx=\"7.6\" ry=\"13\"/><g xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"#334155\" transform=\"matrix(1 0 0 1 871 1429)\" d=\"M0 -1.6L10 -1.6Q10.6707 -1.6193 11.1314 -1.1314Q11.6193 -0.6707 11.6 0Q11.6193 0.6707 11.1314 1.1314Q10.6707 1.6193 10 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></g></svg>"readonly decimalPlus: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"660.96 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 671.8 1450.8)\" cx=\"3.2\" cy=\"3.2\" r=\"3.2\"/><ellipse xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 681.4 1428)\" cx=\"7.6\" cy=\"13\" rx=\"7.6\" ry=\"13\"/><g xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"#334155\" transform=\"matrix(1 0 0 1 699 1424)\" d=\"M6.6 0L6.6 3.4L10 3.4Q10.6707 3.3807 11.1314 3.8686Q11.6193 4.3293 11.6 5Q11.6193 5.6707 11.1314 6.1314Q10.6707 6.6193 10 6.6L6.6 6.6L6.6 10Q6.6193 10.6707 6.1314 11.1314Q5.6707 11.6193 5 11.6Q4.3293 11.6193 3.8686 11.1314Q3.3807 10.6707 3.4 10L3.4 6.6L0 6.6Q-0.6707 6.6193 -1.1314 6.1314Q-1.6193 5.6707 -1.6 5Q-1.6193 4.3293 -1.1314 3.8686Q-0.6707 3.3807 0 3.4L3.4 3.4L3.4 0Q3.3807 -0.6707 3.8686 -1.1314Q4.3293 -1.6193 5 -1.6Q5.6707 -1.6193 6.1314 -1.1314Q6.6193 -0.6707 6.6 0Z\"/></g></svg>"readonly fillColor: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.97 742 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 321.657 748)\" d=\"M19.4748 -1.1314L35.4748 14.8686Q35.9627 15.3293 35.9434 16Q35.9627 16.6707 35.4748 17.1314L18.2748 34.3314Q16.6062 36 14.3434 36Q12.0807 36 10.4121 34.3314L0.0121 23.9314Q-1.6 22.2869 -1.6 20Q-1.6 17.7131 0.0008 16.08L17.2121 -1.1314Q17.6727 -1.6193 18.3434 -1.6Q19.0142 -1.6193 19.4748 -1.1314ZM2.2861 18.32Q1.6 19.0199 1.6 20Q1.6 20.9801 2.2748 21.6686L12.6748 32.0686Q13.4062 32.8 14.3434 32.8Q15.2807 32.8 16.0121 32.0686L32.0807 16L18.3434 2.2627L2.2861 18.32Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 328 746)\" d=\"M1.1314 -1.1314L11.1314 8.8686Q11.6193 9.3293 11.6 10Q11.6193 10.6707 11.1314 11.1314Q10.6707 11.6193 10 11.6Q9.3293 11.6193 8.8686 11.1314L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 322 768)\" d=\"M0 -1.6L30 -1.6Q30.6707 -1.6193 31.1314 -1.1314Q31.6193 -0.6707 31.6 0Q31.6193 0.6707 31.1314 1.1314Q30.6707 1.6193 30 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#0EA5E9\" transform=\"matrix(1 0 0 1 353 774.4)\" d=\"M8 7.6C8 8.7046 7.6095 9.6474 6.8284 10.4284C6.0474 11.2095 5.1046 11.6 4 11.6C2.8954 11.6 1.9526 11.2095 1.1716 10.4284C0.3905 9.6474 0 8.7046 0 7.6C0 4.6 3.2 3 4 0C4.8 3 8 4.6 8 7.6Z\"/></svg>"readonly filter: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.17 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 498 2258)\" d=\"M32 -1.6Q32.2933 -1.6009 32.5673 -1.4961Q32.8419 -1.3929 33.0609 -1.1977Q33.5758 -0.7675 33.5971 -0.0968Q33.6569 0.5715 33.1977 1.0609L21.2 14.6067L21.2 28Q21.2027 28.3938 21.0178 28.7415Q20.8377 29.0918 20.5126 29.3142L13.3126 34.3142Q13.1119 34.4541 12.8782 34.5269Q12.6447 34.6004 12.4 34.6Q11.7293 34.6193 11.2686 34.1314Q10.7807 33.6707 10.8 33L10.8 14.6067L-1.1977 1.0609Q-1.3929 0.8419 -1.4961 0.5673Q-1.6009 0.2933 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L32 -1.6ZM3.5545 1.6L13.5977 12.9391Q13.7929 13.1581 13.8961 13.4327Q14.0009 13.7067 14 14L14 29.9409L18 27.1631L18 14Q17.9991 13.7067 18.1039 13.4327Q18.2071 13.1581 18.4023 12.9391L28.4455 1.6L3.5545 1.6Z\"/></svg>"readonly find: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1005.11 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 1014 2258)\" cx=\"13\" cy=\"13\" r=\"13\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1037 2281)\" d=\"M1.1314 -1.1314L11.1314 8.8686Q11.6193 9.3293 11.6 10Q11.6193 10.6707 11.1314 11.1314Q10.6707 11.6193 10 11.6Q9.3293 11.6193 8.8686 11.1314L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/></svg>"readonly fontColor: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"145.46 742 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#0EA5E9\" transform=\"matrix(1 0 0 1 154 781)\" width=\"32\" height=\"7\" rx=\"3.5\" ry=\"3.5\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 157 748)\" d=\"M11.5488 -0.6738Q11.8137 -1.2903 12.4503 -1.5026Q13.0735 -1.7512 13.6738 -1.4512Q13.9314 -1.3325 14.1314 -1.1314Q14.3325 -0.9314 14.4512 -0.6738L21.4766 14.4577Q21.8447 14.5649 22.1314 14.8686Q22.6193 15.3293 22.6 16Q22.6099 16.344 22.4864 16.6327L27.4512 27.3262Q27.7512 27.9265 27.5026 28.5497Q27.2903 29.1863 26.6738 29.4512Q26.0735 29.7512 25.4503 29.5026Q24.8137 29.2903 24.5488 28.6738L19.4074 17.6L6.5926 17.6L1.4512 28.6738Q1.1863 29.2903 0.5497 29.5026Q-0.0735 29.7512 -0.6738 29.4512Q-1.2903 29.1863 -1.5026 28.5497Q-1.7512 27.9265 -1.4512 27.3262L3.5136 16.6327Q3.3901 16.344 3.4 16Q3.3807 15.3293 3.8686 14.8686Q4.1553 14.5649 4.5234 14.4577L11.5488 -0.6738ZM17.9217 14.4L13 3.7995L8.0783 14.4L17.9217 14.4Z\"/></svg>"readonly formatPainter: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1004.29 342 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 1012 350)\" width=\"28\" height=\"12\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1028 356)\" d=\"M12 -1.6L19 -1.6Q19.6707 -1.6193 20.1314 -1.1314Q20.6193 -0.6707 20.6 0L20.6 11Q20.6193 11.6707 20.1314 12.1314Q19.6707 12.6193 19 12.6L1.6 12.6L1.6 16Q1.6193 16.6707 1.1314 17.1314Q0.6707 17.6193 0 17.6Q-0.6707 17.6193 -1.1314 17.1314Q-1.6193 16.6707 -1.6 16L-1.6 11Q-1.6193 10.3293 -1.1314 9.8686Q-0.6707 9.3807 0 9.4L17.4 9.4L17.4 1.6L12 1.6Q11.3293 1.6193 10.8686 1.1314Q10.3807 0.6707 10.4 0Q10.3807 -0.6707 10.8686 -1.1314Q11.3293 -1.6193 12 -1.6Z\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 1024 372)\" width=\"8\" height=\"12\" rx=\"4\" ry=\"4\"/></svg>"readonly formula: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.84 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 852 2257)\" d=\"M9 1.6Q5.2929 1.6 3.4086 3.5784Q1.6 5.4775 1.6 9L1.6 33Q1.6193 33.6707 1.1314 34.1314Q0.6707 34.6193 0 34.6Q-0.6707 34.6193 -1.1314 34.1314Q-1.6193 33.6707 -1.6 33L-1.6 9Q-1.6 4.1975 1.0914 1.3716Q3.9214 -1.6 9 -1.6Q9.6707 -1.6193 10.1314 -1.1314Q10.6193 -0.6707 10.6 0Q10.6193 0.6707 10.1314 1.1314Q9.6707 1.6193 9 1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 846 2271)\" d=\"M0 -1.6L14 -1.6Q14.6707 -1.6193 15.1314 -1.1314Q15.6193 -0.6707 15.6 0Q15.6193 0.6707 15.1314 1.1314Q14.6707 1.6193 14 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 862 2275)\" d=\"M13.2494 0.9995L8.049 7.5L13.2494 14.0005Q13.6835 14.5122 13.5902 15.1767Q13.5353 15.8455 12.9995 16.2494Q12.4878 16.6835 11.8233 16.5902Q11.1545 16.5353 10.7506 15.9995L6 10.0612L1.2494 15.9995Q0.8455 16.5353 0.1767 16.5902Q-0.4878 16.6835 -0.9995 16.2494Q-1.5353 15.8455 -1.5902 15.1767Q-1.6835 14.5122 -1.2494 14.0005L3.951 7.5L-1.2494 0.9995Q-1.6835 0.4878 -1.5902 -0.1767Q-1.5353 -0.8455 -0.9995 -1.2494Q-0.4878 -1.6835 0.1767 -1.5902Q0.8455 -1.5353 1.2494 -0.9995L6 4.9388L10.7506 -0.9995Q11.1545 -1.5353 11.8233 -1.5902Q12.4878 -1.6835 12.9995 -1.2494Q13.5353 -0.8455 13.5902 -0.1767Q13.6835 0.4878 13.2494 0.9995Z\"/></svg>"readonly freeze: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.24 1973 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#0EA5E9\" fill-opacity=\"0.18\" transform=\"matrix(1 0 0 1 840 1979)\" width=\"36\" height=\"13\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 840 1979)\" width=\"36\" height=\"36\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 840 1992)\" d=\"M0 -1.6L12.8991 -1.6Q12.9489 -1.6015 13 -1.6Q13.0511 -1.6015 13.1009 -1.6L36 -1.6Q36.6707 -1.6193 37.1314 -1.1314Q37.6193 -0.6707 37.6 0Q37.6193 0.6707 37.1314 1.1314Q36.6707 1.6193 36 1.6L14.6 1.6L14.6 23Q14.6193 23.6707 14.1314 24.1314Q13.6707 24.6193 13 24.6Q12.3293 24.6193 11.8686 24.1314Q11.3807 23.6707 11.4 23L11.4 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"readonly gridlines: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.73 5050 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 841 5057)\" d=\"M34 -1.6Q34.6707 -1.6193 35.1314 -1.1314Q35.6193 -0.6707 35.6 0L35.6 34Q35.6193 34.6707 35.1314 35.1314Q34.6707 35.6193 34 35.6L0 35.6Q-0.6707 35.6193 -1.1314 35.1314Q-1.6193 34.6707 -1.6 34L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6L34 -1.6ZM1.6 1.6L1.6 32.4L32.4 32.4L32.4 1.6L1.6 1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 841 5057)\" d=\"M12.5 0L12.5 10.3L21.5 10.3L21.5 0Q21.4867 -0.4611 21.8222 -0.7778Q22.1389 -1.1133 22.6 -1.1Q23.0611 -1.1133 23.3778 -0.7778Q23.7133 -0.4611 23.7 0L23.7 10.3L34 10.3Q34.4611 10.2867 34.7778 10.6222Q35.1133 10.9389 35.1 11.4Q35.1133 11.8611 34.7778 12.1778Q34.4611 12.5133 34 12.5L23.7 12.5L23.7 21.5L34 21.5Q34.4611 21.4867 34.7778 21.8222Q35.1133 22.1389 35.1 22.6Q35.1133 23.0611 34.7778 23.3778Q34.4611 23.7133 34 23.7L23.7 23.7L23.7 34Q23.7133 34.4611 23.3778 34.7778Q23.0611 35.1133 22.6 35.1Q22.1389 35.1133 21.8222 34.7778Q21.4867 34.4611 21.5 34L21.5 23.7L12.5 23.7L12.5 34Q12.5133 34.4611 12.1778 34.7778Q11.8611 35.1133 11.4 35.1Q10.9389 35.1133 10.6222 34.7778Q10.2867 34.4611 10.3 34L10.3 23.7L0 23.7Q-0.4611 23.7133 -0.7778 23.3778Q-1.1133 23.0611 -1.1 22.6Q-1.1133 22.1389 -0.7778 21.8222Q-0.4611 21.4867 0 21.5L10.3 21.5L10.3 12.5L0 12.5Q-0.4611 12.5133 -0.7778 12.1778Q-1.1133 11.8611 -1.1 11.4Q-1.1133 10.9389 -0.7778 10.6222Q-0.4611 10.2867 0 10.3L10.3 10.3L10.3 0Q10.2867 -0.4611 10.6222 -0.7778Q10.9389 -1.1133 11.4 -1.1Q11.8611 -1.1133 12.1778 -0.7778Q12.5133 -0.4611 12.5 0ZM12.5 21.5L21.5 21.5L21.5 12.5L12.5 12.5L12.5 21.5Z\"/></svg>"readonly image: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"488.17 2650 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 497 2657)\" width=\"34\" height=\"34\" rx=\"4\" ry=\"4\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 504.4 2664.4)\" cx=\"3.6\" cy=\"3.6\" r=\"3.6\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 501 2670)\" d=\"M28.8686 12.1314L19.058 2.3207L1.1865 22.0735Q0.7508 22.5838 0.0799 22.598Q-0.589 22.6508 -1.0735 22.1865Q-1.5838 21.7508 -1.598 21.0799Q-1.6508 20.411 -1.1865 19.9265L17.8135 -1.0735Q17.827 -1.0883 17.8407 -1.1028Q17.8545 -1.1172 17.8686 -1.1314Q18.3293 -1.6193 19 -1.6Q19.6707 -1.6193 20.1314 -1.1314L31.1314 9.8686Q31.6193 10.3293 31.6 11Q31.6193 11.6707 31.1314 12.1314Q30.6707 12.6193 30 12.6Q29.3293 12.6193 28.8686 12.1314Z\"/></svg>"readonly indentDecrease: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"1005.03 5696 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1014 5706)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM10 8.4L32 8.4Q32.6707 8.3807 33.1314 8.8686Q33.6193 9.3293 33.6 10Q33.6193 10.6707 33.1314 11.1314Q32.6707 11.6193 32 11.6L10 11.6Q9.3293 11.6193 8.8686 11.1314Q8.3807 10.6707 8.4 10Q8.3807 9.3293 8.8686 8.8686Q9.3293 8.3807 10 8.4ZM10 16.4L32 16.4Q32.6707 16.3807 33.1314 16.8686Q33.6193 17.3293 33.6 18Q33.6193 18.6707 33.1314 19.1314Q32.6707 19.6193 32 19.6L10 19.6Q9.3293 19.6193 8.8686 19.1314Q8.3807 18.6707 8.4 18Q8.3807 17.3293 8.8686 16.8686Q9.3293 16.3807 10 16.4ZM0 26.4L32 26.4Q32.6707 26.3807 33.1314 26.8686Q33.6193 27.3293 33.6 28Q33.6193 28.6707 33.1314 29.1314Q32.6707 29.6193 32 29.6L0 29.6Q-0.6707 29.6193 -1.1314 29.1314Q-1.6193 28.6707 -1.6 28Q-1.6193 27.3293 -1.1314 26.8686Q-0.6707 26.3807 0 26.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 1015 5717)\" d=\"M5 0L0 3L5 6L5 0Z\"/></svg>"readonly indentIncrease: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"833.08 5696 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 842 5706)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM10 8.4L32 8.4Q32.6707 8.3807 33.1314 8.8686Q33.6193 9.3293 33.6 10Q33.6193 10.6707 33.1314 11.1314Q32.6707 11.6193 32 11.6L10 11.6Q9.3293 11.6193 8.8686 11.1314Q8.3807 10.6707 8.4 10Q8.3807 9.3293 8.8686 8.8686Q9.3293 8.3807 10 8.4ZM10 16.4L32 16.4Q32.6707 16.3807 33.1314 16.8686Q33.6193 17.3293 33.6 18Q33.6193 18.6707 33.1314 19.1314Q32.6707 19.6193 32 19.6L10 19.6Q9.3293 19.6193 8.8686 19.1314Q8.3807 18.6707 8.4 18Q8.3807 17.3293 8.8686 16.8686Q9.3293 16.3807 10 16.4ZM0 26.4L32 26.4Q32.6707 26.3807 33.1314 26.8686Q33.6193 27.3293 33.6 28Q33.6193 28.6707 33.1314 29.1314Q32.6707 29.6193 32 29.6L0 29.6Q-0.6707 29.6193 -1.1314 29.1314Q-1.6193 28.6707 -1.6 28Q-1.6193 27.3293 -1.1314 26.8686Q-0.6707 26.3807 0 26.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 843 5717)\" d=\"M0 0L5 3L0 6L0 0Z\"/></svg>"readonly italic: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.97 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 330 627)\" d=\"M24 -1.6Q24.6707 -1.6193 25.1314 -1.1314Q25.6193 -0.6707 25.6 0Q25.6193 0.6707 25.1314 1.1314Q24.6707 1.6193 24 1.6L19.1088 1.6L8.3088 30.4L16 30.4Q16.6707 30.3807 17.1314 30.8686Q17.6193 31.3293 17.6 32Q17.6193 32.6707 17.1314 33.1314Q16.6707 33.6193 16 33.6L6.2127 33.6Q6.009 33.6306 5.8032 33.6L0 33.6Q-0.6707 33.6193 -1.1314 33.1314Q-1.6193 32.6707 -1.6 32Q-1.6193 31.3293 -1.1314 30.8686Q-0.6707 30.3807 0 30.4L4.8912 30.4L15.6912 1.6L8 1.6Q7.3293 1.6193 6.8686 1.1314Q6.3807 0.6707 6.4 0Q6.3807 -0.6707 6.8686 -1.1314Q7.3293 -1.6193 8 -1.6L17.7873 -1.6Q17.991 -1.6306 18.1968 -1.6L24 -1.6Z\"/></svg>"readonly link: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.87 2650 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 165 2669)\" d=\"M-1.1314 8.8686L8.8686 -1.1314Q9.3293 -1.6193 10 -1.6Q10.6707 -1.6193 11.1314 -1.1314Q11.6193 -0.6707 11.6 0Q11.6193 0.6707 11.1314 1.1314L1.1314 11.1314Q0.6707 11.6193 0 11.6Q-0.6707 11.6193 -1.1314 11.1314Q-1.6193 10.6707 -1.6 10Q-1.6193 9.3293 -1.1314 8.8686Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 167 2658.11)\" d=\"M-1.1314 5.7539L3.2686 1.3539Q6.2225 -1.6 10.4 -1.6Q14.5775 -1.6 17.5314 1.3539Q20.4853 4.3078 20.4853 8.4853Q20.4853 12.6627 17.5314 15.6167L13.1314 20.0167Q12.6707 20.5046 12 20.4853Q11.3293 20.5046 10.8686 20.0167Q10.3807 19.556 10.4 18.8853Q10.3807 18.2145 10.8686 17.7539L15.2686 13.3539Q17.2853 11.3373 17.2853 8.4853Q17.2853 5.6333 15.2686 3.6167Q13.252 1.6 10.4 1.6Q7.548 1.6 5.5314 3.6167L1.1314 8.0167Q0.6707 8.5046 0 8.4853Q-0.6707 8.5046 -1.1314 8.0167Q-1.6193 7.556 -1.6 6.8853Q-1.6193 6.2145 -1.1314 5.7539Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154.115 2671)\" d=\"M20.0167 13.1314L15.6167 17.5314Q12.6627 20.4853 8.4853 20.4853Q4.3078 20.4853 1.3539 17.5314Q-1.6 14.5775 -1.6 10.4Q-1.6 6.2225 1.3539 3.2686L5.7539 -1.1314Q6.2145 -1.6193 6.8853 -1.6Q7.556 -1.6193 8.0167 -1.1314Q8.5046 -0.6707 8.4853 0Q8.5046 0.6707 8.0167 1.1314L3.6167 5.5314Q1.6 7.548 1.6 10.4Q1.6 13.252 3.6167 15.2686Q5.6333 17.2853 8.4853 17.2853Q11.3373 17.2853 13.3539 15.2686L17.7539 10.8686Q18.2145 10.3807 18.8853 10.4Q19.556 10.3807 20.0167 10.8686Q20.5046 11.3293 20.4853 12Q20.5046 12.6707 20.0167 13.1314Z\"/></svg>"readonly mergeCells: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.25 1142 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 497 1149)\" width=\"34\" height=\"34\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 497 1149)\" d=\"M18.6 0L18.6 15.4L34 15.4Q34.6707 15.3807 35.1314 15.8686Q35.6193 16.3293 35.6 17Q35.6193 17.6707 35.1314 18.1314Q34.6707 18.6193 34 18.6L17.1009 18.6Q17.0511 18.6015 17 18.6Q16.9489 18.6015 16.8991 18.6L0 18.6Q-0.6707 18.6193 -1.1314 18.1314Q-1.6193 17.6707 -1.6 17Q-1.6193 16.3293 -1.1314 15.8686Q-0.6707 15.3807 0 15.4L15.4 15.4L15.4 0Q15.3807 -0.6707 15.8686 -1.1314Q16.3293 -1.6193 17 -1.6Q17.6707 -1.6193 18.1314 -1.1314Q18.6193 -0.6707 18.6 0Z\"/></svg>"readonly noBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.04 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 498 1704)\" width=\"32\" height=\"32\" rx=\"4\" ry=\"4\"/></svg>"readonly outerBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.03 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 326 1704)\" width=\"32\" height=\"32\" rx=\"4\" ry=\"4\"/></svg>"readonly paste: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"832.83 342 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 842 350)\" width=\"32\" height=\"34\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"#FFF\" transform=\"matrix(1 0 0 1 851 346)\" width=\"14\" height=\"8\" rx=\"4\" ry=\"4\"/><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 851 346)\" width=\"14\" height=\"8\" rx=\"4\" ry=\"4\"/></svg>"readonly percent: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.10 1419 50 50\" fill=\"none\" aria-hidden=\"true\"><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 326.4 1427.4)\" cx=\"5.6\" cy=\"5.6\" r=\"5.6\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 346.4 1447.4)\" cx=\"5.6\" cy=\"5.6\" r=\"5.6\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 327 1428)\" d=\"M31.1314 1.1314L1.1314 31.1314Q0.6707 31.6193 0 31.6Q-0.6707 31.6193 -1.1314 31.1314Q-1.6193 30.6707 -1.6 30Q-1.6193 29.3293 -1.1314 28.8686L28.8686 -1.1314Q29.3293 -1.6193 30 -1.6Q30.6707 -1.6193 31.1314 -1.1314Q31.6193 -0.6707 31.6 0Q31.6193 0.6707 31.1314 1.1314Z\"/></svg>"readonly pivotTable: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.18 3573 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 496 3579)\" width=\"36\" height=\"36\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 496 3579)\" d=\"M13.6 0L13.6 10.4L36 10.4Q36.6707 10.3807 37.1314 10.8686Q37.6193 11.3293 37.6 12Q37.6193 12.6707 37.1314 13.1314Q36.6707 13.6193 36 13.6L13.6 13.6L13.6 22.4L36 22.4Q36.6707 22.3807 37.1314 22.8686Q37.6193 23.3293 37.6 24Q37.6193 24.6707 37.1314 25.1314Q36.6707 25.6193 36 25.6L13.6 25.6L13.6 36Q13.6193 36.6707 13.1314 37.1314Q12.6707 37.6193 12 37.6Q11.3293 37.6193 10.8686 37.1314Q10.3807 36.6707 10.4 36L10.4 25.6L0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24Q-1.6193 23.3293 -1.1314 22.8686Q-0.6707 22.3807 0 22.4L10.4 22.4L10.4 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4L10.4 10.4L10.4 0Q10.3807 -0.6707 10.8686 -1.1314Q11.3293 -1.6193 12 -1.6Q12.6707 -1.6193 13.1314 -1.1314Q13.6193 -0.6707 13.6 0Z\"/><circle xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 520 3606)\" cx=\"3\" cy=\"3\" r=\"3\"/></svg>"readonly redo: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.34 342 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 350 352)\" d=\"M1.1314 -1.1314L11.1314 8.8686Q11.6193 9.3293 11.6 10Q11.6193 10.6707 11.1314 11.1314L1.1314 21.1314Q0.6707 21.6193 0 21.6Q-0.6707 21.6193 -1.1314 21.1314Q-1.6193 20.6707 -1.6 20Q-1.6193 19.3293 -1.1314 18.8686L7.7373 10L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 362)\" d=\"M34 1.6L12 1.6Q7.6922 1.6 4.6461 4.6461Q1.6 7.6922 1.6 12L1.6 14Q1.6193 14.6707 1.1314 15.1314Q0.6707 15.6193 0 15.6Q-0.6707 15.6193 -1.1314 15.1314Q-1.6193 14.6707 -1.6 14L-1.6 12Q-1.6 6.3667 2.3833 2.3833Q6.3667 -1.6 12 -1.6L34 -1.6Q34.6707 -1.6193 35.1314 -1.1314Q35.6193 -0.6707 35.6 0Q35.6193 0.6707 35.1314 1.1314Q34.6707 1.6193 34 1.6Z\"/></svg>"readonly removeDuplicates: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.04 4373 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 4383)\" d=\"M0 -1.6L32 -1.6Q32.6707 -1.6193 33.1314 -1.1314Q33.6193 -0.6707 33.6 0Q33.6193 0.6707 33.1314 1.1314Q32.6707 1.6193 32 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 7.4L32 7.4Q32.6707 7.3807 33.1314 7.8686Q33.6193 8.3293 33.6 9Q33.6193 9.6707 33.1314 10.1314Q32.6707 10.6193 32 10.6L0 10.6Q-0.6707 10.6193 -1.1314 10.1314Q-1.6193 9.6707 -1.6 9Q-1.6193 8.3293 -1.1314 7.8686Q-0.6707 7.3807 0 7.4ZM0 16.4L18 16.4Q18.6707 16.3807 19.1314 16.8686Q19.6193 17.3293 19.6 18Q19.6193 18.6707 19.1314 19.1314Q18.6707 19.6193 18 19.6L0 19.6Q-0.6707 19.6193 -1.1314 19.1314Q-1.6193 18.6707 -1.6 18Q-1.6193 17.3293 -1.1314 16.8686Q-0.6707 16.3807 0 16.4ZM0 25.4L18 25.4Q18.6707 25.3807 19.1314 25.8686Q19.6193 26.3293 19.6 27Q19.6193 27.6707 19.1314 28.1314Q18.6707 28.6193 18 28.6L0 28.6Q-0.6707 28.6193 -1.1314 28.1314Q-1.6193 27.6707 -1.6 27Q-1.6193 26.3293 -1.1314 25.8686Q-0.6707 25.3807 0 25.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 350 4405)\" d=\"M12.1314 1.1314L7.7627 5.5L12.1314 9.8686Q12.6193 10.3293 12.6 11Q12.6193 11.6707 12.1314 12.1314Q11.6707 12.6193 11 12.6Q10.3293 12.6193 9.8686 12.1314L5.5 7.7627L1.1314 12.1314Q0.6707 12.6193 0 12.6Q-0.6707 12.6193 -1.1314 12.1314Q-1.6193 11.6707 -1.6 11Q-1.6193 10.3293 -1.1314 9.8686L3.2373 5.5L-1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314L5.5 3.2373L9.8686 -1.1314Q10.3293 -1.6193 11 -1.6Q11.6707 -1.6193 12.1314 -1.1314Q12.6193 -0.6707 12.6 0Q12.6193 0.6707 12.1314 1.1314Z\"/></svg>"readonly replace: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"145.18 2373 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 2382)\" d=\"M24.1314 4.8686Q24.6193 5.3293 24.6 6Q24.6193 6.6707 24.1314 7.1314L18.1314 13.1314Q17.6707 13.6193 17 13.6Q16.3293 13.6193 15.8686 13.1314Q15.3807 12.6707 15.4 12Q15.3807 11.3293 15.8686 10.8686L19.1373 7.6L0 7.6Q-0.6707 7.6193 -1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686Q-0.6707 4.3807 0 4.4L19.1373 4.4L15.8686 1.1314Q15.3807 0.6707 15.4 0Q15.3807 -0.6707 15.8686 -1.1314Q16.3293 -1.6193 17 -1.6Q17.6707 -1.6193 18.1314 -1.1314L24.1314 4.8686Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 163 2400)\" d=\"M7.1314 1.1314L3.8627 4.4L23 4.4Q23.6707 4.3807 24.1314 4.8686Q24.6193 5.3293 24.6 6Q24.6193 6.6707 24.1314 7.1314Q23.6707 7.6193 23 7.6L3.8627 7.6L7.1314 10.8686Q7.6193 11.3293 7.6 12Q7.6193 12.6707 7.1314 13.1314Q6.6707 13.6193 6 13.6Q5.3293 13.6193 4.8686 13.1314L-1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686L4.8686 -1.1314Q5.3293 -1.6193 6 -1.6Q6.6707 -1.6193 7.1314 -1.1314Q7.6193 -0.6707 7.6 0Q7.6193 0.6707 7.1314 1.1314Z\"/></svg>"readonly rowHeight: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"316.48 5573 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"3.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 324 5581)\" width=\"28\" height=\"32\" rx=\"4\" ry=\"4\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324 5597)\" d=\"M0 -1.6L28 -1.6Q28.6707 -1.6193 29.1314 -1.1314Q29.6193 -0.6707 29.6 0Q29.6193 0.6707 29.1314 1.1314Q28.6707 1.6193 28 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 353 5585)\" d=\"M-1.1314 3.8686L3.8686 -1.1314Q4.3293 -1.6193 5 -1.6Q5.6707 -1.6193 6.1314 -1.1314L11.1314 3.8686Q11.6193 4.3293 11.6 5Q11.6193 5.6707 11.1314 6.1314Q10.6707 6.6193 10 6.6Q9.3293 6.6193 8.8686 6.1314L6.6 3.8627L6.6 20.1373L8.8686 17.8686Q9.3293 17.3807 10 17.4Q10.6707 17.3807 11.1314 17.8686Q11.6193 18.3293 11.6 19Q11.6193 19.6707 11.1314 20.1314L6.1314 25.1314Q5.6707 25.6193 5 25.6Q4.3293 25.6193 3.8686 25.1314L-1.1314 20.1314Q-1.6193 19.6707 -1.6 19Q-1.6193 18.3293 -1.1314 17.8686Q-0.6707 17.3807 0 17.4Q0.6707 17.3807 1.1314 17.8686L3.4 20.1373L3.4 3.8627L1.1314 6.1314Q0.6707 6.6193 0 6.6Q-0.6707 6.6193 -1.1314 6.1314Q-1.6193 5.6707 -1.6 5Q-1.6193 4.3293 -1.1314 3.8686Z\"/></svg>"readonly sortAscending: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.89 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 154 2258)\" d=\"M7.6 0L7.6 24.1373L10.8686 20.8686Q11.3293 20.3807 12 20.4Q12.6707 20.3807 13.1314 20.8686Q13.6193 21.3293 13.6 22Q13.6193 22.6707 13.1314 23.1314L7.1314 29.1314Q6.6707 29.6193 6 29.6Q5.3293 29.6193 4.8686 29.1314L-1.1314 23.1314Q-1.6193 22.6707 -1.6 22Q-1.6193 21.3293 -1.1314 20.8686Q-0.6707 20.3807 0 20.4Q0.6707 20.3807 1.1314 20.8686L4.4 24.1373L4.4 0Q4.3807 -0.6707 4.8686 -1.1314Q5.3293 -1.6193 6 -1.6Q6.6707 -1.6193 7.1314 -1.1314Q7.6193 -0.6707 7.6 0Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 173 2262)\" d=\"M0 -1.6L14 -1.6Q14.6707 -1.6193 15.1314 -1.1314Q15.6193 -0.6707 15.6 0Q15.6193 0.6707 15.1314 1.1314Q14.6707 1.6193 14 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 10.4L10 10.4Q10.6707 10.3807 11.1314 10.8686Q11.6193 11.3293 11.6 12Q11.6193 12.6707 11.1314 13.1314Q10.6707 13.6193 10 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4ZM0 22.4L6 22.4Q6.6707 22.3807 7.1314 22.8686Q7.6193 23.3293 7.6 24Q7.6193 24.6707 7.1314 25.1314Q6.6707 25.6193 6 25.6L0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24Q-1.6193 23.3293 -1.1314 22.8686Q-0.6707 22.3807 0 22.4Z\"/></svg>"readonly sortDescending: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"317.42 2250 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 326 2262)\" d=\"M4.8686 -1.1314Q5.3293 -1.6193 6 -1.6Q6.6707 -1.6193 7.1314 -1.1314L13.1314 4.8686Q13.6193 5.3293 13.6 6Q13.6193 6.6707 13.1314 7.1314Q12.6707 7.6193 12 7.6Q11.3293 7.6193 10.8686 7.1314L7.6 3.8627L7.6 28Q7.6193 28.6707 7.1314 29.1314Q6.6707 29.6193 6 29.6Q5.3293 29.6193 4.8686 29.1314Q4.3807 28.6707 4.4 28L4.4 3.8627L1.1314 7.1314Q0.6707 7.6193 0 7.6Q-0.6707 7.6193 -1.1314 7.1314Q-1.6193 6.6707 -1.6 6Q-1.6193 5.3293 -1.1314 4.8686L4.8686 -1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 345 2262)\" d=\"M0 -1.6L6 -1.6Q6.6707 -1.6193 7.1314 -1.1314Q7.6193 -0.6707 7.6 0Q7.6193 0.6707 7.1314 1.1314Q6.6707 1.6193 6 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM0 10.4L10 10.4Q10.6707 10.3807 11.1314 10.8686Q11.6193 11.3293 11.6 12Q11.6193 12.6707 11.1314 13.1314Q10.6707 13.6193 10 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4ZM0 22.4L14 22.4Q14.6707 22.3807 15.1314 22.8686Q15.6193 23.3293 15.6 24Q15.6193 24.6707 15.1314 25.1314Q14.6707 25.6193 14 25.6L0 25.6Q-0.6707 25.6193 -1.1314 25.1314Q-1.6193 24.6707 -1.6 24Q-1.6193 23.3293 -1.1314 22.8686Q-0.6707 22.3807 0 22.4Z\"/></svg>"readonly strikethrough: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"661.04 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 676 626)\" d=\"M18.7708 5.0243Q17.4644 3.4565 15.3581 2.5763Q13.022 1.6 10 1.6Q6.0389 1.6 3.7041 3.3344Q1.6 4.8974 1.6 7.4Q1.6 8.7882 3.7426 9.9533Q5.3897 10.849 10.0641 12.2489Q12.6734 13.0303 13.9243 13.471Q16.0837 14.2317 17.5091 15.0322Q21.6 17.3296 21.6 21Q21.6 23.0242 20.7003 24.7516Q19.8266 26.4291 18.2041 27.6344Q15.0196 30 10 30Q2.2506 30 -1.2292 25.8243Q-1.6734 25.3214 -1.5934 24.6551Q-1.5519 23.9854 -1.0243 23.5708Q-0.5214 23.1266 0.1449 23.2066Q0.8146 23.2481 1.2292 23.7757Q3.7494 26.8 10 26.8Q13.9611 26.8 16.2959 25.0656Q18.4 23.5026 18.4 21Q18.4 19.2026 15.9421 17.8223Q14.7587 17.1577 12.8611 16.4892Q11.6822 16.0739 9.1461 15.3144Q6.6878 14.5782 5.526 14.1739Q3.5248 13.4775 2.2138 12.7645Q-1.6 10.6905 -1.6 7.4Q-1.6 5.3758 -0.7003 3.6484Q0.1734 1.9709 1.7959 0.7656Q4.9804 -1.6 10 -1.6Q13.6637 -1.6 16.5919 -0.3763Q19.4211 0.8061 21.2292 2.9757Q21.6734 3.4786 21.5934 4.1449Q21.5519 4.8146 21.0243 5.2292Q20.5214 5.6734 19.8551 5.5934Q19.1854 5.5519 18.7708 5.0243Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 669 643)\" d=\"M0 -1.6L34 -1.6Q34.6707 -1.6193 35.1314 -1.1314Q35.6193 -0.6707 35.6 0Q35.6193 0.6707 35.1314 1.1314Q34.6707 1.6193 34 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"readonly thickOuterBorders: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"661.07 1696 50 50\" fill=\"none\" aria-hidden=\"true\"><rect xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" stroke=\"#334155\" stroke-width=\"5.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" transform=\"matrix(1 0 0 1 671 1705)\" width=\"30\" height=\"30\" rx=\"4\" ry=\"4\"/></svg>"readonly underline: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"489.27 619 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 502 627)\" d=\"M1.6 0L1.6 14Q1.6 18.3078 4.6461 21.3539Q7.6922 24.4 12 24.4Q16.3078 24.4 19.3539 21.3539Q22.4 18.3078 22.4 14L22.4 0Q22.3807 -0.6707 22.8686 -1.1314Q23.3293 -1.6193 24 -1.6Q24.6707 -1.6193 25.1314 -1.1314Q25.6193 -0.6707 25.6 0L25.6 14Q25.6 19.6333 21.6166 23.6167Q17.6333 27.6 12 27.6Q6.3667 27.6 2.3833 23.6166Q-1.6 19.6333 -1.6 14L-1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Q0.6707 -1.6193 1.1314 -1.1314Q1.6193 -0.6707 1.6 0Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 500 661)\" d=\"M0 -1.6L28 -1.6Q28.6707 -1.6193 29.1314 -1.1314Q29.6193 -0.6707 29.6 0Q29.6193 0.6707 29.1314 1.1314Q28.6707 1.6193 28 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"readonly undo: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"144.83 342 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 152 352)\" d=\"M11.1314 1.1314L2.2627 10L11.1314 18.8686Q11.6193 19.3293 11.6 20Q11.6193 20.6707 11.1314 21.1314Q10.6707 21.6193 10 21.6Q9.3293 21.6193 8.8686 21.1314L-1.1314 11.1314Q-1.6193 10.6707 -1.6 10Q-1.6193 9.3293 -1.1314 8.8686L8.8686 -1.1314Q9.3293 -1.6193 10 -1.6Q10.6707 -1.6193 11.1314 -1.1314Q11.6193 -0.6707 11.6 0Q11.6193 0.6707 11.1314 1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 152 362)\" d=\"M0 -1.6L22 -1.6Q27.6333 -1.6 31.6166 2.3833Q35.6 6.3667 35.6 12L35.6 14Q35.6193 14.6707 35.1314 15.1314Q34.6707 15.6193 34 15.6Q33.3293 15.6193 32.8686 15.1314Q32.3807 14.6707 32.4 14L32.4 12Q32.4 7.6922 29.3539 4.6461Q26.3078 1.6 22 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"readonly wrapText: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"318.67 1142 50 50\" fill=\"none\" aria-hidden=\"true\"><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324 1154)\" d=\"M0 -1.6L36 -1.6Q36.6707 -1.6193 37.1314 -1.1314Q37.6193 -0.6707 37.6 0Q37.6193 0.6707 37.1314 1.1314Q36.6707 1.6193 36 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6ZM28 10.4Q31.5622 10.4 34.0811 12.9189Q36.6 15.4378 36.6 19Q36.6 22.5622 34.0811 25.0811Q31.5622 27.6 28 27.6L21 27.6Q20.3293 27.6193 19.8686 27.1314Q19.3807 26.6707 19.4 26Q19.3807 25.3293 19.8686 24.8686Q20.3293 24.3807 21 24.4L28 24.4Q30.2367 24.4 31.8184 22.8184Q33.4 21.2367 33.4 19Q33.4 16.7633 31.8184 15.1816Q30.2368 13.6 28 13.6L0 13.6Q-0.6707 13.6193 -1.1314 13.1314Q-1.6193 12.6707 -1.6 12Q-1.6193 11.3293 -1.1314 10.8686Q-0.6707 10.3807 0 10.4L28 10.4Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 345 1175.6)\" d=\"M5.5314 1.1314L2.2627 4.4L5.5314 7.6686Q6.0193 8.1293 6 8.8Q6.0193 9.4707 5.5314 9.9314Q5.0707 10.4193 4.4 10.4Q3.7293 10.4193 3.2686 9.9314L-1.1314 5.5314Q-1.6193 5.0707 -1.6 4.4Q-1.6193 3.7293 -1.1314 3.2686L3.2686 -1.1314Q3.7293 -1.6193 4.4 -1.6Q5.0707 -1.6193 5.5314 -1.1314Q6.0193 -0.6707 6 0Q6.0193 0.6707 5.5314 1.1314Z\"/><path xmlns=\"http://www.w3.org/2000/svg\" fill=\"#334155\" transform=\"matrix(1 0 0 1 324 1180)\" d=\"M0 -1.6L12 -1.6Q12.6707 -1.6193 13.1314 -1.1314Q13.6193 -0.6707 13.6 0Q13.6193 0.6707 13.1314 1.1314Q12.6707 1.6193 12 1.6L0 1.6Q-0.6707 1.6193 -1.1314 1.1314Q-1.6193 0.6707 -1.6 0Q-1.6193 -0.6707 -1.1314 -1.1314Q-0.6707 -1.6193 0 -1.6Z\"/></svg>"TOOLBAR_CSS: "\n.sear-sheet-context-menu { position: fixed; z-index: 10020; min-width: 148px; padding: 4px; background: #fff; color: #222; border: 1px solid #dcdde5; border-radius: 6px; box-shadow: 0 8px 24px #0002; font: 13px sans-serif; }\n.sear-sheet-context-menu button { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 3px; background: transparent; color: inherit; text-align: left; cursor: pointer; }\n.sear-sheet-context-menu button:hover, .sear-sheet-context-menu button:focus-visible { background: #eef3ff; outline: 0; }\n.sear-cell-border-menu { position: fixed; z-index: 10000; display: flex; gap: 16px; box-sizing: border-box; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px; background: #fff; color: #222; border: 1px solid #dcdde5; border-radius: 8px; box-shadow: 0 8px 24px #0002; font: 14px sans-serif; }\n.sear-cell-border-presets { display: grid; grid-template-columns: repeat(3, 42px); gap: 4px; }\n.sear-cell-border-presets button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #303438; cursor: pointer; }\n.sear-cell-border-presets button:hover { background: #eef0f2; }\n.sear-cell-border-presets button svg { width: 28px; height: 28px; }\n.sear-cell-border-presets button:focus-visible { outline: 2px solid #386ef6; }\n.sear-cell-border-controls { width: 164px; display: flex; flex-direction: column; gap: 16px; }\n.sear-cell-border-controls label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.sear-cell-border-controls input { width: 114px; height: 32px; padding: 3px; border: 1px solid #dcdde5; border-radius: 4px; background: white; cursor: pointer; }\n.sear-cell-border-controls select { width: 114px; height: 32px; border: 1px solid #dcdde5; border-radius: 4px; background: white; color: #222; }\n.sear-cell-border-preview { display: grid; place-items: center; height: 32px; border-top: 1px solid #eef0f2; }\n@media (max-width: 360px) {\n .sear-cell-border-menu { flex-direction: column; box-sizing: border-box; width: calc(100vw - 16px); }\n .sear-cell-border-presets { grid-template-columns: repeat(5, 42px); }\n .sear-cell-border-controls { width: 100%; }\n}\n.sear-toolbar {\n --wd3-level-1: rgba(23, 24, 28, 0.94);\n --wd3-level-2: rgba(23, 24, 28, 0.62);\n --wd3-level-3: rgba(23, 24, 28, 0.4);\n --wd3-line: rgba(23, 26, 29, 0.08);\n --wd3-hover: rgba(23, 26, 29, 0.06);\n --wd3-active: rgba(63, 133, 255, 0.1);\n --wd3-blue: #256cfb;\n box-sizing: border-box;\n width: 100%;\n min-height: 80px;\n background: #fff;\n color: var(--wd3-level-1);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", Arial, sans-serif;\n font-size: 12px;\n user-select: none;\n overflow: hidden;\n}\n\n.sear-toolbar *,\n.sear-toolbar *::before,\n.sear-toolbar *::after {\n box-sizing: border-box;\n}\n\n.sear-toolbar .we-toolbar-wrapper {\n height: 80px;\n padding: 0;\n border-bottom: 1px solid var(--wd3-line);\n background: #fff;\n overflow: visible;\n}\n\n.sear-toolbar .style__LineWrap-wd3__sc-qvsygq-2 {\n display: flex;\n align-items: stretch;\n gap: 0;\n height: 80px;\n padding: 6px 8px 5px;\n overflow-x: auto;\n overflow-y: visible;\n white-space: nowrap;\n}\n\n.sear-toolbar .style__LineWrap-wd3__sc-qvsygq-2::-webkit-scrollbar {\n height: 3px;\n}\n\n.sear-toolbar .style__LineWrap-wd3__sc-qvsygq-2::-webkit-scrollbar-thumb {\n background: rgba(23, 26, 29, 0.18);\n border-radius: 2px;\n}\n\n.sear-toolbar .style__Group-wd3__sc-qvsygq-3,\n.sear-toolbar .wd3-toolbar-more {\n position: relative;\n display: flex;\n align-items: center;\n gap: 2px;\n min-width: max-content;\n padding: 0 8px;\n}\n\n.sear-toolbar .style__Group-wd3__sc-qvsygq-3::after,\n.sear-toolbar .wd3-toolbar-more::after {\n content: \"\";\n position: absolute;\n top: 8px;\n right: 0;\n width: 1px;\n height: 52px;\n background: var(--wd3-line);\n}\n\n.sear-toolbar .style__GroupRows-wd3__sc-qvsygq-4 {\n flex-direction: column;\n justify-content: center;\n gap: 4px;\n}\n\n.sear-toolbar .style__Row-wd3__sc-qvsygq-5 {\n display: flex;\n align-items: center;\n height: 28px;\n gap: 2px;\n}\n\n.sear-toolbar .style__ItemWrap-wd3__sc-qvsygq-6 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 24px;\n height: 28px;\n}\n\n.sear-toolbar .render-items__MeasureWrap-wd3__sc-1etwew8-0,\n.sear-toolbar .slot__TBItemSlotWrap-wd3__sc-1p9e5wr-0 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n\n.sear-toolbar button,\n.sear-toolbar .wd3-toolbar-item-select {\n border: 0;\n appearance: none;\n font: inherit;\n color: inherit;\n}\n\n.sear-toolbar .wd3-toolbar-item {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n background: transparent;\n color: var(--wd3-level-1);\n cursor: default;\n outline: none;\n}\n\n.sear-toolbar .wd3-toolbar-icon-button.small,\n.sear-toolbar .wd3-toolbar-icon-menu.small {\n width: 24px;\n height: 24px;\n}\n\n.sear-toolbar .wd3-toolbar-split-btn-host {\n width: 34px;\n height: 24px;\n}\n\n.sear-toolbar .wd3-toolbar-icon-button.large,\n.sear-toolbar .wd3-toolbar-icon-menu.large {\n min-width: 32px;\n height: 66px;\n padding: 4px 0 3px;\n flex-direction: column;\n}\n\n.sear-toolbar .wd3-toolbar-icon-menu.large {\n padding-left: 2px;\n padding-right: 2px;\n}\n\n.sear-toolbar .wd3-toolbar-item:not(.disabled):hover,\n.sear-toolbar .wd3-toolbar-item-select:hover,\n.sear-toolbar .wd3-icon-button:hover {\n background: var(--wd3-hover);\n}\n\n.sear-toolbar .wd3-toolbar-item:not(.disabled):active,\n.sear-toolbar .wd3-toolbar-item-select:active,\n.sear-toolbar .wd3-icon-button:active {\n background: var(--wd3-active);\n}\n\n.sear-toolbar .wd3-toolbar-item-active {\n background: var(--wd3-active);\n color: var(--wd3-blue);\n}\n\n.sear-toolbar .wd3-toolbar-item.disabled {\n color: var(--wd3-level-3);\n opacity: 0.38;\n}\n\n.sear-toolbar .styled__Content-wd3__sc-18mbnsa-2,\n.sear-toolbar .styled__IconWithArrowWrap-wd3__sc-1vmuis-1 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 20px;\n line-height: 0;\n}\n\n.sear-toolbar .wd3-toolbar-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n color: currentColor;\n}\n\n.sear-toolbar .small .wd3-toolbar-icon,\n.sear-toolbar .wd3-toolbar-split-left {\n width: 20px;\n height: 20px;\n}\n\n.sear-toolbar svg {\n display: block;\n flex: 0 0 auto;\n}\n\n.sear-toolbar .small .wd3-toolbar-icon > svg,\n.sear-toolbar .wd3-toolbar-split-left > svg {\n width: 16px;\n height: 16px;\n}\n\n.sear-toolbar .wd3-toolbar-title {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 28px;\n padding-top: 2px;\n color: var(--wd3-level-2);\n font-size: 11px;\n line-height: 14px;\n}\n\n.sear-toolbar .wd3-tb-title-content {\n max-width: 54px;\n overflow: hidden;\n text-align: center;\n text-overflow: ellipsis;\n white-space: normal;\n}\n\n.sear-toolbar .wd3-tb-title-content-nowrap {\n white-space: nowrap;\n}\n\n.sear-toolbar .wd3-select {\n position: relative;\n justify-content: space-between;\n height: 24px;\n min-width: 0;\n padding: 0 4px 0 8px;\n border: 1px solid transparent;\n border-radius: 4px;\n background: transparent;\n font-size: 12px;\n line-height: 22px;\n}\n\n.sear-toolbar .wd3-select-normal-value,\n.sear-toolbar .wd3-select-input-value {\n min-width: 0;\n overflow: hidden;\n color: var(--wd3-level-1);\n text-align: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-toolbar .wd3_select_arrow,\n.sear-toolbar .wd3-toolbar-split-btn-arrow {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 9px;\n margin-left: 3px;\n color: var(--wd3-level-3);\n}\n\n.sear-toolbar .wd3-toolbar-split-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 24px;\n overflow: visible;\n line-height: 0;\n}\n\n.sear-toolbar .wd3-toolbar-split-left {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n.sear-toolbar .style__Grow-wd3__sc-qvsygq-0 {\n flex: 1 1 auto;\n min-width: 16px;\n}\n\n.sear-toolbar .wd3-toolbar-mode-switch-wrap {\n position: relative;\n display: flex;\n align-items: center;\n height: 28px;\n align-self: center;\n}\n\n.sear-toolbar .wd3-icon-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border-radius: 6px;\n background: transparent;\n}\n\n.sear-toolbar-insert-popovers {\n position: fixed;\n inset: 0;\n z-index: 9999;\n pointer-events: none;\n}\n\n.sear-toolbar-popovers {\n position: fixed;\n inset: 0;\n z-index: 9999;\n pointer-events: none;\n}\n\n.sear-toolbar-insert-popover {\n position: fixed;\n pointer-events: auto;\n}\n\n.sear-toolbar-popover {\n position: fixed;\n pointer-events: auto;\n}\n\n.sear-toolbar-insert-popover .wd3-popover,\n.sear-toolbar-popover .wd3-popover {\n overflow: hidden;\n border: 1px solid rgba(23, 26, 29, 0.12);\n border-radius: 16px;\n background: #fff;\n box-shadow:\n 0 14px 38px rgba(23, 26, 29, 0.14),\n 0 2px 6px rgba(23, 26, 29, 0.08);\n}\n\n.sear-toolbar-insert-popover .wd3-menu,\n.sear-toolbar-popover .wd3-menu {\n display: flex;\n flex-direction: column;\n padding: 4px 10px 4px 6px;\n color: rgba(23, 24, 28, 0.82);\n font-size: 13px;\n font-weight: 400;\n line-height: 1;\n}\n.sear-toolbar-popover .wd3-menu { max-height: calc(100vh - 16px); overflow-y: auto; }\n\n.sear-toolbar-insert-popover .wd3-menu {\n width: 180px;\n}\n\n.sear-toolbar-insert-popover:nth-child(n + 2) .wd3-menu {\n width: 200px;\n}\n\n.sear-toolbar-insert-popover:nth-child(3) .wd3-menu {\n width: 202px;\n}\n\n.sear-toolbar-insert-popover .wd3-listitem,\n.sear-toolbar-popover .wd3-listitem {\n display: flex;\n align-items: center;\n min-height: 28px;\n border-radius: 6px;\n cursor: default;\n font-weight: 400;\n}\n\n.sear-toolbar-popover button.wd3-listitem {\n width: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n text-align: left;\n font: inherit;\n}\n\n.sear-toolbar-popover button[aria-disabled=\"true\"] {\n color: #8b9297;\n cursor: not-allowed;\n}\n\n.sear-toolbar-insert-popover .wd3-listitem:hover,\n.sear-toolbar-insert-popover .wd3-listitem-active,\n.sear-toolbar-popover .wd3-listitem:hover,\n.sear-toolbar-popover .wd3-listitem-active {\n background: rgba(23, 26, 29, 0.05);\n}\n\n.sear-toolbar-insert-popover .styled__Container-wd3__sc-2oqy5e-3,\n.sear-toolbar-popover .styled__Container-wd3__sc-2oqy5e-3 {\n display: flex;\n align-items: center;\n width: 100%;\n min-width: 0;\n}\n\n.sear-toolbar-insert-popover .styled__Prefix-wd3__sc-2oqy5e-4,\n.sear-toolbar-popover .styled__Prefix-wd3__sc-2oqy5e-4 {\n display: inline-flex;\n flex: 0 0 32px;\n align-items: center;\n justify-content: center;\n color: rgba(23, 24, 28, 0.78);\n}\n\n.sear-toolbar-popover .sear-toolbar-popover-prefix {\n flex-basis: 24px;\n}\n\n.sear-toolbar-insert-popover .styled__Prefix-wd3__sc-2oqy5e-4 svg,\n.sear-toolbar-popover .styled__Prefix-wd3__sc-2oqy5e-4 svg {\n width: 16px;\n height: 16px;\n}\n\n.sear-toolbar-insert-popover .styled__Content-wd3__sc-2oqy5e-6,\n.sear-toolbar-popover .styled__Content-wd3__sc-2oqy5e-6 {\n display: inline-flex;\n flex: 1 1 auto;\n align-items: center;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-toolbar-insert-popover .styled__Suffix-wd3__sc-2oqy5e-5,\n.sear-toolbar-popover .styled__Suffix-wd3__sc-2oqy5e-5 {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n justify-content: center;\n margin-left: 6px;\n color: rgba(23, 24, 28, 0.66);\n}\n\n.sear-toolbar-popover .styled__Suffix-wd3__sc-2oqy5e-5 {\n font-size: 11px;\n}\n\n.sear-toolbar-insert-popover .styled__SuffixWrapper-wd3__sc-1p5lith-0 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 10px;\n height: 16px;\n}\n\n.sear-toolbar-popover .styled__Suffix-wd3__sc-2oqy5e-5 svg,\n.sear-toolbar-insert-popover .styled__SuffixWrapper-wd3__sc-1p5lith-0 svg {\n width: 8px;\n height: 16px;\n}\n\n.sear-toolbar-insert-popover .styled__Divider-wd3__sc-2oqy5e-1,\n.sear-toolbar-popover .styled__Divider-wd3__sc-2oqy5e-1 {\n height: 1px;\n margin: 4px 0;\n background: rgba(23, 26, 29, 0.12);\n}\n\n.sear-toolbar-popover .wd3-listitem-selected {\n color: rgba(37, 108, 251, 0.95);\n}\n\n.sear-toolbar-color-menu {\n padding: 10px;\n color: rgba(23, 24, 28, 0.82);\n font-size: 13px;\n font-weight: 400;\n}\n\n.sear-toolbar-color-title {\n height: 22px;\n padding: 0 2px;\n color: rgba(23, 24, 28, 0.62);\n font-size: 12px;\n line-height: 22px;\n}\n\n.sear-toolbar-color-grid {\n display: grid;\n grid-template-columns: repeat(8, 20px);\n gap: 6px;\n margin-top: 4px;\n}\n\n.sear-toolbar-color-swatch {\n width: 20px;\n height: 20px;\n padding: 0;\n border: 1px solid rgba(23, 26, 29, 0.14);\n border-radius: 4px;\n box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);\n cursor: default;\n}\n\n.sear-toolbar-color-swatch:hover {\n border-color: rgba(37, 108, 251, 0.82);\n box-shadow:\n inset 0 0 0 1px rgba(255, 255, 255, 0.72),\n 0 0 0 2px rgba(37, 108, 251, 0.12);\n}\n\n.sear-toolbar-color-swatch-selected {\n outline: 2px solid #256cfb;\n outline-offset: 1px;\n}\n\n.sear-toolbar-color-swatch-default {\n position: relative;\n background: #fff;\n}\n\n.sear-toolbar-color-swatch-default::after {\n position: absolute;\n top: 9px;\n left: 1px;\n width: 18px;\n height: 1px;\n background: #fe0300;\n content: '';\n transform: rotate(-45deg);\n}\n\n.sear-toolbar-insert-popover .wd3-shortcuts {\n display: inline-flex;\n align-items: center;\n gap: 3px;\n}\n\n.sear-toolbar-insert-popover .wd3-shortcuts kbd {\n min-width: 19px;\n height: 19px;\n padding: 0 5px;\n border: 1px solid rgba(107, 114, 148, 0.24);\n border-radius: 4px;\n background: #fff;\n box-shadow: 0 1px 3px rgba(23, 26, 29, 0.12);\n color: rgba(107, 114, 148, 0.92);\n font: inherit;\n font-size: 10px;\n line-height: 17px;\n text-align: center;\n}\n\n.sear-toolbar-insert-popover .wd3-badge-new {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 16px;\n margin-left: 7px;\n padding: 0 5px;\n border-radius: 3px;\n background: #ffe9dc;\n color: #ff7a45;\n font-size: 9px;\n line-height: 16px;\n}\n\n.sear-number-format-dialog {\n width: min(920px, calc(100vw - 32px));\n height: min(680px, calc(100vh - 32px));\n padding: 0;\n overflow: hidden;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n\n.sear-delete-cells-dialog {\n width: min(360px, calc(100vw - 32px));\n padding: 24px;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-delete-cells-dialog::backdrop { background: rgba(24, 31, 42, 0.36); }\n.sear-delete-cells-dialog h2 { margin: 0 0 20px; font-size: 20px; }\n.sear-delete-cells-dialog fieldset { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; }\n.sear-delete-cells-dialog legend { margin-bottom: 12px; font-size: 13px; color: #5c6370; }\n.sear-delete-cells-dialog label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }\n.sear-delete-cells-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }\n.sear-delete-cells-dialog button { min-width: 72px; min-height: 32px; border: 1px solid #d9dde3; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-delete-cells-dialog button[data-action=\"apply\"] { border-color: #2665d8; background: #2665d8; color: #fff; }\n\n.sear-go-to-dialog {\n width: min(440px, calc(100vw - 32px));\n padding: 24px;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-go-to-dialog::backdrop { background: rgba(24, 31, 42, 0.36); }\n.sear-go-to-dialog h2 { margin: 0 0 20px; font-size: 20px; }\n.sear-go-to-dialog__address { display: grid; gap: 7px; margin-bottom: 20px; font-size: 13px; }\n.sear-go-to-dialog__address input { height: 34px; padding: 0 9px; border: 1px solid #cbd1da; border-radius: 4px; font: inherit; }\n.sear-go-to-dialog fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0; border: 0; }\n.sear-go-to-dialog legend { margin-bottom: 12px; font-size: 13px; color: #5c6370; }\n.sear-go-to-dialog fieldset label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }\n.sear-go-to-dialog__error { margin: 14px 0 0; color: #b42318; font-size: 13px; }\n.sear-go-to-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }\n.sear-go-to-dialog button { min-width: 72px; min-height: 32px; border: 1px solid #d9dde3; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-go-to-dialog button[type=\"submit\"] { border-color: #2665d8; background: #2665d8; color: #fff; }\n\n.sear-hyperlink-dialog {\n width: min(480px, calc(100vw - 32px));\n padding: 24px;\n border: 1px solid #d9dde3;\n border-radius: 8px;\n background: #fff;\n color: #20242a;\n box-shadow: 0 18px 56px rgba(24, 31, 42, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-hyperlink-dialog::backdrop { background: rgba(24, 31, 42, 0.36); }\n.sear-hyperlink-dialog h2 { margin: 0 0 20px; font-size: 20px; }\n.sear-hyperlink-dialog__tabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid #d9dde3; }\n.sear-hyperlink-dialog__tabs button { min-height: 36px; padding: 0 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #5c6370; font-size: 13px; cursor: pointer; }\n.sear-hyperlink-dialog__tabs button[aria-selected=\"true\"] { border-bottom-color: #2665d8; color: #20242a; }\n.sear-hyperlink-dialog label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 13px; }\n.sear-hyperlink-dialog input { height: 34px; padding: 0 9px; border: 1px solid #cbd1da; border-radius: 4px; font: inherit; }\n.sear-hyperlink-dialog__error { margin: 0 0 14px; color: #b42318; font-size: 13px; }\n.sear-hyperlink-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }\n.sear-hyperlink-dialog footer button { min-width: 72px; min-height: 32px; border: 1px solid #d9dde3; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-hyperlink-dialog footer button[type=\"submit\"] { border-color: #2665d8; background: #2665d8; color: #fff; }\n\n.sear-number-format-dialog::backdrop {\n background: rgba(24, 31, 42, 0.36);\n}\n\n.sear-number-format-dialog__tabs {\n display: flex;\n gap: 6px;\n padding: 0 24px;\n border-bottom: 1px solid #edf0f3;\n overflow-x: auto;\n}\n\n.sear-number-format-dialog__tabs button {\n min-width: 68px;\n min-height: 42px;\n padding: 0 10px;\n border: 0;\n border-bottom: 2px solid transparent;\n background: transparent;\n color: #5d6570;\n font: inherit;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__tabs button[aria-selected=\"true\"] {\n border-bottom-color: #256cfb;\n color: #20242a;\n}\n\n.sear-number-format-dialog.is-full .sear-number-format-dialog__body {\n height: calc(100% - 180px);\n}\n\n.sear-number-format-dialog__body[hidden],\n.sear-number-format-dialog__extra[hidden] { display: none; }\n\n.sear-number-format-dialog__extra {\n box-sizing: border-box;\n height: calc(100% - 180px);\n padding: 28px 32px;\n overflow-y: auto;\n align-content: start;\n}\n\n.sear-number-format-dialog__field {\n display: grid;\n max-width: 440px;\n gap: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n}\n\n.sear-number-format-dialog__field input,\n.sear-number-format-dialog__field select {\n box-sizing: border-box;\n width: 100%;\n min-height: 36px;\n padding: 6px 10px;\n border: 1px solid #cbd1d9;\n border-radius: 4px;\n background: #fff;\n color: #20242a;\n font: inherit;\n}\n\n.sear-number-format-dialog__field input[type=\"color\"] {\n width: 64px;\n padding: 3px;\n}\n\n.sear-number-format-dialog__check {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n cursor: pointer;\n}\n\n.sear-number-format-dialog > header,\n.sear-number-format-dialog > footer {\n display: flex;\n align-items: center;\n padding: 18px 24px;\n}\n\n.sear-number-format-dialog > header {\n justify-content: space-between;\n border-bottom: 1px solid #edf0f3;\n}\n\n.sear-number-format-dialog > header h2 {\n margin: 0;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: 0;\n}\n\n.sear-number-format-dialog__close {\n width: 32px;\n height: 32px;\n padding: 0;\n border: 0;\n background: transparent;\n color: #4f5660;\n font-size: 30px;\n font-weight: 300;\n line-height: 28px;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__body {\n display: grid;\n grid-template-columns: 190px minmax(0, 1fr);\n height: calc(100% - 137px);\n min-height: 0;\n padding: 18px 24px 0;\n gap: 28px;\n}\n\n.sear-number-format-dialog__categories {\n display: flex;\n min-height: 0;\n padding: 8px;\n overflow-y: auto;\n flex-direction: column;\n border: 1px solid #d9dde3;\n border-radius: 6px;\n}\n\n.sear-number-format-dialog__categories button {\n min-height: 38px;\n padding: 7px 12px;\n border: 0;\n border-radius: 5px;\n background: transparent;\n color: #2d333b;\n font: inherit;\n font-size: 15px;\n text-align: left;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__categories button:hover {\n background: #f2f4f7;\n}\n\n.sear-number-format-dialog__categories button.is-active {\n background: #e9f1ff;\n color: #256cfb;\n}\n\n.sear-number-format-dialog__panel {\n display: grid;\n min-width: 0;\n min-height: 0;\n overflow-y: auto;\n align-content: start;\n grid-template-columns: 1fr;\n gap: 10px;\n padding: 0 4px 16px 0;\n}\n\n.sear-number-format-dialog__panel > label,\n.sear-number-format-dialog__section-title {\n color: #5d6570;\n font-size: 13px;\n font-weight: 500;\n}\n\n.sear-number-format-dialog__preview {\n display: flex;\n min-height: 54px;\n align-items: center;\n padding: 0 16px;\n overflow: hidden;\n border: 1px solid #d6dae0;\n border-radius: 6px;\n background: #f7f8fa;\n color: #20242a;\n font-size: 22px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-number-format-dialog__section-title {\n margin-top: 8px;\n}\n\n.sear-number-format-dialog__presets {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 8px;\n}\n\n.sear-number-format-dialog__preset {\n display: grid;\n min-width: 0;\n min-height: 54px;\n padding: 8px 10px;\n border: 1px solid #d9dde3;\n border-radius: 6px;\n background: #fff;\n color: #282e36;\n text-align: left;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__preset:hover {\n border-color: #9dbdff;\n background: #f7faff;\n}\n\n.sear-number-format-dialog__preset.is-active {\n border-color: #256cfb;\n background: #edf4ff;\n box-shadow: inset 0 0 0 1px #256cfb;\n}\n\n.sear-number-format-dialog__preset span {\n overflow: hidden;\n font-size: 14px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-number-format-dialog__preset code {\n overflow: hidden;\n color: #69717d;\n font-size: 12px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.sear-number-format-dialog__custom {\n box-sizing: border-box;\n width: 100%;\n height: 38px;\n padding: 7px 10px;\n border: 1px solid #cbd1d9;\n border-radius: 5px;\n color: #20242a;\n font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;\n}\n\n.sear-number-format-dialog__custom[aria-invalid=\"true\"] {\n border-color: #cb3636;\n}\n\n.sear-number-format-dialog__error:not(:empty) {\n color: #b42318;\n font-size: 12px;\n}\n\n.sear-number-format-dialog__button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.sear-number-format-dialog > footer {\n justify-content: flex-end;\n gap: 10px;\n border-top: 1px solid #edf0f3;\n}\n\n.sear-number-format-dialog__button {\n min-width: 82px;\n min-height: 38px;\n padding: 7px 18px;\n border: 1px solid #cbd1d9;\n border-radius: 5px;\n background: #fff;\n color: #2d333b;\n font: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n.sear-number-format-dialog__button.is-primary {\n border-color: #256cfb;\n background: #256cfb;\n color: #fff;\n}\n\n@media (max-width: 680px) {\n .sear-number-format-dialog__body {\n grid-template-columns: 126px minmax(0, 1fr);\n gap: 12px;\n padding-inline: 12px;\n }\n\n .sear-number-format-dialog__presets {\n grid-template-columns: 1fr;\n }\n\n .sear-number-format-dialog__preset code {\n overflow: visible;\n overflow-wrap: anywhere;\n text-overflow: clip;\n white-space: normal;\n }\n}\n\n.sear-toolbar__toast {\n position: fixed;\n bottom: 24px;\n left: 50%;\n z-index: 10000;\n padding: 9px 16px;\n border-radius: 6px;\n background: rgba(54, 55, 56, 0.96);\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n color: #fff;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n font-size: 13px;\n line-height: 18px;\n pointer-events: none;\n transform: translateX(-50%);\n}\n\n.sear-toolbar-duplicate-dialog {\n position: fixed;\n inset: 0;\n z-index: 9999;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(12, 16, 24, 0.18);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n\n.sear-toolbar-duplicate-panel {\n position: relative;\n width: 360px;\n max-width: calc(100vw - 32px);\n padding: 22px 20px 18px;\n border: 1px solid rgba(23, 26, 29, 0.08);\n border-radius: 8px;\n background: #fff;\n box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);\n color: rgba(23, 24, 28, 0.94);\n}\n\n.sear-toolbar-duplicate-close {\n position: absolute;\n top: 14px;\n right: 14px;\n width: 28px;\n height: 28px;\n border: 0;\n background: transparent;\n color: rgba(23, 24, 28, 0.62);\n font: 26px/28px Arial, sans-serif;\n}\n\n.sear-toolbar-duplicate-title {\n margin: 0 36px 18px 0;\n font-size: 20px;\n font-weight: 600;\n line-height: 28px;\n}\n\n.sear-toolbar-duplicate-row,\n.sear-toolbar-duplicate-column {\n display: flex;\n align-items: center;\n gap: 10px;\n min-height: 34px;\n font-size: 15px;\n}\n\n.sear-toolbar-duplicate-row select {\n height: 28px;\n padding: 0 24px 0 8px;\n border: 1px solid #d7dce2;\n border-radius: 4px;\n background: #fff;\n font: inherit;\n}\n\n.sear-toolbar-duplicate-columns {\n max-height: 180px;\n margin: 12px 0;\n padding: 8px;\n overflow: auto;\n border: 1px solid rgba(23, 26, 29, 0.08);\n border-radius: 6px;\n}\n\n.sear-toolbar-duplicate-actions {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n margin-top: 18px;\n}\n\n.sear-toolbar-duplicate-actions button {\n min-width: 76px;\n min-height: 36px;\n border: 1px solid #d7dce2;\n border-radius: 5px;\n background: #fff;\n color: rgba(23, 24, 28, 0.94);\n font: inherit;\n font-size: 14px;\n}\n\n.sear-toolbar-duplicate-actions [data-role=\"confirm\"] {\n border-color: #256cfb;\n background: #256cfb;\n color: #fff;\n}\n\n.sear-cell-highlight-overlay {\n position: fixed;\n inset: 0;\n z-index: 10000;\n display: grid;\n place-items: center;\n background: rgba(12, 16, 24, 0.2);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", Arial, sans-serif;\n}\n.sear-sheet-sort-overlay { position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center; background: #1118; }\n.sear-sheet-filter-overlay { position: fixed; inset: 0; z-index: 10020; display: grid; place-items: center; background: #1118; }\n.sear-sheet-filter-panel { position: relative; box-sizing: border-box; width: min(400px, calc(100vw - 24px)); max-height: min(85vh, 700px); overflow: auto; padding: 20px; border: 1px solid #dfe3e9; border-radius: 6px; background: #fff; color: #202329; box-shadow: 0 18px 48px #0003; font: 14px sans-serif; }\n.sear-sheet-filter-panel h2 { margin: 0 32px 16px 0; font-size: 17px; }\n.sear-sheet-filter-close { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border: 0; background: transparent; font-size: 22px; cursor: pointer; }\n.sear-sheet-filter-panel > label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }\n.sear-sheet-filter-panel select, .sear-sheet-filter-panel input[type=\"text\"], .sear-sheet-filter-panel input[type=\"date\"], .sear-sheet-filter-panel input[type=\"search\"] { box-sizing: border-box; width: 100%; min-width: 0; height: 34px; padding: 5px 8px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; }\n.sear-sheet-filter-panel > label select { width: 75%; }\n.sear-sheet-filter-sorting { display: flex; gap: 8px; margin-top: 14px; }\n.sear-sheet-filter-sorting button { flex: 1; min-height: 32px; border: 1px solid #dfe3e9; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-sheet-filter-sorting button:hover { background: #f3f6fa; }\n.sear-sheet-filter-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; border-bottom: 1px solid #dfe3e9; }\n.sear-sheet-filter-tabs button { min-height: 36px; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; }\n.sear-sheet-filter-tabs button[aria-selected=\"true\"] { border-bottom-color: #256cfb; color: #1769d2; }\n.sear-sheet-filter-body { display: grid; gap: 10px; padding-top: 14px; }\n.sear-sheet-filter-value-controls { display: flex; gap: 14px; }\n.sear-sheet-filter-value-controls button { border: 0; background: transparent; color: #1769d2; cursor: pointer; }\n.sear-sheet-filter-values { max-height: 240px; overflow: auto; border: 1px solid #e5e8ed; border-radius: 4px; }\n.sear-sheet-filter-values label { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; }\n.sear-sheet-filter-values label[hidden] { display: none; }\n.sear-sheet-filter-values label span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.sear-sheet-filter-values label small { color: #69717c; }\n.sear-sheet-filter-values label button { border: 0; background: transparent; color: #1769d2; cursor: pointer; }\n.sear-sheet-filter-limit { margin: 0; color: #69717c; font-size: 12px; }\n.sear-sheet-filter-panel > .sear-sheet-filter-auto { display: inline-flex; justify-content: flex-start; align-items: center; gap: 7px; margin-top: 10px; }\n.sear-sheet-filter-status { min-height: 16px; margin: 8px 0 0; color: #b42318; font-size: 12px; }\n.sear-sheet-filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }\n.sear-sheet-filter-actions button { min-height: 34px; padding: 0 10px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; cursor: pointer; }\n.sear-sheet-filter-actions button:last-child { border-color: #256cfb; background: #256cfb; color: #fff; }\n.sear-sheet-filter-actions button:disabled { opacity: .45; cursor: default; }\n.sear-sheet-sort-panel { position: relative; box-sizing: border-box; width: min(520px, calc(100vw - 24px)); max-height: min(80vh, 680px); overflow: auto; padding: 22px; border: 1px solid #dfe3e9; border-radius: 6px; background: #fff; color: #202329; box-shadow: 0 18px 48px #0003; font: 14px sans-serif; }\n.sear-sheet-sort-panel h2 { margin: 0 32px 18px 0; font-size: 17px; font-weight: 600; }\n.sear-sheet-sort-close { position: absolute; top: 12px; right: 14px; width: 28px; height: 28px; border: 0; background: transparent; font-size: 23px; cursor: pointer; }\n.sear-sheet-sort-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }\n.sear-sheet-sort-criteria { display: grid; gap: 8px; }\n.sear-sheet-sort-criterion { display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr) 30px; align-items: center; gap: 8px; }\n.sear-sheet-sort-criterion select, .sear-sheet-sort-criterion input { box-sizing: border-box; min-width: 0; width: 100%; height: 34px; padding: 4px 8px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; }\n.sear-sheet-sort-criterion button { width: 30px; height: 30px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }\n.sear-sheet-sort-criterion button:disabled { color: #b8bec6; cursor: default; }\n.sear-sheet-sort-add { margin-top: 14px; padding: 5px 0; border: 0; background: transparent; color: #1769d2; font: inherit; cursor: pointer; }\n.sear-sheet-sort-status { min-height: 18px; margin: 8px 0 0; color: #b42318; font-size: 12px; }\n.sear-sheet-sort-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }\n.sear-sheet-sort-actions button { min-width: 72px; height: 34px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; cursor: pointer; }\n.sear-sheet-sort-actions [data-role=\"confirm\"] { border-color: #256cfb; background: #256cfb; color: #fff; }\n@media (max-width: 440px) { .sear-sheet-sort-criterion { grid-template-columns: 1fr 1fr 30px; } .sear-sheet-sort-criterion span { grid-column: 1 / -1; } }\n\n.sear-cell-highlight-panel {\n position: relative;\n box-sizing: border-box;\n width: min(440px, calc(100vw - 32px));\n max-height: calc(100vh - 32px);\n overflow: auto;\n padding: 22px;\n border: 1px solid #dfe3e8;\n border-radius: 8px;\n background: #fff;\n box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);\n color: #17181c;\n font-size: 14px;\n}\n\n.sear-cell-highlight-panel h2 { margin: 0 40px 18px 0; font-size: 18px; font-weight: 600; }\n.sear-cell-highlight-close { position: absolute; top: 14px; right: 14px; border: 0; background: none; font-size: 24px; cursor: pointer; }\n.sear-cell-highlight-panel select,\n.sear-cell-highlight-range input,\n.sear-cell-highlight-details input:not([type=\"checkbox\"]) {\n box-sizing: border-box;\n width: 100%;\n height: 34px;\n padding: 0 9px;\n border: 1px solid #cbd2da;\n border-radius: 4px;\n background: #fff;\n color: inherit;\n font: inherit;\n}\n.sear-cell-highlight-range { display: block; margin-top: 12px; color: #4c5561; font-size: 13px; }\n.sear-cell-highlight-range input { display: block; margin-top: 6px; }\n.sear-cell-highlight-details { display: grid; gap: 10px; margin-top: 12px; }\n.sear-cell-highlight-details input[hidden] { display: none; }\n.sear-cell-highlight-details label { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; }\n.sear-cell-highlight-details input[type=\"checkbox\"] { width: 16px; height: 16px; margin: 0; accent-color: #256cfb; }\n.sear-cell-highlight-styles { margin: 18px 0 0; padding: 0; border: 0; }\n.sear-cell-highlight-styles legend { margin-bottom: 8px; }\n.sear-cell-highlight-styles label { display: flex; align-items: center; gap: 9px; min-height: 32px; cursor: pointer; }\n.sear-cell-highlight-swatch { display: inline-block; flex: none; width: 32px; height: 20px; border: 1px solid #cbd2da; border-radius: 2px; }\n.sear-cell-highlight-swatch.redFill { background: #fbc8cf; }\n.sear-cell-highlight-swatch.yellowFill { background: #fce3a1; }\n.sear-cell-highlight-swatch.greenFill { background: #c9edd1; }\n.sear-cell-highlight-swatch.redBorder { border: 2px solid #bc0e1d; }\n.sear-cell-highlight-swatch.redText { position: relative; }\n.sear-cell-highlight-swatch.redText::after { content: \"A\"; display: block; color: #be0e1e; text-align: center; line-height: 18px; }\n.sear-cell-highlight-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }\n.sear-cell-highlight-actions button { min-width: 72px; height: 34px; border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: inherit; font: inherit; cursor: pointer; }\n.sear-cell-highlight-actions [data-role=\"confirm\"] { border-color: #256cfb; background: #256cfb; color: #fff; }\n.sear-cell-highlight-list { min-height: 100px; max-height: 300px; overflow: auto; margin-top: 12px; border-top: 1px solid #e6e9ed; }\n.sear-cell-highlight-list p { color: #737984; }\n.sear-cell-highlight-rule { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid #e6e9ed; }\n.sear-cell-highlight-rule span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.sear-cell-highlight-rule span.sear-validation-rule-summary { overflow: visible; white-space: pre-line; overflow-wrap: anywhere; line-height: 18px; padding: 6px 0; }\n.sear-cell-highlight-rule button { width: 28px; height: 28px; border: 0; background: transparent; font-size: 19px; cursor: pointer; }\n.sear-validation-panel { width: min(440px, calc(100vw - 24px)); }\n.sear-validation-feedback { position: fixed; z-index: 9999; display: flex; align-items: flex-start; gap: 10px; width: min(270px, calc(100vw - 16px)); padding: 12px 14px; background: #fff; color: #30343a; border: 1px solid #e8eaed; border-radius: 7px; box-shadow: 0 3px 12px rgba(0, 0, 0, .12); pointer-events: none; box-sizing: border-box; }\n.sear-validation-feedback__icon { display: grid; place-items: center; flex: 0 0 27px; width: 27px; height: 27px; border-radius: 50%; background: #ff873d; color: #fff; font-weight: 700; }\n.sear-validation-feedback strong { display: block; margin: 0 0 2px; color: #fa5b2d; font-size: 15px; line-height: 22px; }\n.sear-validation-feedback__message { margin: 0; font-size: 14px; line-height: 21px; overflow-wrap: anywhere; }\n.sear-validation-feedback--hint { border-left: 3px solid #4b718f; }\n.sear-validation-feedback--hint .sear-validation-feedback__icon { display: none; }\n.sear-validation-feedback--hint strong { color: #365b77; }\n.sear-validation-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #e6e9ed; }\n.sear-validation-tabs button { min-height: 34px; padding: 0 10px; border: 0; background: transparent; color: #26313d; cursor: pointer; }\n.sear-validation-tabs button[aria-selected=\"true\"] { color: #12559a; box-shadow: inset 0 -2px #2b76d2; font-weight: 600; }\n.sear-validation-tabs button:focus-visible { outline: 2px solid #2b76d2; outline-offset: -2px; }\n.sear-validation-fields { display: grid; gap: 12px; }\n.sear-validation-date-hint { margin: 0; color: #52616c; font-size: 12px; line-height: 18px; }\n.sear-validation-fields[hidden], .sear-validation-field[hidden], .sear-validation-fields label[hidden] { display: none; }\n.sear-validation-field { display: grid; gap: 5px; color: #28313b; }\n.sear-validation-field input, .sear-validation-field select, .sear-validation-option input:not([type=\"color\"]) {\n box-sizing: border-box; width: 100%; min-width: 0; height: 34px; padding: 4px 8px;\n border: 1px solid #cbd2da; border-radius: 4px; background: #fff; color: #17181c; font: inherit;\n}\n.sear-validation-fields > label:not(.sear-validation-field) { display: flex; align-items: center; gap: 7px; }\n.sear-validation-options { display: grid; gap: 8px; max-height: 180px; overflow: auto; }\n.sear-validation-options[hidden], .sear-validation-fields > button[hidden] { display: none; }\n.sear-validation-option { display: grid; grid-template-columns: minmax(0, 1fr) 34px 28px; align-items: center; gap: 6px; }\n.sear-validation-option input[type=\"color\"] { width: 34px; height: 30px; padding: 2px; border: 1px solid #cbd2da; border-radius: 4px; }\n.sear-validation-option button { width: 28px; height: 28px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }\n.sear-validation-fields > button { justify-self: start; border: 0; background: transparent; color: #1769d2; cursor: pointer; }\n.sear-validation-panel .sear-cell-highlight-rule button { width: auto; min-width: 28px; padding: 0 4px; font-size: 13px; }\n.sear-cell-data-visual-panel { max-height: min(80vh, 720px); overflow: auto; }\n.sear-cell-data-visual-field { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 10px 0; }\n.sear-cell-data-visual-field select { min-width: 0; }\n.sear-cell-data-visual-field input[type=\"number\"] { width: 86px; min-width: 0; padding: 7px; border: 1px solid #cbd2da; border-radius: 4px; }\n.sear-cell-data-visual-field input[type=\"color\"] { width: 44px; height: 30px; padding: 1px; border: 1px solid #cbd2da; background: #fff; cursor: pointer; }\n.sear-cell-data-visual-field[hidden] { display: none; }\n.sear-freeze-menu { position: fixed; z-index: 10025; box-sizing: border-box; width: 212px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 5px 0; background: #fff; color: #25272d; border: 1px solid #dedfe3; border-radius: 6px; box-shadow: 0 8px 22px rgba(0, 0, 0, .16); }\n.sear-freeze-menu button { display: block; width: 100%; min-height: 34px; padding: 7px 14px; border: 0; background: transparent; color: inherit; font: 13px/20px inherit; text-align: left; white-space: nowrap; cursor: pointer; }\n.sear-freeze-menu button:hover:not(:disabled), .sear-freeze-menu button:focus-visible { background: #f1f5fb; outline: 0; }\n.sear-freeze-menu button:disabled { color: #a5a7ad; cursor: default; }\n.sear-freeze-menu__divider { height: 1px; margin: 5px 0; background: #e8e9ec; }\n"CSS injected by SearWebToolbar for the web toolbar and its popovers.
Sheet horizontal and vertical alignment state, commands, rendering projections, and persistence.
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.
AlignmentMatrix(data?: AlignmentMatrixData, shape?: [number, number]): AlignmentMatrixCreates an alignment matrix and compacts explicit left-alignment entries.
dataOptional serialized CSR entries from persisted state.
shapeDeclared row and column count; empty cells resolve to left alignment.
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.
rowZero-based row receiving the override.
colZero-based column receiving the override.
valueRequested horizontal alignment.
static readonly defaultAlignment: LeftDefault horizontal alignment returned for cells without an explicit override.
Inherited from CSRMatrix.
class SheetAlignmentPlugin extends Plugin<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.
SheetAlignmentPlugin(state: SheetAlignmentPluginState, readCellData?: (): SheetMatrix): SheetAlignmentPluginConstructs the alignment plugin.
stateShared alignment state.
SheetAlignmentPlugin owns the persisted alignment export module.
interestedIn: string[]Alignment reacts to direct cell updates and sheet-structure changes.
readonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Alignment transactions share the registered MatrixOT algebra.
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.
pluginStateCurrent alignment state.
transactionTransaction containing direct or derived MatrixOT-compatible operations.
registerCellStyles(registry: SheetCellStyleRegistry, defaults: SheetCellStyleDefaults): voidregisterCommands(commands: SheetCommandBus): voidRegisters the horizontal alignment command owned by this plugin.
registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetAlignmentPluginState): AlignmentMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetAlignmentPluginState;
}Registers alignment state for commands, projections, and collaboration.
Document-state export contribution for persisted cell alignments.
Stable plugin key shared by all alignment plugin instances.
static readonly symbol: symbolDI token for resolving the alignment plugin.
Serialized sparse entries accepted by AlignmentMatrix.
State owned by SheetAlignmentPlugin.
Sparse matrix containing non-left or cell-type-derived horizontal alignment overrides.
interface SheetHorizontalAlignmentCommandDataSource extends SheetCommandRangeDimensionsState access required by the horizontal alignment command.
readCellAlignment(row: number, column: number): SheetHorizontalAlignment | nullHorizontal alignment values supported by the built-in Sheet alignment feature.
| Member | Value |
|---|---|
Center |
"center" |
Left |
"left" |
Right |
"right" |
type SheetSetRangeAlignmentInput = SheetRangeInput & { readonly alignment: SheetHorizontalAlignment } | {
readonly alignment: SheetHorizontalAlignment;
readonly ranges: readonly SheetRangeInput[];
}Public input for setting horizontal alignment in one or more ranges.
createSetRangeAlignmentOperations(input: SheetSetRangeAlignmentInput, dataSource: SheetHorizontalAlignmentReader): UpdateCellOTOperation<SheetHorizontalAlignment>[]Creates sparse UpdateCell operations for horizontal alignment.
readSheetCellAlignments(dataEngine: DataEngine): AlignmentMatrix | nullReads horizontal cell alignment published by SheetAlignmentPlugin.
registerSheetHorizontalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetHorizontalAlignmentCommandDataSource): voidRegisters the horizontal alignment command owned by SheetAlignmentPlugin.
assertSheetHorizontalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet horizontal alignments.
isSheetHorizontalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet horizontal alignment.
Public command for setting horizontal alignment in a range.
SheetHorizontalAlignmentFieldKey: "sheet.alignment.horizontal"DataEngine field owned by SheetAlignmentPlugin.
class SheetVerticalAlignmentPlugin extends Plugin<SheetVerticalAlignmentPluginState>Plugin that owns vertical cell alignment data, commands, and structural projections.
Constructs the vertical alignment plugin around a shared sparse matrix.
SheetVerticalAlignmentPlugin owns its persisted export module.
interestedIn: string[]Vertical alignment follows direct updates and all sheet structure changes.
readonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Vertical alignment transactions share the registered MatrixOT algebra.
apply(pluginState: SheetVerticalAlignmentPluginState, transaction: Transaction): SheetVerticalAlignmentPluginState | nullApplies direct vertical alignment and structural matrix operations.
registerCellStyles(registry: SheetCellStyleRegistry, defaults: SheetCellStyleDefaults): voidregisterCommands(commands: SheetCommandBus): voidRegisters the vertical alignment command owned by this plugin.
registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetVerticalAlignmentPluginState): VerticalAlignmentMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetVerticalAlignmentPluginState;
}Registers vertical alignment state for commands, projections, and collaboration.
Document-state export contribution for persisted vertical alignments.
Stable plugin key shared by all vertical alignment plugin instances.
static readonly symbol: symbolDI token for resolving the vertical alignment plugin.
class VerticalAlignmentMatrix extends CSRMatrix<string>Sparse vertical-alignment matrix whose absent cells resolve to centered alignment.
VerticalAlignmentMatrix(data?: VerticalAlignmentMatrixData, shape?: [number, number]): VerticalAlignmentMatrixCreates a matrix and compacts explicit default-alignment entries.
addItem(row: number, col: number, value: string): thisStores an explicit non-default override, or removes it for centered alignment.
static readonly defaultAlignment: CenterDefault vertical alignment returned for cells without an explicit override.
Inherited from CSRMatrix.
interface SheetSetRangeVerticalAlignmentInput extends SheetRangeInputPublic input for setting vertical alignment in a range.
readonly verticalAlignment: SheetVerticalAlignmentinterface SheetVerticalAlignmentCommandDataSource extends SheetCommandRangeDimensionsState access required by the vertical alignment command.
readCellVerticalAlignment(row: number, column: number): SheetVerticalAlignment | nullState owned by SheetVerticalAlignmentPlugin.
Sparse matrix containing non-centered vertical alignment overrides.
Serialized sparse entries accepted by VerticalAlignmentMatrix.
Vertical alignment values supported by the built-in Sheet alignment feature.
| Member | Value |
|---|---|
Bottom |
"bottom" |
Center |
"center" |
Top |
"top" |
createSetRangeVerticalAlignmentOperations(input: SheetSetRangeVerticalAlignmentInput, dataSource: SheetVerticalAlignmentReader): UpdateCellOTOperation<SheetVerticalAlignment>[]Creates sparse UpdateCell operations for vertical alignment.
readSheetCellVerticalAlignments(dataEngine: DataEngine): VerticalAlignmentMatrix | nullReads vertical cell alignment published by SheetVerticalAlignmentPlugin.
registerSheetVerticalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetVerticalAlignmentCommandDataSource): voidRegisters the vertical alignment command owned by SheetVerticalAlignmentPlugin.
assertSheetVerticalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet vertical alignments.
isSheetVerticalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet vertical alignment.
SetRangeVerticalAlignmentCommand: SheetCommandDefinition<SheetSetRangeVerticalAlignmentInput, SheetCommandResult>Public command for setting vertical alignment in a range.
SheetVerticalAlignmentFieldKey: "sheet.alignment.vertical"DataEngine field owned by SheetVerticalAlignmentPlugin.
Independent Sheet cell borders, commands, rendering, history and collaboration.
class CellBorderError extends SearErrorTyped error for invalid border commands or document values.
CellBorderError(message: string, details?: Record<string, unknown>): CellBorderErrorreadonly code: "SHEET_CELL_BORDER_INVALID"Stable machine-readable identifier for this error category.
class CellBorderMatrix extends CSRMatrix<SheetCellBorder | null>Feature-owned sparse matrix; empty edge records are represented by absence.
CellBorderMatrix(data?: CellBorderMatrixData, shape?: [number, number]): CellBorderMatrixaddItem(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.
rowThe row index.
valueThe value to add.
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.
rowThe row index.
setItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): thisStores an isolated edge record or clears its sparse entry.
Inherited from CSRMatrix.
interface BorderLinePaint
BorderLinePaint: Readonly<Record<SheetBorderLineStyle, BorderLinePaint>>Paint projection of one persisted border style.
Serialized sparse border entries.
readonly data: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]readonly indices: number[]readonly indptr: number[]One explicit persisted border stroke.
readonly color: stringreadonly style: SheetBorderLineStyleBorder line style input contract.
| Member | Value |
|---|---|
Thin |
"thin" |
Medium |
"medium" |
Thick |
"thick" |
Dashed |
"dashed" |
Dotted |
"dotted" |
DashDot |
"dashDot" |
DashDotDot |
"dashDotDot" |
Hair |
"hair" |
MediumDashed |
"mediumDashed" |
MediumDashDot |
"mediumDashDot" |
MediumDashDotDot |
"mediumDashDotDot" |
Double |
"double" |
SlantedDashDot |
"slantedDashDot" |
Border preset input contract.
| Member | Value |
|---|---|
None |
"none" |
All |
"all" |
Outside |
"outside" |
Inside |
"inside" |
Top |
"top" |
Bottom |
"bottom" |
Left |
"left" |
Right |
"right" |
Horizontal |
"horizontal" |
Vertical |
"vertical" |
Cell border edge contract.
| Member | Value |
|---|---|
Bottom |
"bottom" |
Left |
"left" |
Right |
"right" |
Top |
"top" |
type SheetCellBorder = Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>>Explicit edges belonging to one cell; omitted edges have no custom border.
class SheetCellBorderPlugin extends Plugin<SheetCellBorderPluginState>Plugin that owns cell border data, commands, structural projections, and export.
Constructs the plugin around its independently owned sparse border matrix.
readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>SheetCellBorderPlugin owns its persisted state module.
interestedIn: string[]Border follows direct updates and all sheet structure changes.
readonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Border transactions share the registered MatrixOT algebra.
apply(pluginState: SheetCellBorderPluginState, transaction: Transaction): SheetCellBorderPluginState | nullApplies direct border and structural matrix operations.
registerCommands(commands: SheetCommandBus): voidRegisters the cell-border command owned by this plugin.
registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registerQueries(queries: SheetQueryRegistry): voidPublishes the border owner's typed read-only queries.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetCellBorderPluginState): CellBorderMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetCellBorderPluginState;
}Registers border state for commands, projections, and collaboration.
static readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>Document-state export contribution for cell borders.
Stable plugin key shared by all cell-border plugin instances.
static readonly symbol: symbolDI token for resolving the cell-border plugin.
State owned by SheetCellBorderPlugin.
Sparse matrix containing explicit per-cell edge strokes.
interface SheetSetRangeCellBorderInput extends SheetRangeInputPublic range-border input.
readonly preset: SheetBorderPresetreadonly stroke: SheetBorderStrokereadSheetCellBorders(dataEngine: DataEngine): CellBorderMatrix | nullReads the border owner's projection, when that plugin is installed.
ReadSheetCellBorderQuery: SheetQueryDefinition<{
column: number;
row: number;
}, Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null>Typed read of the explicit edges at one cell.
Range-border command; all neighbor changes belong to the same transaction.
SheetCellBorderFieldKey: "sheet.cellBorder"Stable data-view field owned by the border plugin.
Sheet cell-edit sessions, text input, selection, and embedded-editor coordination.
apply(document: readonly RichDocNode[], format: Readonly<Record<string, unknown>>): Schema[]capture(document: readonly RichDocNode[]): Readonly<Record<string, unknown>>readonly cellCodecs: CellClipboardCodecRegistryreadonly commitStrategies: CellCommitStrategyRegistryreadonly data: DataEnginereadonly dateSystemProvider: IFormulaDateSystemProviderreadonly formatting: CellDocumentFormattingreadonly formulaParser: IFormulaParserreadonly formulaSourceProvider: IFormulaSourceProviderreadonly merges: SheetCellMergePluginreadonly queries: SheetQueryRegistryreadonly selection: SheetSelectionPlugintype EditorState = [RectRange, RectRange, RectRange]Plugin state tuple: [0] anchorRect — which cell is the edit anchor (for position computation) [1] focusRect — which cell range is being edited (shown as the editor box) [2] docSelection — text selection inside the editor: getPoint(0) = [paraIndex, charOffset] for anchor getPoint(1) = [paraIndex, charOffset] for head
type PickedReferenceKind = "cell" | "row" | "column"Publishes a committed draft projection update.
Synchronizes the edit model after a command-owned text-selection change.
BeginCellEditCommand opens an edit session. CommitCellEditCommand applies the result; CancelCellEditCommand closes the session without committing.
class SheetCellEditorPlugin extends Plugin<EditorState>Coordinates Sheet cell edit sessions, text input, and embedded editors.
interestedIn: string[]Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsapply(pluginState: EditorState, transaction: Transaction): EditorState | nullApplies a transaction to SheetCellEditorPlugin state.
bindFormulaRegistry(registry: IFunctionRegistry): voidBinds the editor-local registry after formula services have been assembled.
cancelEdit(): voidCancels the active cell edit session without committing its draft.
commitEdit(fillSelection?: boolean, historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}, minimumRowHeight?: number): booleanCommits the active cell edit session through its owning command.
Returns the active document selection for host diagnostics and adapters.
isEditing(): booleanlockCommittedState(state: EditorState): voidLocks committed editor selection rectangles while staged clones stay writable.
onEditorDestroy(): voidonTransactionCommitted(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.
transactionSuccessfully committed transaction.
readDocumentSession(): {
docSelection: DocSelection;
pendingDoc: RichDocNode[];
}readEditModel(): DocEditModel | nullRead-only view of the single document owner. Mutation authority remains command-scoped.
readFormulaDraft(): FormulaEditDraft | nullreadLastPickedReference(): {
cell: Point;
readonly start: number;
readonly text: string;
} | nullreadReferencePick(): {
readonly kind: PickedReferenceKind;
replaceEnd: number;
readonly replaceStart: number;
start: Point;
} | nullreadSelectedCellEditText(): string | nullregisterCommands(commands: SheetCommandBus): voidRegisters the commands.
registerObservations(observations: ObservationRegistry): voidPublishes formula authoring state through the editor's typed observation registry.
registerQueries(queries: SheetQueryRegistry): voidRegisters the read-only draft projection used during workbook sheet switching.
registerState(): {
key: PluginKey;
state: EditorState;
}Registers one or more plugin-owned state records with the host manager.
Public input used to enter cell edit mode.
Public input used to cancel the active edit session.
readonly restoreOriginalDocument?: booleanPublic input used to commit the active edit session.
readonly fillSelection?: booleanApplies the entered value to every cell in the current selected rectangle.
readonly historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}readonly minimumRowHeight?: numberMeasured minimum row height supplied by a view that expands multiline content.
readonly nextSelection?: SheetCellEditSelectionInputreadonly pipelineName?: SheetCellEditorPipelineNamereadonly reason?: SheetCellEditorExitReasonCell target for opening an embedded edit session.
Enumerates SheetCellEditorExitReason values.
| Member | Value |
|---|---|
Cancel |
"cancel" |
Commit |
"commit" |
OutsideClick |
"outside-click" |
Enumerates SheetCellEditorKind values.
| Member | Value |
|---|---|
Cell |
"cell" |
getCellEditableValue(cell: CellMatrixElement | null | undefined, coordinate?: {
readonly col: number;
readonly 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.
Command that enters cell edit mode.
Command that cancels the active cell edit session.
Command that commits the active cell edit session.
InsertCurrentDateTimeCommand: SheetCommandDefinition<"date" | "time", SheetCommandResult>Inserts the host wall-clock date or time as a static numeric cell value.
IsCellEditingQuery: SheetQueryDefinition<void, boolean>Reports whether an active cell edit must be committed before a host formatting action.
Command that opens the embedded editor and enters cell edit mode atomically.
Optional selection change applied while committing an edit session.
Document cursor position inside the active cell editor session.
Document selection input expressed as anchor/head coordinates.
Inline text-style patch applied to the active embedded cell editor.
readonly attrs: Readonly<Record<string, unknown>>readonly attrs: Readonly<Record<string, unknown>>type SheetDocumentInputCommandInput = TextInputEvent | {
readonly byWord?: boolean;
readonly direction?: "backward" | "forward";
readonly kind: "delete";
} | {
readonly direction: DocCursorDirection;
readonly kind: "arrow";
readonly shiftKey: boolean;
} | {
readonly boundary: "start" | "end";
readonly kind: "lineBoundary";
readonly shiftKey: boolean;
} | {
readonly boundary: "previous" | "next";
readonly kind: "wordBoundary";
readonly shiftKey: boolean;
} | { readonly kind: "selectAll" } | { readonly kind: "softEnter" } | {
readonly ctrlKey?: boolean;
readonly key: string;
readonly kind: "keyDown";
readonly metaKey?: boolean;
readonly shiftKey?: boolean;
} | {
readonly anchor: SheetDocumentCursorPositionInput;
readonly head: SheetDocumentCursorPositionInput;
readonly kind: "setSelection";
}Local document input action run inside the command boundary.
HandleDocumentInputCommand: SheetCommandDefinition<SheetDocumentInputCommandInput, SheetCommandResult>Command that executes local document input while editing a cell.
ReadSelectedCellEditTextQuery: SheetQueryDefinition<void, string | null>Selected plain text in the active cell edit session; null outside editing.
Command used by toolbar integrations to update rich-text inline styles.
Applies text styles to the complete content of selected text cells.
UpdateCellEditorDocumentSelectionCommand: SheetCommandDefinition<SheetDocumentSelectionCommandInput, SheetCommandResult>Command that updates the rich-document selection inside the cell editor.
Formula drafts and reference-picking commands keep the formula being typed separate from the committed cell value.
Optional workbook-owned bridge for references picked on another sheet.
static readonly symbol: typeof symbolTransient formula draft retained while a workbook mounts another sheet.
readonly autoClosingParentheses?: readonly number[]readonly selectionEnd: numberreadonly selectionStart: numberreadonly text: stringCurrent formula-authoring suggestions and caret position in the host view.
readonly anchor: {
readonly x: number;
readonly y: number;
} | nullreadonly diagnostic: FormulaInputDiagnostic | nullreadonly selectedIndex: numberreadonly signature: FormulaSignature | nullreadonly suggestions: readonly FormulaSuggestion[]Source text and transient edit selection for the active Sheet cell.
readonly editing: booleanreadonly range: {
readonly end: Point;
readonly start: Point;
} | nullreadonly selectionEnd: numberreadonly selectionStart: numberreadonly text: stringFormula reference replacement while an edit session is active.
type SheetFormulaBarKeyInput = {
readonly action: "enter";
readonly minimumRowHeight?: number;
readonly primaryModifier: boolean;
readonly shiftKey: boolean;
} | {
readonly action: "tab";
readonly minimumRowHeight?: number;
readonly shiftKey: boolean;
} | {
readonly action: "softEnter" | "suggestionUp" | "suggestionDown" | "suggestionPageUp" | "suggestionPageDown" | "suggestionHome" | "suggestionEnd" | "escape";
}Routes formula-bar keys through the same edit and navigation behavior as grid input.
canStartFormulaReferencePick(text: string, selectionStart: number, selectionEnd: number): booleanA new grid reference can start only where the formula expects an operand.
findTrailingSheetQualifierStart(text: string, caret: number): number | nullFinds a sheet qualifier immediately before a formula reference insertion point.
formatPickedReference(start: Point, end: Point, sheetName?: string, kind?: PickedReferenceKind): stringFormats a selected grid rectangle or header span as an A1 reference.
AcceptFormulaSuggestionCommand: SheetCommandDefinition<{ readonly name: string }, SheetCommandResult>Accepts a registered function suggestion without committing the cell edit.
Cycles the reference at the formula caret through relative and absolute modes.
Ends a pointer-based formula reference pick without changing the draft.
MoveFormulaSuggestionCommand: SheetCommandDefinition<FormulaSuggestionMove, SheetCommandResult>ReadFormulaEditDraftQuery: SheetQueryDefinition<void, FormulaEditDraft | null>Reads the active formula draft without changing the edit session.
ReplaceFormulaReferenceCommand: SheetCommandDefinition<SheetFormulaReferenceReplacementInput, SheetCommandResult>Replaces the picked formula reference in the active edit session.
RestoreFormulaEditDraftCommand: SheetCommandDefinition<{
readonly draft: FormulaEditDraft;
readonly reference?: string;
}, SheetCommandResult>Restores a formula draft after a workbook sheet switch.
SetFormulaBarDraftCommand: SheetCommandDefinition<{
readonly selectionEnd: number;
readonly selectionStart: number;
readonly text: string;
}, SheetCommandResult>Replaces the active edit-session text and synchronizes its caret range.
Opens the current cell's edit session for an external formula input surface.
UpdateFormulaAssistAnchorCommand: SheetCommandDefinition<{
readonly x: number;
readonly y: number;
}, SheetCommandResult>Updates the formula-assist anchor after editor layout changes.
Pointer and document-input commands route host events into the active embedded editor.
interface EditSessionEndedInteractionSignal extends SheetInteractionSignaltype: SessionEndedinterface EditSessionStartedInteractionSignal extends SheetInteractionSignalEnumerates SheetCellEditorInteractionName values.
| Member | Value |
|---|---|
SessionEnded |
"edit-session-ended" |
SessionStarted |
"edit-session-started" |
Observable pipeline and step names owned by the Cell Editor module.
| Member | Value |
|---|---|
CancelEdit |
"cell-editor.cancel-edit" |
CommitEdit |
"cell-editor.commit-edit" |
EditExitAndSelect |
"cell-editor.exit-and-select" |
EndEditSession |
"cell-editor.end-edit-session" |
EnterEditMode |
"cell-editor.enter-edit-mode" |
StartEditSession |
"cell-editor.start-edit-session" |
Enumerates SheetCellEditorPipelineStepName values.
| Member | Value |
|---|---|
CommitValue |
"cell-editor.commit-value" |
EndEditSession |
"cell-editor.end-edit-session" |
ExitEditMode |
"cell-editor.exit-edit-mode" |
OpenEditor |
"cell-editor.open" |
SelectCell |
"cell-editor.select-cell" |
StartEditSession |
"cell-editor.start-edit-session" |
Registers Cell Editor's local interaction projections once per DI container.
Sparse Sheet fill state, commands, visual projection, collaboration, and export.
class CellFillMatrix extends CSRMatrix<SheetCellFill | null>Sparse cell-fill matrix. An absent cell has no fill.
CellFillMatrix(data?: CellFillMatrixData, shape?: [number, number]): CellFillMatrixCreates a sparse cell-fill matrix from serialized CSR data.
Inherited from CSRMatrix.
Serialized sparse entries accepted by CellFillMatrix.
type SheetCellFill = HexColorA persisted cell fill color represented as a CSS-compatible hexadecimal color.
assertSheetCellFill(value: unknown): valueAsserts that a value is a supported cell fill color.
isSheetCellFill(value: unknown): valueReturns whether a value is a supported cell fill color.
class SheetCellFillPlugin extends Plugin<SheetCellFillPluginState>Plugin that owns cell fill data, commands, structural projections, and export.
Constructs the plugin around a shared sparse fill matrix.
SheetCellFillPlugin owns its persisted state module.
interestedIn: string[]Fill follows direct updates and all sheet structure changes.
readonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Fill transactions share the registered MatrixOT algebra.
apply(pluginState: SheetCellFillPluginState, transaction: Transaction): SheetCellFillPluginState | nullApplies direct fill and structural matrix operations.
registerCellStyles(registry: SheetCellStyleRegistry): voidregisterCommands(commands: SheetCommandBus): voidRegisters the cell-fill command owned by this plugin.
registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetCellFillPluginState): CellFillMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetCellFillPluginState;
}Registers fill state for commands, projections, and collaboration.
Document-state export contribution for cell fills.
Stable plugin key shared by all cell-fill plugin instances.
static readonly symbol: symbolDI token for resolving the cell-fill plugin.
interface SheetCellFillCommandDataSource extends SheetCommandRangeDimensionsState access required by the cell-fill command.
readCellFill(row: number, column: number): templateLiteral | nullState owned by SheetCellFillPlugin.
Sparse matrix containing explicit cell fill colors.
interface SheetSetRangeCellFillInput extends SheetRangeInputPublic input for setting or clearing cell fill in a range.
readonly fill: templateLiteral | nullcreateSetRangeCellFillOperations(input: SheetSetRangeCellFillInput, dataSource: SheetCellFillCommandDataSource): UpdateCellOTOperation<templateLiteral>[]Creates sparse update operations for a cell-fill range.
readSheetCellFills(dataEngine: DataEngine): CellFillMatrix | nullReads cell fills published by SheetCellFillPlugin.
registerSheetCellFillCommand(commands: SheetCommandBus, dataSource: SheetCellFillCommandDataSource): voidRegisters the cell-fill command owned by SheetCellFillPlugin.
Public command for setting or clearing cell fill in a range.
SheetCellFillFieldKey: "sheet.cellFill"DataEngine field owned by SheetCellFillPlugin.
Cell number-format state, commands, display projection, and persistence.
class CellFormatMatrix extends CSRMatrix<CellFormat | null>Sparse matrix containing explicit per-cell number formats.
CellFormatMatrix(data?: CellFormatMatrixData, shape?: [number, number]): CellFormatMatrixaddItem(row: number, column: number, format: CellFormat | null): thisStores a format through the CSR API.
setItem(row: number, column: number, format: CellFormat | null): thisStores a validated format, or removes the sparse entry for null.
Inherited from CSRMatrix.
class CellFormatMatrixError extends SearErrorPublic error raised when persisted Sheet cell-format state is invalid.
CellFormatMatrixError(message: string, details?: SearErrorDetails): CellFormatMatrixErrorreadonly code: "SHEET_CELL_FORMAT_INVALID"Stable machine-readable identifier for this error category.
class SheetCellFormatPlugin extends Plugin<SheetCellFormatPluginState>Plugin owning per-cell number formats, their commands, OT, rendering projection, and export.
Document-state export modules owned by this plugin state.
interestedIn: string[]Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
apply(state: SheetCellFormatPluginState, transaction: Transaction): SheetCellFormatPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
registerCellStyles(registry: SheetCellStyleRegistry): voidregisterCommands(commands: SheetCommandBus): voidregisterFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registerQueries(queries: SheetQueryRegistry): voidregisterRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetCellFormatPluginState): CellFormatMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetCellFormatPluginState;
}Registers one or more plugin-owned state records with the host manager.
class SheetCellTextStylePlugin extends Plugin<TextStyleState>Plugin owning cell typography, wrapping and their structural projections.
SheetCellTextStylePlugin(state: TextStyleState): SheetCellTextStylePluginreadonly documentState: PluginDocumentStateContribution<TextStyleState, TextStyleState>Document-state export modules owned by this plugin state.
interestedIn: string[]Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
apply(state: TextStyleState, transaction: Transaction): TextStyleState | nullApplies a transaction to plugin-owned state and returns the next state.
registerCellStyles(registry: SheetCellStyleRegistry): voidregisterFormatTransfers(registry: SheetFormatTransferRegistry): voidregisterRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: TextStyleState): CSRMatrix<SheetCellTextStyle | null>;
viewKey: string;
}[];
};
key: PluginKey;
state: TextStyleState;
}Registers one or more plugin-owned state records with the host manager.
static readonly documentState: PluginDocumentStateContribution<TextStyleState, TextStyleState>static readonly symbol: symbolstatic readonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}State exclusively owned by SheetCellFormatPlugin.
readonly cellFormats: CellFormatMatrixRead-only projection of one Sheet's persisted cell-format matrix.
readonly shape: [number, number]getItem(row: number, column: number): CellFormat | nullCell typography and wrapping. Font size is measured in logical pixels (96 per inch).
SheetCellFormatFieldKey: "sheet.cellFormat"DataEngine field owned by SheetCellFormatPlugin.
SheetCellTextStyleFieldKey: "sheet.cellTextStyle"Field published by the cell typography owner.
interface SheetAdjustRangeCellFormatDecimalsInput extends SheetRangeInputInput accepted by AdjustRangeCellFormatDecimalPlacesCommand.
readonly delta: numberinterface SheetCellFormatCommandDataSource extends SheetCommandRangeDimensionsState access required by the cell-format command.
readCellFormat(row: number, column: number): CellFormat | nulltype SheetSetRangeCellFormatInput = SheetRangeInput & { readonly format: CellFormat | null } | {
readonly format: CellFormat | null;
readonly ranges: readonly SheetRangeInput[];
}Input accepted by SetRangeCellFormatCommand.
createAdjustCellFormatDecimalOperations(input: SheetAdjustRangeCellFormatDecimalsInput, dataSource: SheetCellFormatCommandDataSource): UpdateCellOTOperation<CellFormat>[]Creates sparse MatrixOT updates for a decimal-place adjustment.
createSetRangeCellFormatOperations(input: SheetSetRangeCellFormatInput, dataSource: SheetCellFormatCommandDataSource): UpdateCellOTOperation<CellFormat>[]Creates sparse MatrixOT updates for one format range.
readSheetCellFormats(dataEngine: DataEngine): CellFormatMatrix | nullReads the live format matrix published by SheetCellFormatPlugin.
readSheetCellTextStyles(dataEngine: DataEngine): CSRMatrix<SheetCellTextStyle | null> | nullReads the committed matrix of cell typography and wrapping settings.
registerSheetCellFormatCommand(commands: SheetCommandBus, dataSource: SheetCellFormatCommandDataSource): voidRegisters the command owned by SheetCellFormatPlugin.
AdjustRangeCellFormatDecimalPlacesCommand: SheetCommandDefinition<SheetAdjustRangeCellFormatDecimalsInput, SheetCommandResult>Public command for increasing or decreasing a range's visible decimal places.
Reads the active Sheet's live, read-only cell-format projection.
Public command for setting or clearing the number format of a cell range.
Conditional cell highlight rules, sparse range state, commands, and rendering contributions.
A rule pairs a condition with a style. Range readers supply the cell values used to evaluate that condition.
interface AddCellHighlightRuleInput extends SheetRangeInputCommon range input accepted by explicit range commands.
readonly condition: CellHighlightConditionreadonly style: CellHighlightStylereadonly count?: numberreadonly includeEqual?: booleanreadonly kind: CellHighlightKindreadonly operator?: CellHighlightValueOperator | CellHighlightTextOperatorreadonly percent?: booleanreadonly secondValue?: stringreadonly value?: stringOne conditional rule stored at its range's top-left matrix cell.
readonly appearance?: {
readonly fill?: string;
readonly stroke?: string;
readonly textColor?: string;
}readonly condition: CellHighlightConditionreadonly endColumn: numberreadonly endRow: numberreadonly id: stringreadonly predicate?: {
readonly formula: string;
readonly origin: readonly [number, number];
}Optional formula predicate, relative to the first area of a multi-range rule.
readonly priority: numberreadonly stopIfTrue?: booleanreadonly style: CellHighlightStyleinterface UpdateCellHighlightRuleInput extends AddCellHighlightRuleInputCommon range input accepted by explicit range commands.
readonly id: string| Member | Value |
|---|---|
Duplicate |
"duplicate" |
Text |
"text" |
Unique |
"unique" |
Value |
"value" |
Empty |
"empty" |
Error |
"error" |
NotEmpty |
"notEmpty" |
NotError |
"notError" |
AboveAverage |
"aboveAverage" |
BelowAverage |
"belowAverage" |
Bottom |
"bottom" |
Top |
"top" |
| Member | Value |
|---|---|
GreenFill |
"greenFill" |
RedFill |
"redFill" |
YellowFill |
"yellowFill" |
RedBorder |
"redBorder" |
RedText |
"redText" |
| Member | Value |
|---|---|
Contains |
"contains" |
EndsWith |
"endsWith" |
NotContains |
"notContains" |
StartsWith |
"startsWith" |
| Member | Value |
|---|---|
Between |
"between" |
Equal |
"equal" |
NotBetween |
"notBetween" |
NotEqual |
"notEqual" |
Greater |
"greater" |
GreaterOrEqual |
"greaterOrEqual" |
Less |
"less" |
LessOrEqual |
"lessOrEqual" |
type CellHighlightNumericRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: number): void): voidtype CellHighlightValueRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: unknown): void): voidtype CellHighlightValueReader = (row: number, column: number): unknownClearCellHighlightRulesCommand: SheetCommandDefinition<ClearCellHighlightRulesInput, SheetCommandResult>ReadCellHighlightRulesQuery: SheetQueryDefinition<void, readonly PositionedCellHighlightRule[]>RemoveCellHighlightRuleCommand: SheetCommandDefinition<RemoveCellHighlightRuleInput, SheetCommandResult>Add, remove, and clear commands change the stored rules; the read query returns the rules affecting a range.
class CellHighlightMatrix extends CSRMatrix<CellHighlightRule[] | null>Sparse rule anchors; the range index avoids scanning all rules for every visible cell.
CellHighlightMatrix(data?: CellHighlightMatrixData, shape?: [number, number]): CellHighlightMatrixaddItem(row: number, column: number, rules: CellHighlightRule[] | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
clone(): thisCreates an independent copy of this value and its mutable data.
findRules(row: number, column: number): PositionedCellHighlightRule[]forEachStored(callback: (rules: CellHighlightRule[] | null, row: number, column: number): void): voidVisits only stored anchors even when the sheet has many empty rows.
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.
rowThe row index.
replaceRules(entries: readonly PositionedCellHighlightRule[]): voidsetItem(row: number, column: number, rules: CellHighlightRule[] | null): thisInherited from CSRMatrix.
class SheetCellHighlightPlugin extends Plugin<SheetCellHighlightPluginState>Base contract implemented by sheet and document plugins.
Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.
SheetCellHighlightPlugin(state: SheetCellHighlightPluginState, dependencies: CellHighlightDependencies): SheetCellHighlightPluginDocument-state export modules owned by this plugin state.
Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
apply(state: SheetCellHighlightPluginState, transaction: Transaction): SheetCellHighlightPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
dispose(): voidgetHighestPriority(): numberinvalidateRangeStatistics(cells?: readonly SheetDisplayedValueCoordinate[]): voidInvalidates derived range statistics after displayed values change.
readMatches(rowIndex: number, columnIndex: number): readonly CellHighlightMatch[]registerCellStyles(registry: SheetCellStyleRegistry): voidregisterCommands(commands: SheetCommandBus): voidregisterFormatTransfers(registry: SheetFormatTransferRegistry): voidregisterQueries(queries: SheetQueryRegistry): voidregisterRangeMoves(registry: SheetRangeMoveRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetCellHighlightPluginState): CellHighlightMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetCellHighlightPluginState;
}Registers one or more plugin-owned state records with the host manager.
A rule matched against the current calculated cell values.
readonly appearance?: {
readonly fill?: string;
readonly stroke?: string;
readonly textColor?: string;
}readonly id: stringreadonly priority: numberreadonly style: CellHighlightStyleRead projection shared by queries and independent views.
getHighestPriority(): numberreadMatches(row: number, column: number): readonly CellHighlightMatch[]readonly cellHighlights: CellHighlightMatrixreadSheetCellHighlights(dataEngine: DataEngine): CellHighlightMatrix | nullSheetCellHighlightFieldKey: "sheet.cellHighlight"Merged-range state, structural transforms, commands, rendering, and persistence.
Merge commands change the range structure. The matrix and read helper expose merged ranges to other features.
class CellMergeMatrix extends CSRMatrix<SheetCellMerge | null>Sparse matrix containing one end coordinate at every merged-range anchor.
CellMergeMatrix(data?: CellMergeMatrixData, shape?: [number, number]): CellMergeMatrixaddItem(row: number, column: number, value: SheetCellMerge | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
valueThe value to add.
clone(): thisDeep-clones stored merge values.
Finds the merged range containing one sheet cell.
forEachStored(callback: (value: SheetCellMerge | null, row: number, col: number): void): voidVisits actual anchors only, locating their rows through CSR pointer binary search.
getItem(row: number, column: number): SheetCellMerge | nullReturns an isolated value so callers cannot mutate persisted matrix state.
Returns all merged ranges in matrix traversal order.
replaceRanges(ranges: readonly Rect[]): thisRebuilds sparse entries from normalized ranges while preserving matrix shape.
setItem(row: number, column: number, value: SheetCellMerge | null): thisStores or clears a merged range anchored at the supplied cell.
Inherited from CSRMatrix.
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 override code.
SheetCellMergeConfirmationError(reason: "required" | "changed"): SheetCellMergeConfirmationErrorreadonly code: "SHEET_MERGE_CONFIRMATION_REQUIRED"Stable machine-readable identifier for this error category.
class SheetCellMergePlugin extends Plugin<SheetCellMergePluginState>Owns sparse merged-cell state, commands, structure projection, collaboration, and export.
SheetCellMergePlugin(state: SheetCellMergePluginState, cellContent?: SheetCellMergeContentSource): SheetCellMergePluginDocument-state export modules owned by this plugin state.
Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
readonly warnOnDuplicateDepth: falseapply(pluginState: SheetCellMergePluginState, transaction: Transaction): SheetCellMergePluginState | nullApplies a transaction to plugin-owned state and returns the next state.
isMergedCell(row: number, column: number): Rect | nullregisterCommands(commands: SheetCommandBus): voidregisterQueries(queries: SheetQueryRegistry): voidregisterRangeMoves(registry: SheetRangeMoveRegistry): voidMoves complete merged ranges and rejects moves that split a merge.
registerRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetCellMergePluginState): CellMergeMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetCellMergePluginState;
}Registers one or more plugin-owned state records with the host manager.
Serialized CSR entries accepted by CellMergeMatrix.
Sparse value stored only at the top-left cell of a merged range.
interface SheetCellMergeActionDataSource extends SheetCellMergeCommandDataSourcereadonly cellContent: SheetCellMergeContentSourcereadCell(row: number, column: number): unknowninterface SheetMergeInput extends SheetRangeInputCommon range input accepted by explicit range commands.
readonly confirmation?: SheetMergeAnalysisanalyzeMergeCells(input: SheetRangeInput, dataSource: SheetCellMergeActionDataSource): SheetMergeAnalysis | nullcreateMergeCellsOperations(input: SheetRangeInput, dataSource: SheetCellMergeCommandDataSource): UpdateCellOTOperation<SheetCellMerge>[]createUnmergeCellsOperations(input: SheetRangeInput, dataSource: SheetCellMergeCommandDataSource): UpdateCellOTOperation<SheetCellMerge>[]readSheetCellMerges(dataEngine: DataEngine): CellMergeMatrix | nullReads merged-cell state published by SheetCellMergePlugin.
registerSheetCellMergeCommands(commands: SheetCommandBus, dataSource: SheetCellMergeActionDataSource): voidRegisters every command owned by SheetCellMergePlugin.
registerSheetCellMergeQueries(queries: SheetQueryRegistry, dataSource: SheetCellMergeActionDataSource): voidSheetCellMergeFieldKey: "sheet.cellMerge"DataEngine field owned by SheetCellMergePlugin.
analyzeMergeCells checks a proposed merge before it is committed. The error types describe conflicts with content or structural moves.
class SheetMergeRangeMoveError extends SearErrorA cell move that would split an existing merged range.
readonly code: "SHEET_MOVE_SPLIT_MERGE"Stable machine-readable identifier for this error category.
class SheetMergeStructureMoveError extends SearErrorA structure permutation would leave a merged range noncontiguous.
SheetMergeStructureMoveError(range: readonly readonly number[][]): SheetMergeStructureMoveErrorreadonly code: "SHEET_STRUCTURE_MOVE_SPLIT_MERGE"Stable machine-readable identifier for this error category.
readonly discardedCells: readonly SheetMergeDiscardedCell[]readonly end: readonly [number, number]readonly retainedCell: SheetMergeDiscardedCell | nullreadonly start: readonly [number, number]Portable boolean checkbox cell type, typed commands and stateless Sheet integration.
CheckboxCell stores a boolean cell value and its commit strategy interprets checkbox input.
class CheckboxCellCommitStrategy extends CellCommitStrategyDefinitionRetains checkbox identity for boolean edits, including cells governed by checkbox validation.
CheckboxCellCommitStrategy(hasRule?: (row: number, column: number): boolean): CheckboxCellCommitStrategyCreates a target predicate owned by the current editor.
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.
matches(context: CellCommitContext): booleanReports whether this strategy owns the target's edit semantics.
class CheckboxCellTypeDefinition extends CellTypeDefinitionAtomic catalog contribution for rendering, editing, display and clipboard behavior.
CheckboxCellTypeDefinition(hasRule?: (row: number, column: number): boolean): CheckboxCellTypeDefinitionBinds rule-aware edit conversion to one editor.
readonly type: "checkbox"Persisted feature identifier.
createClipboardCodec(): {
cellType: string;
decode: (data: unknown): {
type: string;
value: boolean;
} | null;
encode: (cell: { value?: unknown }): { value: unknown };
toPlainText: (cell: { value?: unknown }): string;
}Preserves checkbox identity on native copies; plain text remains TRUE/FALSE.
Creates the checkbox edit strategy.
createDisplayTextProvider(): {
cellType: string;
getDisplayText: (cell: { value?: unknown }): string;
}Provides stable boolean text for searches and measurements.
isStoredValue(cell: { value?: unknown }): booleanValidates persisted booleans before creating a glyph.
class CheckboxError extends SearErrorCheckbox-specific public error with structured context.
CheckboxError(code: CheckboxErrorCode, message: string, details?: SearErrorDetails): CheckboxErrorCreates a feature diagnostic.
interface CheckboxCellValue extends CellMatrixElementA checkbox's persisted boolean state.
Planned update owned by the ordinary cell-data plugin.
readonly cell: CellMatrixElement | nullReplacement cell; null clears it.
readonly column: numberAbsolute column.
readonly row: numberAbsolute row.
One checkbox diagnostic identity.
| Member | Value |
|---|---|
Invalid |
"CHECKBOX_INVALID" |
Conflict |
"CHECKBOX_CONTENT_CONFLICT" |
Limit |
"CHECKBOX_RANGE_LIMIT" |
One supported removal policy.
| Member | Value |
|---|---|
Clear |
"clear" |
Text |
"text" |
checkboxText(value: boolean): stringFormats the boolean display, editor and clipboard representation.
isCheckboxCell(cell: CellMatrixElement | null | undefined): cellReports whether a persisted value is a well-formed checkbox.
parseCheckboxText(text: string): boolean | nullConverts explicit boolean editor text without coercing numbers or other strings.
CheckboxCellType: "checkbox"Stable persisted identifier owned by the checkbox extension.
CheckboxMutationLimit: 10000Maximum number of persisted cells one checkbox command can change.
class SheetCheckboxPlugin extends Plugin<null>Stateless feature; persistent values, history and collaboration belong to the ordinary cell owner.
Installs all type capabilities atomically into the owning editor's registries.
apply(): nullThe feature never owns or directly applies cell state.
destroy(): voidRestores all replaced capabilities and releases handlers idempotently.
registerCommands(commands: SheetCommandBus): voidRegisters owner-targeted commands; each change is one staged cell transaction.
registerQueries(queries: SheetQueryRegistry): voidPublishes sparse range-state reads.
registerState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}No independent document state is registered.
static readonly symbol: typeof symbolEditor-local DI token.
Inherited from Plugin.
Read-only aggregate of existing checkbox states.
interface InsertCheckboxesInput extends SheetRangeInputConverts empty or explicit boolean cells; replacement of other content requires opt-in.
readonly checked?: booleanOptional forced initial state; otherwise existing boolean states are retained.
readonly replaceExisting?: booleanExplicitly replace other persisted content.
Editor-local dependencies; checkbox state stays in the cell-data owner.
readonly catalog: CellTypeCatalogCell-type extension catalog.
readonly formulas?: CellFormulaValueConverterRegistryFormula converter registry, when formula support is installed.
readonly inputValidation?: SheetCellInputValidationRegistryShared cell-edit validation registry.
createTransaction(writes: readonly CheckboxCellWrite[]): TransactionCreates a semantic cell-owner transaction without mutating live data.
forEachStored(range: SheetRangeInput, visit: (cell: CellMatrixElement | null, row: number, column: number): void): voidVisits persisted sparse entries inside the inclusive selection.
hasCheckboxRule(row: number, column: number): booleanReports a checkbox validation rule, including cells currently showing warning text.
isMergedCoveredCell(row: number, column: number): booleanTrue when a merged range hides this coordinate behind its anchor.
readCell(row: number, column: number): CellMatrixElement | nullReads current persisted cell values.
readShape(): readonly [number, number]Reads current Sheet dimensions.
validateValue(row: number, column: number, text: string): {
readonly message?: string;
readonly reject: boolean;
}Rejects incompatible existing validation on direct checkbox commands.
normalizeCheckboxRange(input: SheetRangeInput, shape: readonly [number, number]): SheetRangeInputValidates and orders a public range without limiting sparse read traversal by viewport.
Inserts checkbox cells in one cell-owner transaction.
Reads sparse checkbox state without traversing every empty coordinate.
RemoveCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { readonly mode?: CheckboxRemovalMode }, SheetCommandResult>Converts only existing checkbox cells to text or clears them.
SetCheckboxesCommand: SheetCommandDefinition<SheetRangeInput & { readonly checked: boolean }, SheetCommandResult>Sets only existing checkbox cells in the range.
Checks a mixed/unchecked range, or unchecks an entirely checked range.
Owner-composed Sheet format clearing without content deletion.
class SheetClearStylePlugin extends Plugin<null>Composes owner-defined format clearing; owns no persisted document or session state.
readonly warnOnDuplicateDepth: falseapply(): nullApplies a transaction to plugin-owned state and returns the next state.
registerCommands(commands: SheetCommandBus): voidregisterState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
static readonly symbol: typeof symbolInherited from Plugin.
Editor-local dependencies provided by the owning composition root.
readonly formats: SheetFormatTransferRegistryreadonly readShape: (): readonly [number, number]ClearRangeStylesCommand: SheetCommandDefinition<ClearRangeStylesInput, SheetCommandResult>Clears explicit formatting from one or more selections, preserving cell data.
Type-neutral Sheet clipboard traversal, serialization, and paste commands.
Range commands move Sheet content through the clipboard. A cut session tracks content until the paste commits.
class InMemorySheetClipboard extends SheetClipboardNode-safe clipboard used when a host does not expose system clipboard I/O.
read(): Promise<SheetClipboardPayload | null>write(payload: SheetClipboardPayload): Promise<void>Platform-neutral clipboard abstraction. Implementations own system I/O.
abstract read(): Promise<SheetClipboardPayload | null>abstract write(payload: SheetClipboardPayload): Promise<void>static readonly symbol: typeof symbolTransient cut intent shared by the sheets mounted in one workbook.
static readonly symbol: typeof symbolclass SheetClipboardPlugin extends Plugin<Record<string, never>>, PluginExtension<SheetCommandBus>Default sheet clipboard plugin. System clipboard I/O remains a host-owned SheetClipboardPort.
SheetClipboardPlugin(source: SheetClipboardDataSource, codec: SheetClipboardCodec): SheetClipboardPluginapply(state: Record<string, never>, _transaction: Transaction): Record<string, never>Applies a transaction to plugin-owned state and returns the next state.
registerCommands(commands: SheetCommandBus): voidRegisters the three semantic clipboard commands on this editor's bus.
registerState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: Record<string, never>;
}Registers one or more plugin-owned state records with the host manager.
Inherited from Plugin.
Platform-neutral clipboard abstraction. Implementations own system I/O.
abstract read(): Promise<SheetClipboardPayload | null>abstract write(payload: SheetClipboardPayload): Promise<void>static readonly symbol: typeof symbolOptional explicit range; omitted means the current editor selection.
readonly range?: SheetClipboardRangeInputInput for pasting a previously decoded or host-read clipboard payload.
readonly mode?: SheetPasteModeStructured channel selection. Plain-text payloads contain values only.
readonly payload: SheetClipboardPayloadreadonly target?: SheetClipboardCellPointTop-left target; omitted means the current selection's top-left cell.
interface SheetPasteRangeResult extends SheetCommandResultCommitted target range, used by hosts to select the pasted cells.
readonly range: SheetClipboardRangeInputreadonly workbookMove?: trueSelects which structured clipboard channels are applied by a paste command.
| Member | Value |
|---|---|
All |
"all" |
Formats |
"formats" |
Values |
"values" |
type SheetClipboardPort = Pick<SheetClipboard, "read" | "write">Structural port retained as a lightweight host-adapter contract.
Cancels a pending cut without changing any cell content.
Typed command that snapshots a range without mutating sheet state.
Typed command that snapshots and clears a range in one sheet transaction.
Typed command that decodes and writes a payload through the normal sheet transaction boundary.
The codec represents cell values and merged ranges in a portable payload before a paste command reads them.
class DefaultSheetClipboardCodec extends SheetClipboardCodecDefault codec that delegates cell serialization to the cell-type registry.
decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRangeencode(range: SheetRangeBounds, source: SheetClipboardDataSource, visibleRowsOnly?: boolean): SheetClipboardPayloadclass SheetClipboardError extends SearErrorPublic error raised when a clipboard command cannot satisfy its contract.
SheetClipboardError(code: SheetClipboardErrorCode, message: string, details?: SearErrorDetails): SheetClipboardErrorreadonly code: SheetClipboardErrorCodeStable machine-readable identifier for this error category.
Identity of the mounted sheet, stable across workbook sheet remounts.
SheetClipboardSheetIdentity(id: string): SheetClipboardSheetIdentityreadonly id: stringstatic readonly symbol: typeof symbolCodec extension point for clipboard envelope and external formats. Cell types register their own handlers separately.
decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRangeencode(range: SheetRangeBounds, source: SheetClipboardDataSource, visibleRowsOnly?: boolean): SheetClipboardPayloadinterface SheetClipboardCommandResult extends SheetCommandResultResult shared by copy and cut commands.
readonly payload: SheetClipboardPayloadreadonly range: SheetClipboardRangeInputData source required by the clipboard plugin; selection and storage stay replaceable.
readonly cutSession?: SheetClipboardCutSessionreadonly cutSourceId?: stringreadonly formatTarget: PluginKeycaptureMergedRanges(range: SheetRangeBounds): readonly SheetClipboardMergedRange[]captureOwnerData(range: SheetRangeBounds): readonly SheetPortableClipboardTransfer[]captureOwnerFormats(range: SheetRangeBounds): readonly SheetPortableFormatTransfer[]clearOwnerData(range: SheetRangeBounds): readonly SheetClipboardTransferPlan[]clearOwnerFormats(range: SheetRangeBounds): readonly SheetFormatTransferPlan[]createClipboardCutId(): stringgetColumnCount(): numbergetMergedRange(row: number, column: number): SheetRangeBounds | nullOptional host projection for rejecting writes hidden by merged cells.
getRowCount(): numbergetSelection(): SheetRangeBounds | nullisRowVisible(row: number): booleanplanOwnerData(requests: readonly SheetClipboardTransferRequest[]): readonly SheetClipboardTransferPlan[]planOwnerFormats(captured: readonly SheetPortableFormatTransfer[], target: SheetRangeBounds): readonly SheetFormatTransferPlan[]planPasteMergedRanges(merges: readonly SheetClipboardMergedRange[], target: SheetClipboardCellPoint): SheetClipboardMergePlanplanRangeMove(source: SheetClipboardRangeInput, destination: SheetClipboardRangeInput): readonly SheetRangeMovePlan[]prepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): voidreadCell(row: number, column: number): CellMatrixElement | nullreadCellFormat(row: number, column: number): CellFormat | nullreadCopyCell(row: number, column: number): CellMatrixElement | nullOptional displayed value for copy sources that have no persisted cell.
readCopyValueCell(row: number, column: number): CellMatrixElement | nullOptional calculated cell snapshot for values-only paste.
scheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>validateCutCell(row: number, column: number): SheetCellInputValidationResultOptional protection check before cutting an occupied source cell.
validatePasteCell(row: number, column: number, cell: CellMatrixElement | null): SheetCellInputValidationResultOptional editor-local validation applied before any pasted value is written.
Context supplied to codecs so formula-aware implementations can rebase references on paste.
readonly target: SheetClipboardCellPointreadonly valuesOnly?: booleanDecoded value and format matrices ready for parallel paste transactions.
readonly formats?: readonly readonly CellFormat | null[][]Present only when the source supplied editor-native format metadata.
readonly merges?: readonly SheetClipboardMergedRange[]readonly ownerDataInstances?: readonly SheetClipboardDataInstance[]readonly ownerFormats?: readonly SheetPortableFormatTransfer[]readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]readonly rows: readonly SheetClipboardDecodedRow[]Inclusive merged range relative to the copied range's top-left cell.
readonly end: SheetClipboardCellPointreadonly start: SheetClipboardCellPointMerge-owner operation plan produced by the active sheet adapter.
readonly operations: readonly Operation[]Platform-neutral clipboard data. It is transient and is not a persistence envelope.
readonly plainText: stringPlain text representation suitable for external applications.
readonly structured?: SheetClipboardStructuredPayloadOptional editor-native representation preserving cell type and metadata.
Inclusive range accepted by clipboard commands.
readonly end: SheetClipboardCellPointreadonly start: SheetClipboardCellPointEditor-owned structured range data carried inside a clipboard payload.
readonly cutId?: stringTransient identifier linking a cut and a subsequent paste in Sheet history.
readonly formats: readonly readonly CellFormat | null[][]Parallel explicit-format rows. Null means General/no explicit format.
readonly isCut?: trueA cut move keeps formula references anchored to their original targets.
readonly kind: "searsuite.sheet-range"readonly merges?: readonly SheetClipboardMergedRange[]Merge geometry relative to this payload's top-left cell.
readonly ownerData?: readonly SheetPortableClipboardTransfer[]readonly ownerDataByRow?: readonly readonly SheetPortableClipboardTransfer[][]readonly ownerFormats?: readonly SheetPortableFormatTransfer[]Optional persisted-format snapshots supplied by their state owners.
readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]Per-row format snapshots for a compacted visible-row selection.
readonly rows: readonly SheetClipboardRow[]readonly source: SheetClipboardCellPointOriginal top-left coordinate, supplied to cell-type paste codecs.
readonly sourceRows?: readonly number[]Original row coordinates when a filtered selection is compacted on copy.
readonly valueRows?: readonly SheetClipboardRow[]Calculated cell snapshots for a values-only paste.
readonly version: 3Supported sheet clipboard error code values.
| Member | Value |
|---|---|
NoSelection |
"SEAR_SHEET_CLIPBOARD_NO_SELECTION" |
InvalidPayload |
"SEAR_SHEET_CLIPBOARD_INVALID_PAYLOAD" |
TargetOutOfBounds |
"SEAR_SHEET_CLIPBOARD_TARGET_OUT_OF_BOUNDS" |
TargetIntersectsMergedCells |
"SEAR_SHEET_CLIPBOARD_TARGET_INTERSECTS_MERGED_CELLS" |
SourceIntersectsMergedCells |
"SEAR_SHEET_CLIPBOARD_SOURCE_INTERSECTS_MERGED_CELLS" |
NoVisibleRows |
"SEAR_SHEET_CLIPBOARD_NO_VISIBLE_ROWS" |
InputRejected |
"SEAR_SHEET_CLIPBOARD_INPUT_REJECTED" |
type SheetClipboardCellPoint = readonly [number, number]A zero-based cell coordinate expressed as [row, column].
type SheetClipboardDecodedRow = readonly CellMatrixElement | null[]Decoded cells ready for a paste transaction.
type SheetClipboardRow = readonly CellClipboardCellPayload | null[]One row in a structured clipboard range, including empty cells.
SHEET_CLIPBOARD_MIME_TYPE: "application/x-searsuite-sheet-range"MIME type that a browser adapter may use for the structured payload.
Current version of the transient structured sheet clipboard payload.
DI token for the editor-local clipboard codec.
DI token for the editor-local clipboard data source.
Stable public errors raised by the sheet clipboard contract.
Editor bridges that connect committed collaborative transactions to host transports.
ConnectSheetCollaborationCommand starts a session over a host-provided transport. The status observation reports connection changes.
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.
CollaborationChannel(transport: CollabTransport | (): CollabTransport, platform: Pick<Platform, "warn" | "createId">): CollaborationChannelapplyExternalEvent(event: CollaborationExternalEvent): voidApplies one transport event while the owning editor dispatches its command.
attachRemoteApplier(applier: CollaborationRemoteOperationApplier): (): voidAttaches the one currently mounted editor and replays queued remote effects in revision order.
connect(options: CollaborationConnectOptions): Promise<void>destroy(): voiddisconnect(): voidenforceCommandBoundary(assertWrite: (): void, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value, dispatchExternalEvent: (event: CollaborationExternalEvent): void): voidRestricts public channel mutations after its owning editor finishes assembly.
registerContributor(contribution: CollaborationContribution): voidInstalls one open OT owner contract for the lifetime of this channel.
submitLocal(ownerId: string, operations: readonly OTOperation[]): voidQueues a committed local operation batch through the shared collaboration engine.
subscribeStatus(listener: (status: CollaborationStatus): void): (): voidclass CollaborationChannelError extends SearErrorStable public failures raised by a collaboration channel host.
CollaborationChannelError(code: CollaborationChannelErrorCode, message: string, details?: Record<string, unknown>): CollaborationChannelErrorreadonly code: CollaborationChannelErrorCodeStable machine-readable identifier for this error category.
Abstract transport layer. Swap implementations (WebSocket, BroadcastChannel, polling, etc.) without touching the plugin logic.
abstract connect(options: CollaborationTransportConnectOptions): Promise<void>Opens the collaboration transport and begins receiving messages.
abstract disconnect(): voidCloses the collaboration transport and releases its listeners.
abstract send(message: CollaborationSubmission): voidSends one encoded collaboration message through the transport.
abstract subscribe(handler: (message: CollaborationServerMessage): void): (): voidSubscribes to server messages and returns an idempotent disposer.
static readonly symbol: symbolDI token for resolving CollabTransport.
class HeadlessCollabTransport extends CollabTransportCollaboration transport that keeps the plugin local to the current host.
connect(_options: CollaborationTransportConnectOptions): Promise<void>Opens the collaboration transport and begins receiving messages.
disconnect(): voidCloses the collaboration transport and releases its listeners.
send(_message: CollaborationSubmission): voidSends one encoded collaboration message through the transport.
subscribe(_handler: (message: CollaborationServerMessage): void): (): voidSubscribes without producing network messages.
static readonly symbol: symbolDI token for resolving HeadlessCollabTransport.
class SheetCollaborationPlugin extends Plugin<null>, CollaborationSessionThin Sheet bridge around the editor-independent collaboration engine.
SheetCollaborationPlugin(channelBinding: CollaborationChannelBinding, plugins: PluginManager, commands: SheetCommandBus): SheetCollaborationPluginreadonly interestedIn: string[]Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly warnOnDuplicateDepth: falseapply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
connect(options: CollaborationConnectOptions): Promise<void>destroy(): voiddisconnect(): voidonTransactionCommitted(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.
transactionA committed transaction from the completed pipeline.
registerCommands(commands: SheetCommandBus): voidregisterObservations(observations: ObservationRegistry): voidregisterState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
start(): voidstatic readonly symbol: typeof symbolDI value used to distinguish editor-owned channels from host-retained channels.
readonly channel: CollaborationChannelreadonly owner: "editor" | "host"readonly symbol: symbolHost-facing lifecycle API independent from a concrete editor bridge.
readonly error: unknownreadonly pendingCount: numberreadonly resourceId: string | nullreadonly revision: numberreadonly state: CollaborationConnectionStateConnection parameters for one collaboration resource.
interface ConnectSheetCollaborationResult extends SheetCommandResultCommand result that resolves when the collaboration transport is connected.
readonly completion: Promise<void>Optional asynchronous completion of a command-owned external effect.
| Member | Value |
|---|---|
BoundaryInstalled |
"SEAR_COLLABORATION_BOUNDARY_INSTALLED" |
AttachmentConflict |
"SEAR_COLLABORATION_ATTACHMENT_CONFLICT" |
ContributorConflict |
"SEAR_COLLABORATION_CONTRIBUTOR_CONFLICT" |
Destroyed |
"SEAR_COLLABORATION_CHANNEL_DESTROYED" |
Public lifecycle state of one collaboration session.
| Member | Value |
|---|---|
Disconnected |
"disconnected" |
Connecting |
"connecting" |
Online |
"online" |
Error |
"error" |
Editor-local collaboration connection and synchronization status.
ConnectSheetCollaborationCommand: SheetCommandDefinition<CollaborationConnectOptions, ConnectSheetCollaborationResult>Starts a Sheet collaboration session through the editor command bus.
Disconnects a Sheet collaboration session through the editor command bus.
Public lifecycle state of one collaboration session.
Committed local operations are submitted to the channel; remote operations return through the apply commands and are rebased against pending work.
Remote operation batch delivered to the currently mounted editor bridge.
readonly operations: readonly OTOperation[]readonly ownerId: stringreadonly serverRevision: numberInput for applying operations received from a collaboration transport.
readonly operations: readonly Operation[]Remote operations after local OT transformation.
readonly ownerId: stringStable collaboration owner id resolved through the local plugin registry.
Canonical operation batch accepted and ordered by the authority.
readonly baseRevision: numberreadonly clientId: stringreadonly kind: "accepted"readonly operationId: stringreadonly operationType: CollaborationOperationTypereadonly ownerId: stringreadonly payload: OTEncodedValuereadonly protocolVersion: 1readonly resourceId: stringreadonly serverRevision: numberExplicit authority rejection; clients must not infer recovery from dropped frames.
readonly code: stringreadonly kind: "rejected"readonly message: stringreadonly operationId?: stringreadonly protocolVersion: 1readonly resourceId: stringClient submission before the authority assigns a canonical revision.
readonly baseRevision: numberreadonly clientId: stringreadonly kind: "submit"readonly operationId: stringreadonly operationType: CollaborationOperationTypereadonly ownerId: stringreadonly payload: OTEncodedValuereadonly protocolVersion: 1readonly resourceId: stringOrdered catch-up response sent when a transport joins a resource.
readonly batches: readonly CollaborationAcceptedBatch[]readonly fromRevision: numberreadonly kind: "sync"readonly protocolVersion: 1readonly resourceId: stringreadonly serverRevision: numbertype CollaborationExternalEvent = {
readonly epoch: number;
readonly kind: "connected";
readonly resourceId: string;
} | {
readonly epoch: number;
readonly error: unknown;
readonly kind: "failed";
readonly resourceId: string;
} | {
readonly epoch: number;
readonly kind: "message";
readonly message: CollaborationServerMessage;
}Transport event returned to the owning editor's command bus.
type CollaborationRemoteOperationApplier = (effect: CollaborationRemoteOperations): voidApplyRemoteOperationsCommand: SheetCommandDefinition<SheetApplyRemoteOperationsInput, SheetCommandResult>Command that applies remote collaboration operations through the normal pipeline.
ApplySheetCollaborationEventCommand: SheetCommandDefinition<CollaborationExternalEvent, SheetCommandResult>Routes an external transport event into the owning Sheet command bus.
Current collaboration wire protocol version.
Sheet data validation rules, commands, queries, and editor-local evaluation.
SetDataValidationRuleCommand changes a range’s rule. Queries return the current rules and any issue for a cell.
formatDropdownSelection(values: readonly string[]): stringSerializes labels without losing embedded commas, quotes or surrounding spaces.
parseDropdownSelection(text: string): string[]Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.
readSheetDataValidations(dataEngine: DataEngine): DataValidationMatrix | nullReads the current validation matrix from the sheet data view.
resolveDropdownSelection(text: string, availableLabels: readonly string[]): string[]Uses an exact option label when comma parsing cannot describe valid choices.
Reads evaluator availability for the current editor.
ClearDataValidationRulesCommand: SheetCommandDefinition<{ readonly range?: SheetRangeInput }, SheetCommandResult>Removes every rule, or only rule fragments within a range.
ReadDataValidationCellRulesQuery: SheetQueryDefinition<readonly [number, number], readonly PositionedDataValidationRule[]>Reads the rules that cover one cell.
ReadDataValidationIssueQuery: SheetQueryDefinition<readonly [number, number], DataValidationIssue | null>Reads a definite validation failure for the current value of one cell.
ReadDataValidationRulesQuery: SheetQueryDefinition<void, readonly PositionedDataValidationRule[]>Reads all persisted validation rules and their range anchors.
RemoveDataValidationRuleCommand: SheetCommandDefinition<{ readonly id: string }, SheetCommandResult>Removes a rule by its stable identifier.
SetDataValidationRuleCommand: SheetCommandDefinition<SetDataValidationRuleInput, SheetCommandResult>Creates or updates a validation rule for a sheet range.
SetNumericValidationControlValueCommand: SheetCommandDefinition<{
readonly column: number;
readonly row: number;
readonly value: number;
}, SheetCommandResult>Writes a numeric rule control through the ordinary SheetData transaction owner.
SheetDataValidationFieldKey: "sheet.dataValidation"Sheet data-view field contributed by the validation plugin.
Removes one editor-local external data-validation evaluator.
evaluateDataValidation checks a candidate value against a rule. Register an external evaluator for conditions the built-in evaluator cannot resolve.
Host extension point for structured values and custom formulas.
canEvaluate(kind: DataValidationKind): booleanWhether this editor can evaluate the kind without guessing a result.
enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): voidSeals post-assembly writes without adding work to evaluator reads.
evaluate(condition: DataValidationCondition, text: string, row: number, column: number): boolean | nullregister(kind: DataValidationKind, evaluator: DataValidationExternalEvaluator): (): voidunregister(id: number): voidRemoves a registration through the owning command after assembly.
class DataValidationMatrix extends CSRMatrix<DataValidationRule[] | null>Sparse range anchors for validation rules.
DataValidationMatrix(data?: {
readonly data: DataValidationRule[] | null[];
readonly indices: number[];
readonly indptr: number[];
}, shape?: [number, number]): DataValidationMatrixaddItem(row: number, column: number, rules: DataValidationRule[] | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
clone(): thisCreates an independent copy of this value and its mutable data.
findRules(row: number, column: number): PositionedDataValidationRule[]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.
rowThe row index.
replaceRules(entries: readonly PositionedDataValidationRule[]): voidsetItem(row: number, column: number, rules: DataValidationRule[] | null): thisInherited from CSRMatrix.
class SheetDataValidationPlugin extends Plugin<SheetDataValidationPluginState>Base contract implemented by sheet and document plugins.
Plugins own state, transaction algebra, persistence and neutral data projections. Presentation and native input are contributed by independent view extensions.
Document-state export modules owned by this plugin state.
Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
readonly warnOnDuplicateDepth: falseapply(state: SheetDataValidationPluginState, transaction: Transaction): SheetDataValidationPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
dispose(): voidonTransactionCommitted(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.
transactionA committed transaction from the completed pipeline.
readIssue(row: number, column: number): DataValidationIssue | nullreadNumericControl(row: number, column: number): NumericValidationControl | nullReturns a definite failure for the cell's current value, including values predating the rule.
registerCapabilities(registry: RuntimeCapabilityRegistry): voidregisterClipboardTransfers(registry: SheetClipboardTransferRegistry): voidregisterCommands(commands: SheetCommandBus): voidregisterCommitStrategies(registry: CellCommitStrategyRegistry): voidregisterObservations(registry: ObservationRegistry): voidregisterQueries(queries: SheetQueryRegistry): voidregisterRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetDataValidationPluginState): DataValidationMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetDataValidationPluginState;
}Registers one or more plugin-owned state records with the host manager.
sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
validate(row: number, column: number, text: string): SheetCellInputValidationResultType-specific settings used to evaluate a cell value.
readonly dropdownMode?: DataValidationDropdownModereadonly formula?: stringreadonly integerOnly?: booleanreadonly kind: DataValidationKindreadonly operator?: DataValidationOperatorreadonly options?: readonly DataValidationOption[]readonly secondValue?: stringreadonly showDropdownArrow?: booleanreadonly sourceRange?: {
readonly end: readonly [number, number];
readonly start: readonly [number, number];
}readonly textMode?: DataValidationTextModereadonly value?: stringreadonly column: numberreadonly currentDateTime?: numberreadonly evaluateExternal?: (condition: DataValidationCondition, text: string, row: number, column: number): boolean | nullHost contribution for formula results and structured cell types. Null means unavailable.
readonly readSourceValues?: (start: readonly [number, number], end: readonly [number, number]): readonly string[]readonly row: numberA definite failure of the current cell value against a validation rule.
One displayable dropdown choice and its optional color.
One independently editable rule stored at the top-left cell of its range.
readonly condition: DataValidationConditionreadonly endColumn: numberreadonly endRow: numberreadonly errorMessage?: stringreadonly id: stringreadonly inputMessage?: stringreadonly inputPolicy: DataValidationInputPolicyreadonly kind: NumericValidationControlKindreadonly value: numberA rule with its persisted range anchor.
interface SetDataValidationRuleInput extends SheetRangeInputTarget range and rule settings for creating or editing a rule.
readonly id?: stringreadonly rule: Omit<DataValidationRule, "id" | "endRow" | "endColumn">readonly createId: (): stringreadonly createNumericControlValueTransaction?: (row: number, column: number, value: number): Transactionreadonly currentDateTime?: (): numberreadonly evaluateFormulaInput?: (formula: string, row: number, column: number): unknownreadonly evaluators: DataValidationEvaluatorRegistryreadonly readSourceValues?: (start: readonly [number, number], end: readonly [number, number]): readonly string[]readonly readValue?: (row: number, column: number): unknownreadonly dataValidations: DataValidationMatrixDropdown selection mode stored with a rule.
| Member | Value |
|---|---|
Multiple |
"multiple" |
Single |
"single" |
Invalid input policy stored with a rule.
| Member | Value |
|---|---|
Reject |
"reject" |
Warn |
"warn" |
One supported validation value family.
| Member | Value |
|---|---|
Date |
"date" |
Dropdown |
"dropdown" |
Number |
"number" |
Person |
"person" |
Text |
"text" |
Checkbox |
"checkbox" |
Document |
"document" |
Progress |
"progress" |
Rating |
"rating" |
Attachment |
"attachment" |
IdentityCard |
"identityCard" |
Image |
"image" |
Link |
"link" |
Formula |
"formula" |
Phone |
"phone" |
One comparison operator for a validation condition.
| Member | Value |
|---|---|
Equal |
"equal" |
Greater |
"greater" |
GreaterOrEqual |
"greaterOrEqual" |
NotEqual |
"notEqual" |
Between |
"between" |
Less |
"less" |
LessOrEqual |
"lessOrEqual" |
NotBetween |
"notBetween" |
Contains |
"contains" |
EndsWith |
"endsWith" |
NotContains |
"notContains" |
StartsWith |
"startsWith" |
Text comparison mode stored with a rule.
| Member | Value |
|---|---|
Content |
"content" |
Length |
"length" |
type DataValidationExternalEvaluator = (condition: DataValidationCondition, text: string, row: number, column: number): boolean | nulltype NumericValidationControlKind = typeof DataValidationKind.Progress | typeof DataValidationKind.RatingevaluateDataValidation(condition: DataValidationCondition, text: string, context: DataValidationEvaluationContext): boolean | nullReturns null when a host-owned value type has no evaluator. Empty input is allowed.
hasIntegerSolution(operator: DataValidationOperator, first: number, second?: number): booleanWhether an integer can satisfy a numeric comparison. Bounds must already be finite.
parseDataValidationDate(value: string): number | nullParses common year-first calendar dates without accepting rollover dates.
Optional dropdown cell interactions over validation-owned rules.
Bounded label and rule metadata, without traversing source-range choices.
readDropdownIndicator(row: number, column: number, options: SheetDropdownOptions): DropdownIndicator | nullCell readers obtain the value and available options from validation-owned rules; clear and pick commands write the chosen value.
Absolute target cell; all picker reads are editor-local.
interface DropdownCellOption extends DataValidationOptionDisplay choice with an optional primitive source value that can be persisted directly.
readonly value?: number | booleaninterface DropdownCellSnapshot extends DropdownCellInputImmutable current rule and cell projection.
readonly inputMessage?: stringSelection prompt from the validation owner.
readonly multiple: booleanWhether choices accumulate.
readonly options: readonly DropdownCellOption[]Ordered, distinct current choices.
readonly ruleId: stringStable validation owner id.
readonly selected: readonly string[]Current selected labels, including values absent from the rule.
readonly showArrow: booleanWhether the cell shows its arrow.
assertDropdownCell(input: DropdownCellInput, shape: readonly number[]): voidValidates a cell before any source traversal or mutation.
planDropdownValue(state: DropdownCellSnapshot | null, input: PickDropdownOptionInput): string | number | boolean | nullComputes a selection without mutating state; stale or removed choices fail explicitly.
readDropdownCell(input: DropdownCellInput, options: SheetDropdownOptions): DropdownCellSnapshot | nullResolves the last covering dropdown rule and bounded, distinct choices.
formatDropdownSelection(values: readonly string[]): stringSerializes labels without losing embedded commas, quotes or surrounding spaces.
parseDropdownSelection(text: string): string[]Reads comma-separated labels with doubled-quote escaping; malformed input remains a single literal.
Clears the cell value while retaining validation rules.
Reads the current dropdown without exposing a feature matrix.
OpenDropdownPickerCommand asks the host to show a picker. The picker request carries the cell and option data it needs.
class DropdownError extends SearErrorStructured feature diagnostic.
DropdownError(code: DropdownErrorCode, message: string, details?: SearErrorDetails): DropdownErrorCreates a public dropdown diagnostic.
class SheetDropdownPlugin extends Plugin<null>Stateless dropdown interaction; rules and values retain their existing document owners.
Receives owner-scoped projections and semantic transaction factories.
apply(): nullMutations belong to validation and cell owners.
destroy(): voidReleases transient host subscriptions.
readIndicator(row: number, column: number): DropdownIndicator | nullregisterCommands(commands: SheetCommandBus): voidRegisters value changes and a transient picker request command.
registerObservations(registry: ObservationRegistry): voidHost listener failures are isolated by the editor observation registry.
registerQueries(queries: SheetQueryRegistry): voidPublishes a typed, current-cell query.
registerState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}No duplicate document field is created.
static readonly symbol: typeof symbolEditor-local service token.
Inherited from Plugin.
interface PickDropdownOptionInput extends DropdownCellInputTarget and choice to set, or toggle in multiple-selection mode.
Dependencies supplied by the composition root; persistent data stays with its original owners.
readonly queries: SheetQueryRegistryEditor-local query bus for validation-owner projections.
readonly validation: SheetCellInputValidationRegistryShared edit validation, including overlapping rules.
createTypedValueTransaction(row: number, column: number, value: number | boolean): TransactionOptionally persists a referenced primitive without converting it to text.
createValueTransaction(row: number, column: number, text: string | null): TransactionPlans a text or empty replacement as an ordinary cell-owner transaction.
forEachSourceValue(start: readonly [number, number], end: readonly [number, number], visit: (display: unknown, raw?: unknown): void): voidVisits nonempty source values in provider order; raw preserves typed values behind formatted labels.
readShape(): readonly [number, number]Reads dimensions for coordinate validation.
readText(row: number, column: number): stringReads display text, including formula results and structured cells.
One displayable dropdown choice and its optional color.
One public dropdown error code.
| Member | Value |
|---|---|
Invalid |
"DROPDOWN_INVALID" |
Stale |
"DROPDOWN_STALE" |
Limit |
"DROPDOWN_LIMIT" |
Conflict |
"DROPDOWN_CONFLICT" |
Shared option and source traversal budgets.
readonly Options: 1000readonly SourceValues: 10000Transient host request; no document or remount session state is stored.
Requests the host picker for one current dropdown cell.
Picks one valid option through a cell-owner transaction.
DropdownMode: {
readonly Multiple: "multiple";
readonly Single: "single";
}Selection modes for dropdown validation.
Sparse Sheet duplicate-highlight state and duplicate row commands.
Highlight commands mark duplicate rows without deleting them; the read helper exposes the marks for rendering.
class DuplicateMatrix extends CSRMatrix<SheetDuplicateHighlight | null>Sparse duplicate-highlight matrix. An absent cell has no duplicate marker.
DuplicateMatrix(data?: DuplicateMatrixData, shape?: [number, number]): DuplicateMatrixCreates a sparse duplicate-highlight matrix from serialized CSR data.
addItem(row: number, col: number, value: templateLiteral | null): thisStores a duplicate highlight through the CSR API, removing the entry for null.
setItem(row: number, col: number, value: templateLiteral | null): thisStores a duplicate highlight. Null is represented by removing the sparse entry.
Inherited from CSRMatrix.
class SheetDuplicatePlugin extends Plugin<SheetDuplicatePluginState>Plugin that owns duplicate-highlight data and duplicate row commands.
SheetDuplicatePlugin(state: SheetDuplicatePluginState, sheetData: SheetDataPlugin, cellCodecs: CellClipboardCodecRegistry, readDisplayText?: (row: number, column: number, cell: CellMatrixElement | null): string, displayedValueChanges?: SheetDisplayedValueChanges): SheetDuplicatePluginConstructs the plugin around a shared sparse duplicate-highlight matrix.
SheetDuplicatePlugin owns its persisted state module.
interestedIn: string[]Duplicate highlights follow direct updates and all sheet structure changes.
readonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Duplicate-highlight transactions share the registered MatrixOT algebra.
readonly warnOnDuplicateDepth: falseDuplicate state is data-only and does not use render-depth diagnostics.
apply(pluginState: SheetDuplicatePluginState, transaction: Transaction): SheetDuplicatePluginState | nullApplies direct duplicate-highlight and structural matrix operations.
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.
transactionA committed transaction from the completed pipeline.
registerCellStyles(registry: SheetCellStyleRegistry): voidregisterCommands(commands: SheetCommandBus): voidRegisters duplicate commands owned by this plugin.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes this owner's cell state to atomic range moves.
registerRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetDuplicatePluginState): DuplicateMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetDuplicatePluginState;
}Registers duplicate state for commands, projections, and collaboration.
Document-state export contribution for duplicate highlights.
Stable plugin key shared by all duplicate plugin instances.
static readonly symbol: symbolDI token for resolving the duplicate plugin.
Serialized sparse entries accepted by DuplicateMatrix.
interface SheetDuplicateCommandDataSource extends SheetCommandRangeDimensionsState access required by duplicate commands.
readonly duplicateTarget: PluginKeyreadonly sheetDataTarget: PluginKeyreadCell(row: number, column: number): CellMatrixElement | nullreadCellText(cell: CellMatrixElement, row: number, column: number): stringreadDisplayedText(row: number, column: number): stringreadDuplicateHighlight(row: number, column: number): templateLiteral | nullinterface SheetDuplicateHighlightInput extends SheetRangeInputPublic input for duplicate highlighting.
State owned by SheetDuplicatePlugin.
Sparse matrix containing duplicate highlight settings.
| Member | Value |
|---|---|
First |
"first" |
Last |
"last" |
type SheetDuplicateHighlight = HexColorA persisted duplicate-highlight color represented as a hexadecimal color.
assertSheetDuplicateHighlight(value: unknown): valueAsserts that a value is a supported duplicate-highlight color.
createClearDuplicateHighlightOperations(input: SheetDuplicateClearInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]Creates sparse update operations that remove duplicate highlights from a range.
createHighlightDuplicateOperations(input: SheetDuplicateHighlightInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]Creates sparse update operations for duplicate-value highlighting.
isSheetDuplicateHighlight(value: unknown): valueReturns whether a value is a supported duplicate-highlight color.
readSheetDuplicateHighlights(dataEngine: DataEngine): DuplicateMatrix | nullReads duplicate highlights published by SheetDuplicatePlugin.
ClearDuplicateHighlightsCommand: SheetCommandDefinition<SheetDuplicateClearInput, SheetCommandResult>Public command for clearing duplicate highlights in a range.
HighlightDuplicateRowsCommand: SheetCommandDefinition<SheetDuplicateHighlightInput, SheetCommandResult>Public command for highlighting duplicate cell values in a range.
SheetDuplicateFieldKey: "sheet.duplicateHighlights"DataEngine field owned by SheetDuplicatePlugin.
Clear removes only highlight state. Delete removes the selected duplicate rows through Sheet operations.
interface SheetDuplicateClearInput extends SheetRangeInputPublic input for clearing duplicate highlights.
interface SheetDuplicateDeleteInput extends SheetRangeInputPublic input for duplicate deletion.
readonly columns?: readonly number[]readonly headerRow?: booleanreadonly keep?: SheetDuplicateKeepModecreateDeleteDuplicateRowsOperations(input: SheetDuplicateDeleteInput, dataSource: SheetDuplicateCommandDataSource): DeleteRowOTOperation<CellMatrixElement>[]Creates sheet-data operations that clear duplicate row contents in the selected range.
registerSheetDuplicateCommands(commands: SheetCommandBus, dataSource: SheetDuplicateCommandDataSource): voidRegisters duplicate commands owned by SheetDuplicatePlugin.
Public command for deleting duplicate row contents in a range.
Versioned export envelopes, document-state codec registries, and durable persistence boundaries.
class DocumentStateCodecRegistry<TState>Registry that composes document-state modules without central field enumeration.
deserialize(modules: readonly SearDocumentStateModuleFile[], path: string): Partial<TState>Deserializes registered modules into one partial document state.
register(codec: DocumentStateCodec<TState>): thisRegisters a module codec. Duplicate keys are rejected.
registerContribution(contribution: DocumentStateModuleContribution<unknown, object>): thisRegisters the codec from a plugin-owned document-state contribution.
serialize(state: TState): SearDocumentStateModuleFile[]Serializes every registered module whose codec returns a payload.
interface DocumentStateCodec<TState>Codec contributed by the owner of one document-state module.
readonly key: stringStable module key written to persisted files.
deserialize(payload: JsonValue, path: string): Partial<TState>Restores the module-owned part of a document state.
serialize(state: TState): unknownSerializes the module-owned part of a document state.
interface DocumentStateModuleContribution<TOwnerState, TDocumentState>Export contribution owned by one document-state owner.
readonly codec: DocumentStateCodec<TDocumentState>JSON codec used for this module in stable export files.
readonly key: stringStable module key written to persisted files.
capture(ownerState: TOwnerState): Partial<TDocumentState> | undefinedCaptures this owner state into the aggregate document-state snapshot.
class ExportError extends SearErrorError thrown when a persisted workbook payload cannot be encoded or decoded.
ExportError(code: ExportErrorCode, message: string, details?: SearErrorDetails): ExportErrorreadonly code: ExportErrorCodeStable machine-readable error code.
One registered document-state module in a stable export file.
One formula cell's workbook-qualified reference targets.
readonly col: numberreadonly formula: stringreadonly references: readonly {
readonly sheetId: string;
readonly sheetName: string;
}[]readonly row: numberreadonly sheetId: stringStable persisted representation of one Sheet document state.
readonly kind: "sheet"Sheet payload kind.
readonly modules: readonly SearDocumentStateModuleFile[]Registered document-state modules.
interface SearWorkbookFile<TSheetDescriptor>Stable persisted representation of a Workbook document state.
readonly format: "searsuite.workbook"Stable file-format identifier.
readonly workbook: {
readonly formulaBindings?: readonly SearFormulaBindingFile[];
readonly id: string;
readonly metadata?: Readonly<Record<string, JsonValue>>;
readonly sheets: readonly TSheetDescriptor[];
readonly sheetStates: Readonly<Record<string, SearSheetDocumentFile>>;
}Persisted workbook document state.
Machine-readable export error code type.
| Member | Value | Description |
|---|---|---|
duplicateCodec |
"SEAR_EXPORT_DUPLICATE_CODEC" |
Two codecs attempted to own the same persisted module key. |
codecNotFound |
"SEAR_EXPORT_CODEC_NOT_FOUND" |
A persisted module could not be restored because its owner is not registered. |
invalidFormat |
"SEAR_EXPORT_INVALID_FORMAT" |
The persisted payload does not match the expected object shape. |
SearWorkbookFileFormat: "searsuite.workbook"Current stable workbook JSON format identifier.
alias ExportErrorCodeValue = ExportErrorCodeStable machine-readable error codes owned by the export plugin.
cloneJsonRecord(value: Readonly<Record<string, unknown>> | undefined, path: string): Readonly<Record<string, JsonValue>> | undefinedNarrows a runtime value to a JSON-compatible metadata record.
cloneJsonValue<TValue>(value: TValue, path?: string): TValueClones a JSON-compatible value and rejects values that cannot be persisted as JSON.
readRecord(value: unknown, path: string): Record<string, unknown>Narrows a runtime value to a plain object.
Sheet range filtering with independent rules and row visibility.
A filter definition names the range and its column rules. Value queries provide the choices shown in a filter menu.
Parameters for a bounded distinct-value query.
readonly column: numberreadonly includeBlank?: booleanIncludes blank cells even when a host's visible blank label matches the search text.
readonly limit?: numberreadonly search?: stringA rule attached to one column within a filter range.
readonly column: numberZero-based sheet column index.
readonly predicate: SheetFilterPredicatePredicate applied to values in the column.
Document or private-session filter configuration for one sheet range.
readonly firstRowIsHeader: booleanWhether the first row is always visible as a header.
readonly privateView: booleanWhether this definition belongs to the current editor session.
readonly range: {
readonly end: readonly [number, number];
readonly start: readonly [number, number];
}Inclusive sheet coordinates covered by the filter.
readonly rules: readonly SheetFilterColumnRule[]Active column predicates.
One distinct displayed value and its occurrence count.
Bounded distinct-value query result for a filter column.
readonly items: readonly SheetFilterValueCount[]Matching values returned within the requested limit.
readonly truncated: booleanWhether additional matching values were omitted.
A condition filter's value category.
| Member | Value |
|---|---|
Date |
"date" |
Number |
"number" |
Text |
"text" |
A cell visual property used by a color filter.
| Member | Value |
|---|---|
Fill |
"fill" |
Text |
"textColor" |
Supported filter rule kinds.
| Member | Value |
|---|---|
Values |
"values" |
Condition |
"condition" |
Color |
"color" |
A comparison operator supported by the filter plugin.
| Member | Value |
|---|---|
Equal |
"equal" |
Greater |
"greater" |
GreaterEqual |
"greaterEqual" |
NotEqual |
"notEqual" |
Between |
"between" |
Less |
"less" |
LessEqual |
"lessEqual" |
NotBetween |
"notBetween" |
EndsWith |
"endsWith" |
NotStartsWith |
"notStartsWith" |
StartsWith |
"startsWith" |
Contains |
"contains" |
NotContains |
"notContains" |
NotEndsWith |
"notEndsWith" |
type SheetFilterPredicate = {
readonly excluded?: boolean;
readonly kind: typeof SheetFilterKind.Values;
readonly values: readonly string[];
} | {
readonly category: SheetFilterCategory;
readonly kind: typeof SheetFilterKind.Condition;
readonly operator: SheetFilterOperator;
readonly secondValue?: string;
readonly value: string;
} | {
readonly color: string | null;
readonly kind: typeof SheetFilterKind.Color;
readonly property: SheetFilterColorProperty;
}Serializable rule used to decide whether a row remains visible.
sheetFilterValueKey(value: unknown): stringUses display values for distinct-value selection, including an explicit blank key.
ReadSheetFilterQuery: SheetQueryDefinition<void, SheetFilterDefinition | null>Reads the active filter definition.
Reads a bounded page of distinct displayed values in one column.
CreateSheetFilterCommand installs a filter, SetSheetColumnFilterCommand changes one column, and ReapplySheetFilterCommand refreshes row visibility.
class SheetFilterMatrix extends CSRMatrix<SheetFilterDefinition | null>One sparse anchor holds the current range and its column rules.
SheetFilterMatrix(data?: {
data: SheetFilterDefinition | null[];
indices: number[];
indptr: number[];
}): SheetFilterMatrixaddItem(row: number, column: number, value: SheetFilterDefinition | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
valueThe value to add.
clone(): thisCreates an independent copy of this value and its mutable data.
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.
rowThe row index.
Inherited from CSRMatrix.
class SheetFilterPlugin extends Plugin<SheetFilterPluginState>, SheetRowVisibilityOwns persisted filter rules and a derived, editor-local row visibility view.
SheetFilterPlugin(state: SheetFilterPluginState, dependencies: SheetFilterDependencies): SheetFilterPluginDocument-state export modules owned by this plugin state.
Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
active: booleanversion: numberapply(state: SheetFilterPluginState, transaction: Transaction): SheetFilterPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
dispose(): voidisHeaderCell(row: number, column: number): booleanisRowFiltered(row: number): booleanonTransactionCommitted(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.
transactionA committed transaction from the completed pipeline.
registerCommands(commands: SheetCommandBus): voidregisterQueries(queries: SheetQueryRegistry): voidregisterSessionState(registry: SessionStateRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (): SheetRowVisibility;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetFilterPluginState;
}Registers one or more plugin-owned state records with the host manager.
static readonly documentState: PluginDocumentStateContribution<SheetFilterPluginState, SheetFilterPluginState>static readonly symbol: typeof symbolSheet range and header policy for a new filter or private view.
readonly firstRowIsHeader?: booleanTreat the first row as a header when true.
readonly range: {
readonly end: readonly [number, number];
readonly start: readonly [number, number];
}Inclusive range to filter.
Sets or clears a predicate for one column.
readonly column: numberreadonly predicate: SheetFilterPredicate | nullReplaces several column predicates in one filter transaction.
readonly updates: readonly SetSheetColumnFilterInput[]Changes whether the first row of an active filter is a header.
readonly firstRowIsHeader: booleaninterface SheetFilterDependencies extends Omit<SheetFilterCommandSource, "target" | "readMatrix" | "readActiveDefinition" | "readPrivateDefinition" | "setPrivateDefinition" | "normalizeSearch">Host-neutral dependencies supplied by a Sheet composition root.
readonly dataTarget?: PluginKeyreadonly displayedValueChanges?: Pick<SheetDisplayedValueChanges, "subscribe">readonly invalidateVisibilityAggregates?: (): voidreadonly parseDate?: (value: unknown): number | nullreadonly readColor: (row: number, column: number, property: "fill" | "textColor"): string | nullPersisted state owned by the filter plugin.
readonly filters: SheetFilterMatrixparseSheetFilterNumber(value: unknown): number | nullParses a finite decimal value for numeric filter conditions.
Clears the active filter or private view.
Creates a document-owned filter range.
Creates a session-owned filter view.
Recomputes visibility for the active filter.
Replaces or clears one column predicate.
SetSheetColumnFiltersCommand: SheetCommandDefinition<SetSheetColumnFiltersInput, SheetCommandResult>Replaces several column predicates atomically.
Updates the active filter's header policy while preserving its column rules.
Session-state contribution for a private filter view.
SheetRowVisibilityFieldKey: "sheet.filter.rowVisibility"Neutral field contract re-exported by the plugin that owns the contribution.
Sparse, typed Sheet find and replace.
Find queries return matching cells or a page of matches. Use the page query when the result set can be large.
Query options shared by navigation and replacement.
readonly content?: SheetFindContentWhether to read displayed values or formula source.
readonly entireCell?: booleanRequires the search text to equal the entire cell text.
readonly matchCase?: booleanEnables case-sensitive matching.
readonly order?: SheetFindOrderCell traversal order.
readonly range?: SheetFindRangeLimits search to an inclusive rectangular cell range.
readonly ranges?: readonly SheetFindRange[]Limits search to multiple selected rectangles; overlapping cells are visited once.
readonly text: stringSearch text with Excel-style *, ? and ~ escapes; an empty string produces no matches.
One occurrence, with UTF-16 offsets within the cell's searched text.
Match window and its position in the complete result set.
readonly matches: readonly SheetFindMatch[]readonly revision: numberreadonly startIndex: numberreadonly total: numberinterface SheetFindPageInput extends SheetFindInputA bounded window of matches in the requested traversal order.
readonly backward?: booleanReads the matches preceding the cursor when set.
readonly cursor?: Pick<SheetFindMatch, "row" | "column" | "start">Exclusive position from which to continue.
readonly expectedRevision?: numberRejects a cursor created before the Sheet data changed.
readonly limit: numberMaximum number of matches returned.
Inherited from SheetFindInput.
Inclusive cell bounds for a Sheet search.
Sparse cells and optional projected values visible to a Sheet search.
readonly codecs: Pick<CellClipboardCodecRegistry, "toPlainText">readonly forEachProjectedValueInRange?: (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): voidreadonly getRevision?: (): numberreadonly isArrayResultAnchor?: (row: number, column: number): booleanreadonly isCoveredMergeCell?: (row: number, column: number): booleanreadonly matrix: CSRMatrix<CellMatrixElement>readonly readValue?: (row: number, column: number, cell: CellMatrixElement | null): unknownSupported cell content projections for search.
| Member | Value |
|---|---|
Formula |
"formula" |
Value |
"value" |
Supported match traversal orders.
| Member | Value |
|---|---|
Columns |
"columns" |
Rows |
"rows" |
findSheetMatches(input: SheetFindInput, source: SheetFindSource): SheetFindMatch[]Collects all occurrences for callers that need the complete result.
findSheetMatchPage(input: SheetFindPageInput, source: SheetFindSource): SheetFindPageFinds a bounded window while still reporting the complete match count.
Reads matching occurrences from current Sheet state.
Reads a bounded window and total count without retaining all matches.
Bounds the memory used by a single Sheet search page.
ReadSheetFindRevisionQuery: SheetQueryDefinition<void, number>Reads the revision used to invalidate cached result windows.
class SheetFindReplaceError extends SearErrorDiagnostic error surfaced to hosts by find and replace commands or queries.
SheetFindReplaceError(code: SheetFindReplaceErrorCode, message: string, details?: SearErrorDetails): SheetFindReplaceErrorreadonly code: SheetFindReplaceErrorCodeStable error category.
class SheetFindReplacePlugin extends Plugin<null>Stateless Sheet feature; matches always read the current staged data owner.
SheetFindReplacePlugin(data: SheetDataPlugin, codecs: CellClipboardCodecRegistry, commits: CellCommitStrategyRegistry, projection?: Pick<SheetFindSource, "readValue" | "forEachProjectedValueInRange" | "isArrayResultAnchor" | "isCoveredMergeCell" | "isRowHidden">, inputValidation?: SheetCellInputValidationRegistry): SheetFindReplacePluginreadonly warnOnDuplicateDepth: falseapply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
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.
transactionA committed transaction from the completed pipeline.
registerCommands(commands: SheetCommandBus): voidregisterQueries(queries: SheetQueryRegistry): voidregisterState(): {
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
Inherited from Plugin.
interface SheetFindReplaceSource extends SheetFindSourceSearch source plus the cell commit policy used for replacements.
readonly commitStrategies: Pick<CellCommitStrategyRegistry, "commit">readonly inputValidation?: Pick<SheetCellInputValidationRegistry, "validate">Inherited from SheetFindSource.
interface SheetReplaceInput extends SheetFindInputReplacement options shared by single and bulk commands.
readonly replacement: stringLiteral text inserted for each matching occurrence.
Inherited from SheetFindInput.
interface SheetReplaceOneInput extends SheetReplaceInputReplaces one match returned by the find query.
readonly match: SheetFindMatchSelected occurrence, including the cell text observed by the find query.
Public code union for diagnostic find/replace failures.
| Member | Value |
|---|---|
InvalidRange |
"SHEET_FIND_INVALID_RANGE" |
InvalidRichText |
"SHEET_FIND_INVALID_RICH_TEXT" |
CrossBlockReplacement |
"SHEET_FIND_CROSS_BLOCK_REPLACEMENT" |
InvalidPage |
"SHEET_FIND_INVALID_PAGE" |
StaleResults |
"SHEET_FIND_STALE_RESULTS" |
CalculatedResult |
"SHEET_FIND_CALCULATED_RESULT" |
CoveredMergeCell |
"SHEET_FIND_COVERED_MERGE_CELL" |
InvalidReplacement |
"SHEET_FIND_INVALID_REPLACEMENT" |
registerSheetFindReplaceCommands(commands: SheetCommandBus, source: SheetFindReplaceSource): voidPublishes single and bulk replace commands for a Sheet plugin.
registerSheetFindReplaceQueries(queries: SheetQueryRegistry, source: SheetFindReplaceSource): voidPublishes the typed find query for a Sheet plugin.
replaceSheetMatches(input: SheetReplaceInput | SheetReplaceOneInput, source: SheetFindReplaceSource, one: boolean): UpdateCellOTOperation<CellMatrixElement | null>[]Builds one operation per changed cell for a single undoable transaction.
Replaces all matching occurrences in one Sheet transaction.
Replaces one selected occurrence in a Sheet transaction.
Sparse fixed-row state, structural transforms, visual projection, collaboration, and export.
class FixedRowMatrix extends CSRMatrix<boolean | null>Sparse one-by-row-count matrix whose stored true values identify fixed rows.
FixedRowMatrix(data?: FixedRowMatrixData, shape?: [number, number]): FixedRowMatrixaddItem(row: number, column: number, value: boolean | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
valueThe value to add.
setItem(row: number, column: number, value: boolean | null): thisStores true sparsely; false and null clear the row's fixed state.
Inherited from CSRMatrix.
class SheetFixedRowPlugin extends Plugin<SheetFixedRowPluginState>Owns fixed-row data, commands, structural projections, export, history, and collaboration.
Document-state export modules owned by this plugin state.
Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
readonly warnOnDuplicateDepth: falseapply(state: SheetFixedRowPluginState, transaction: Transaction): SheetFixedRowPluginState | nullApplies direct fixed-row updates and projects sheet row structure changes.
registerCommands(commands: SheetCommandBus): voidRegisters the public command that fixes or unfixes a row range.
registerState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetFixedRowPluginState): FixedRowMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetFixedRowPluginState;
}Publishes the plugin-owned matrix as a read-only Sheet data-view field.
Serialized sparse storage accepted by FixedRowMatrix.
State owned exclusively by SheetFixedRowPlugin.
readonly fixedRows: FixedRowMatrixSheetFixedRowsFieldKey: "sheet.fixedRows"Stable Sheet data-view field owned by SheetFixedRowPlugin.
Fixed-row state needed to validate and create invertible command operations.
getRowCount(): numberisRowFixed(index: number): booleanPublic input for fixing or unfixing rows.
createSetSheetRowsFixedOperations(input: SheetSetRowsFixedInput, dataSource: SheetFixedRowCommandDataSource): UpdateCellOTOperation<boolean>[]Creates sparse, invertible fixed-row updates for a normalized row range.
readSheetFixedRows(dataEngine: DataEngine): FixedRowMatrix | nullReads the fixed-row matrix published by SheetFixedRowPlugin.
registerSheetFixedRowCommands(commands: SheetCommandBus, dataSource: SheetFixedRowCommandDataSource): voidRegisters the fixed-row command against one plugin-owned state source.
Sets the fixed state for a contiguous row range.
Sheet format painting through state-owner contributions.
class SheetFormatPainterPlugin extends Plugin<null>Owns only a local captured-format session; document formats remain with their owners.
readonly warnOnDuplicateDepth: falseapply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
destroy(): voidregisterCommands(commands: SheetCommandBus): voidregisterObservations(observations: ObservationRegistry): voidregisterState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}Registers one or more plugin-owned state records with the host manager.
static readonly symbol: typeof symbolInherited from Plugin.
Local brush state borrowed by Sheet editors mounted within one Workbook.
clear(): voidstart(formats: SheetFormatTransferRegistry, snapshot: SheetFormatTransferSnapshot, state: FormatPainterState): voidstatic readonly symbol: typeof symbolreadonly mode: FormatPainterMode | nullreadonly source: SheetMoveRange | nullDependencies supplied by the owning composition root, with no global state.
readonly formats: SheetFormatTransferRegistryreadonly readShape: (): readonly [number, number]readonly session?: SheetFormatPainterSessionreadonly mode?: FormatPainterModereadonly source: SheetMoveRangeCanonical activation modes shared by commands and hosts.
| Member | Value |
|---|---|
Once |
"once" |
Persistent |
"persistent" |
ApplyFormatPainterCommand: SheetCommandDefinition<{ readonly destination: SheetMoveRange }, SheetCommandResult>Editor-local composition of state-owner format transfers.
capture(source: SheetMoveRange): SheetFormatTransferSnapshotcapturePortable(source: SheetMoveRange): readonly SheetPortableFormatTransfer[]clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans all format owners against the same unchanged pre-clear state.
destroy(): voidplanPortable(captured: readonly SheetPortableFormatTransfer[], destination: SheetMoveRange): readonly SheetFormatTransferPlan[]register(owner: SheetFormatTransferContribution): (): voidsingleCellFillStep(row: number, column: number): number | nullusedExtent(lastRow: number, lastColumn: number): readonly [number, number] | nullstatic readonly symbol: typeof symbolOptional state-owner contribution to format painting.
readonly id: stringcapture(source: SheetMoveRange): SheetFormatTransferSnapshotclear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans removal of this owner's explicit formats without changing cell content.
planCaptured(portable: unknown, destination: SheetMoveRange): readonly SheetFormatTransferPlan[]Plans a captured source pattern using this owner's current target state.
singleCellFillStep(row: number, column: number): number | nullOptional numeric step for filling one cell whose format gives it sequence meaning.
usedExtent(lastRow: number, lastColumn: number): readonly [number, number] | nullFarthest explicitly formatted row and column within sheet bounds.
One owner's isolated plan; only the owner interprets its operations.
readonly operations: readonly Operation[]Captured format data, independent of subsequent source changes.
readonly portable?: unknownCaptured owner data that can be planned against another Sheet instance.
plan(destination: SheetMoveRange, targetRegistry?: SheetFormatTransferRegistry): readonly SheetFormatTransferPlan[]type SheetFormatRange = SheetMoveRangeInclusive range shared by format-transfer owners and hosts.
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<Omit<SheetFormatTransferContribution, "singleCellFillStep">>Captures sparse persisted formats and tiles them over an inclusive target.
Host-neutral Excel-compatible engineering formulas organized by category.
readonly excludedNames?: readonly string[]Function names omitted for hosts whose formula dialect does not expose them.
registerEngineeringFunctions(registry: IFunctionRegistry, options?: EngineeringFunctionRegistrationOptions): (): voidRegisters engineering formulas into an editor-local registry and returns an idempotent disposer.
engineeringFunctions: readonly FormulaFunction[]BESSELI returns the modified Bessel function I_n(x). Example: =BESSELI(1.5,1) returns about 0.981666.
BESSELJ returns the Bessel function J_n(x). Example: =BESSELJ(1.9,2) returns about 0.329926.
BESSELK returns the modified Bessel function K_n(x). Example: =BESSELK(1.5,1) returns about 0.277388.
BESSELY returns the Bessel function Y_n(x). Example: =BESSELY(2.5,1) returns about 0.145918.
BITAND returns the bitwise AND of two 48-bit nonnegative integers. Example: =BITAND(13,25) returns 9.
BITLSHIFT shifts a 48-bit integer left, or right for a negative shift. Example: =BITLSHIFT(4,2) returns 16.
BITOR returns the bitwise OR of two 48-bit nonnegative integers. Example: =BITOR(23,10) returns 31.
BITRSHIFT shifts a 48-bit integer right, or left for a negative shift. Example: =BITRSHIFT(16,2) returns 4.
BITXOR returns the bitwise exclusive OR of two 48-bit nonnegative integers. Example: =BITXOR(5,3) returns 6.
COMPLEX creates Excel complex-number text from real and imaginary coefficients. Example: =COMPLEX(3,4) returns "3+4i".
IMABS returns the modulus of a complex number. Example: =IMABS("3+4i") returns 5.
IMAGINARY returns the imaginary coefficient. Example: =IMAGINARY("3+4i") returns 4.
IMARGUMENT returns a complex number's angle in radians. Example: =IMARGUMENT("3+4i") returns about 0.9273.
IMCONJUGATE returns the complex conjugate. Example: =IMCONJUGATE("3+4i") returns a 3-4i.
IMCOS returns the cosine of a complex number. Example: =IMCOS("1+i") returns a complex cosine.
IMCOSH returns the hyperbolic cosine of a complex number. Example: =IMCOSH("1+i") returns a complex hyperbolic cosine.
IMCOT returns the cotangent of a complex number. Example: =IMCOT("1+i") returns a complex cotangent.
IMCOTH returns the hyperbolic cotangent. Example: =IMCOTH("1+i") returns a complex value.
IMCSC returns the cosecant of a complex number. Example: =IMCSC("1+i") returns a complex cosecant.
IMCSCH returns the hyperbolic cosecant of a complex number. Example: =IMCSCH("1+i") returns a complex hyperbolic cosecant.
IMDIV divides one complex number by another. Example: =IMDIV("3+4i","5-3i") returns their quotient.
IMEXP returns the exponential of a complex number. Example: =IMEXP("1+i") returns a complex exponential.
IMLN returns the natural logarithm of a complex number. Example: =IMLN("3+4i") returns a complex logarithm.
IMLOG returns a complex logarithm in a chosen base. Example: =IMLOG("8",2) returns 3.
IMLOG10 returns the base-10 logarithm of a complex number. Example: =IMLOG10("3+4i") returns a complex logarithm.
IMLOG2 returns the base-2 logarithm of a complex number. Example: =IMLOG2("3+4i") returns a complex logarithm.
IMPOWER raises a complex number to a real power. Example: =IMPOWER("2+3i",3) returns "-46+9i".
IMPRODUCT multiplies complex numbers and ranges. Example: =IMPRODUCT("3+4i","5-3i") returns "27+11i".
IMREAL returns the real coefficient. Example: =IMREAL("6-9i") returns 6.
IMSEC returns the secant of a complex number. Example: =IMSEC("1+i") returns a complex secant.
IMSECH returns the hyperbolic secant of a complex number. Example: =IMSECH("1+i") returns a complex hyperbolic secant.
IMSIN returns the sine of a complex number. Example: =IMSIN("1+i") returns a complex sine.
IMSINH returns the hyperbolic sine of a complex number. Example: =IMSINH("1+i") returns a complex hyperbolic sine.
IMSQRT returns the square root of a complex number. Example: =IMSQRT("1+i") returns a complex square root.
IMSUB subtracts the second complex number from the first. Example: =IMSUB("13+4i","5+3i") returns "8+i".
IMSUM adds complex numbers and ranges. Example: =IMSUM("3+6i","5-2i") returns "8+4i".
IMTAN returns the tangent of a complex number. Example: =IMTAN("1+i") returns a complex tangent.
IMTANH returns the hyperbolic tangent. Example: =IMTANH("1+i") returns a complex value.
ERF returns the error function between lower and optional upper bounds. Example: =ERF(1) returns about 0.842701.
ERF.PRECISE returns the error function from zero to x. Example: =ERF.PRECISE(1) returns about 0.842701.
ERFC returns the complementary error function. Example: =ERFC(1) returns about 0.157299.
ERFC.PRECISE returns the precise complementary error function. Example: =ERFC.PRECISE(1) returns about 0.157299.
BIN2DEC converts binary to decimal. Example: =BIN2DEC("1100100") returns 100.
BIN2HEX converts binary to hexadecimal. Example: =BIN2HEX("11111011") returns FB.
BIN2OCT converts binary to octal. Example: =BIN2OCT("1001") returns 11.
DEC2BIN converts decimal to binary. Example: =DEC2BIN(9) returns 1001.
DEC2HEX converts decimal to hexadecimal. Example: =DEC2HEX(100) returns 64.
DEC2OCT converts decimal to octal. Example: =DEC2OCT(58) returns 72.
HEX2BIN converts hexadecimal to binary. Example: =HEX2BIN("F") returns 1111.
HEX2DEC converts hexadecimal to decimal. Example: =HEX2DEC("A5") returns 165.
HEX2OCT converts hexadecimal to octal. Example: =HEX2OCT("F") returns 17.
OCT2BIN converts octal to binary. Example: =OCT2BIN("3") returns 11.
OCT2DEC converts octal to decimal. Example: =OCT2DEC("54") returns 44.
OCT2HEX converts octal to hexadecimal. Example: =OCT2HEX("100") returns 40.
CONVERT changes a number between compatible measurement units. Example: =CONVERT(1,"mi","km") returns 1.609344.
Sheet formula source, evaluation scheduling, dependency tracking, and result projection.
Formula-result publisher for the shared displayed-value change bus.
The formula scheduler reports changes after updating derived results. Other features subscribe to the shared bus without depending on formula internals.
FormulaValuePublisher(displayedValueChanges: SheetDisplayedValueChanges): FormulaValuePublisherpublishResults(keys: readonly number[]): voidReports formula result changes to displayed-value subscribers.
keysFormula cell keys whose derived display values changed.
static readonly symbol: typeof symbolDI token for resolving FormulaValuePublisher.
ActivateFormulaHyperlinkCommand: SheetCommandDefinition<{
column: number;
row: number;
}, SheetCommandResult>Requests activation of hyperlink metadata owned by a calculated cell.
SheetFormulaPlugin owns formula source in the Sheet and reacts to committed cell and structure operations.
It parses changed formulas, updates dependencies, and asks RecalcScheduler to evaluate affected cells.
Calculated values live in FormulaResultStore and are exposed through result providers; they are derived data,
separate from the formula text stored in the document.
The parser, evaluator, graph, and built-in functions are described in the formula-engine packages. Start here when integrating formula behavior into a Sheet editor; start with the engine contracts when implementing a new evaluator or function.
class SheetFormulaPlugin extends Plugin<FormulaPluginState>, IFormulaResultProvider, IFormulaRichResultProvider, IFormulaSourceProvider, IFormulaStatusProviderConnects committed formula cells to dependency tracking and recalculation.
Formula source stays in cell document state. This plugin parses that source, updates its dependency graph after commits, schedules recalculation, and publishes calculated values and status through provider contracts. Its ASTs and results are derived caches rather than a second document state.
SheetFormulaPlugin(parser: IFormulaParser, graph: IDependencyGraph, aggCache: IAggregationCache, resultStore: FormulaResultStore, scheduler: RecalcScheduler, refShifter: FormulaRefShifter, trace: FormulaCalculationTraceBus, dataEngine?: DataEngine, platform?: Platform, results?: IFormulaResultProvider, resultProviders?: FormulaResultProviderRegistry, richResultProviders?: FormulaRichResultProviderRegistry, sourceProviders?: FormulaSourceProviderRegistry, functions?: IFunctionRegistry, externalServices?: IFormulaExternalServiceProvider, textServices?: IFormulaTextServiceProvider, inputValidation?: SheetCellInputValidationRegistry, schedulerDataSource?: FormulaSchedulerDataSource): SheetFormulaPluginOperation types listened to by this plugin:
apply(_pluginState: null, transaction: Transaction): nullRejects unsupported structure operations before the owning transaction commits. Derived ASTs are not staged as plugin state.
enforceProviderCommandBoundary(commands: SheetCommandBus, workbookOwnership?: FormulaRegistryOwnership): voidSeals provider registration once every configured Sheet plugin has started.
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): voidExposes derived spill coordinates to sparse range consumers.
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.
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.
getFormulaResultFormat(row: number, col: number): CellFormat | undefinedDerived format for a numeric formula result; explicit cell formatting takes precedence.
getFormulaRichResult(row: number, col: number): FormulaRichResult | undefinedReturns rich metadata derived during the current formula evaluation.
getFormulaSource(row: number, col: number): string | undefinedIFormulaSourceProvider implementation used by editors to read persisted formula text.
onInitialDataCell(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.
onInitialDataComplete(): voidStarts one recalculation after dependencies for all initial formulas have been registered.
onTransactionCommitted(transaction: Transaction): voidRebuilds derived indexes after the owning document transaction commits.
transactionSuccessfully committed transaction.
registerCommands(commands: SheetCommandBus): voidRegisters formula host commands.
commandsCommand bus owned by one editor instance.
registerObservations(observations: ObservationRegistry): voidRegisters formula calculation trace as an editor-local host observation.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes formula identity updates to the same atomic cell-move plan.
registerRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}Formula indexes are editor-local and do not enter Sheet document views.
registerStructureMoves(registry: SheetStructureMoveRegistry): voidPlans persisted reference rewrites for complete row and column reordering.
Schedules dependency-aware formula recalculation with visible-cell priority.
RecalcScheduler(graph: IDependencyGraph, evaluator: IFormulaEvaluator, resultStore: FormulaResultStore, aggCache: IAggregationCache, dataSource: FormulaSchedulerDataSource, platform: Platform, renderInvalidator: FormulaValuePublisher, trace: FormulaCalculationTraceBus, functionRegistry?: IFunctionRegistry, iterationSettings?: IFormulaIterationSettingsProvider): RecalcSchedulerbindAstCache(cache: ReadonlyMap<number, FormulaAST>): voidBinds the formula owner's cache during plugin setup.
bindCommandBus(commands: SheetCommandBus): voidBinds asynchronous formula work to the owning editor's command bus.
bindTeardownToken(token: object): voidGives the owning editor lifecycle exclusive authority to dispose the mounted scheduler.
discardPendingWork(): voidDiscards pending formula batches when committed formula inputs are replaced.
dispose(token?: object): voidReleases scheduler-owned subscriptions.
getFormulaKeys(): IterableIterator<number>Iterates formula coordinates without exposing the cache for mutation.
invalidateFunctionCallIndexes(): voidCall after the formula owner changes the AST index.
markDirty(changedKeys: number[]): voidTriggers recalculation.
Performs only two actions:
markFunctionsDirty(functionNames: readonly string[]): voidRecalculates formulas that contain any of the supplied function names.
processScheduledBatch(): voidRuns one budgeted batch inside the formula owner's command.
recalculateVolatile(): voidStarts an explicit recalculation epoch for every formula containing a volatile call.
resumePendingWork(): voidResumes pending work inside a viewport or external-service command.
waitForIdle(): Promise<void>Resolves when the scheduler has no running or pending formula work.
static readonly symbol: typeof symbolDI token for resolving RecalcScheduler.
Stores calculated formula results independently from persisted formula source.
FormulaResultStore(valueConverters: CellFormulaValueConverterRegistry): FormulaResultStorecellToFormulaValue(row: number, col: number, cell: CellMatrixElement | null | undefined): FormulaValueConverts a CellMatrixElement to a FormulaValue.
Used when evaluators read cell data:
Called by both SheetFormulaPlugin.apply for aggCache delta calculation and RecalcScheduler.createEvalContext, so it lives on the store to avoid duplicated logic or callback plumbing.
clear(): voidClears state owned by FormulaResultStore.
delete(key: number): voidRemoves the calculated result for one formula cell.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidCloses direct result writes after the owning Sheet has started.
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.
get(key: number): FormulaValue | undefinedgetAt(row: number, col: number): FormulaValue | undefinedReads an anchor or projected spill value at any sheet coordinate.
getRichAt(row: number, col: number): FormulaRichResult | undefinedReads derived rich metadata for a formula anchor.
has(key: number): booleanReturns whether value exists.
isSpillCell(row: number, col: number): booleanDistinguishes projected children from their persisted formula anchor.
set(key: number, value: FormulaValue): voidUpdates the value.
setFormulaResult(key: number, value: FormulaValue, context: {
isCellInBounds(row: number, col: number): boolean;
isCellOccupied(row: number, col: number): boolean;
}): number[]Stores a formula result and projects a rectangular array into derived spill cells.
setRichResult(key: number, result: FormulaRichResult | undefined): voidReplaces rich metadata after a formula result is committed.
static readonly symbol: typeof symbolDI token for resolving FormulaResultStore.
interface FormulaRegistryOwnership
FormulaRegistryOwnership: unknownMarks formula registries borrowed from a Workbook owner by a mounted Sheet.
readonly externalServices: booleanreadonly functions: booleanreadonly textServices: booleansymbol: typeof symbolinterface FormulaSchedulerDataSource
FormulaSchedulerDataSource: unknownNarrow 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.
symbol: typeof symbolDI token for resolving FormulaSchedulerDataSource.
createEvalContext(resultStore: FormulaResultStore): EvalContextBuilds the latest evaluation context for a recalculation batch.
ReturnsEvalContext for the current committed sheet snapshot.
resultStorePer-client derived formula result store used when formula cells reference formula cells.
getViewportFormulaKeys(formulaKeys: Iterable<number>): Set<number>Selects formula keys that are currently visible and should be evaluated first.
ReturnsFormula keys inside the current visible viewport.
formulaKeysFormula AST keys known to the scheduler.
Reads the first visible cell for formulas that depend on viewport position.
isSpillObstacleTransaction(transaction: Transaction): booleanIdentifies host-owned changes that can block or unblock projected array results.
onExternalServiceInvalidated(handler: FormulaExternalServiceInvalidationHandler): (): voidSubscribes to host-service cache changes that require selected functions to be evaluated again.
onViewportChanged(handler: FormulaViewportChangeHandler): (): voidSubscribes to viewport changes that should wake pending formula recalculation.
ReturnsDisposer for the subscription.
handlerCallback invoked after viewport-priority inputs change.
type FormulaPluginState = nullFormula owns no document state; its ASTs and results are derived caches.
State-owner identity for formula indexes and operations.
Input for querying one cell's formula status through the host command bus.
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.
readonly status: FormulaCellStatusFormula status snapshot returned by the formula status provider.
Product-facing cell coordinate plus A1 reference label.
Product-facing formula dependency status for one queried cell.
readonly cell: FormulaDependencyCellRefQueried cell with display label.
readonly dependents: readonly FormulaDependencyCellRef[]Direct formula cells that depend on the queried cell.
readonly precedents: readonly FormulaDependencyReference[]Direct precedent references used by the formula in the queried cell.
readonly status: FormulaCellStatusUnderlying formula status snapshot for consumers that need result/error/dirty details.
readonly transitiveDependents: readonly FormulaDependencyCellRef[]Transitive dependent formula cells, only populated when requested.
readonly transitivePrecedents: readonly FormulaDependencyCellRef[]Transitive precedent cells, only populated when requested.
Input for querying product-facing formula dependency status.
readonly col: numberColumn index (0-based).
readonly includeTransitive?: booleanWhether to include transitive dependency/dependent cells beyond direct edges.
readonly maxDepth?: numberMaximum traversal depth used when includeTransitive is true. Defaults to 8.
readonly row: numberRow index (0-based).
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.
readonly dependencyStatus: FormulaDependencyStatusProduct-facing dependency snapshot for the queried cell.
interface FormulaIdleCommandResult extends SheetCommandResultResult returned when waiting for one editor instance's formula scheduler.
readonly idle: Promise<void>Promise resolved when the formula scheduler becomes idle.
Provider contract used by the deterministic formula-idle command.
waitForIdle(): Promise<void>Resolves after all currently scheduled formula work has completed.
lockFormulaResultValue(value: FormulaValue): voidLocks a calculated value once when it enters the editor-local result cache.
registerFormulaStatusCommands(commands: SheetCommandBus, provider: IFormulaStatusProvider, idleProvider?: FormulaIdleProvider): voidRegisters formula status query commands.
commandsCommand bus for one editor instance.
providerFormula status provider bound to the same editor instance.
waitForFormulaIdle(commands: SheetCommandBus): Promise<void>Waits deterministically for one editor's formula scheduler to become idle.
Editor-local formula calculation trace events exposed to diagnostic hosts.
GetFormulaCellStatusCommand: SheetCommandDefinition<FormulaCellStatusCommandInput, FormulaCellStatusCommandResult>Host command that reads one cell's formula status.
GetFormulaDependencyStatusCommand: SheetCommandDefinition<FormulaDependencyStatusCommandInput, FormulaDependencyStatusCommandResult>Host command that reads product-facing formula dependency status.
Host command that exposes deterministic formula-idle synchronization.
Cell type → formula semantic value registry.
Rendering and formula coercion intentionally use separate registries: a custom cell type can define its calculation semantics without coupling to a Canvas renderer.
Creates a registry with the built-in cell-to-formula semantics.
platformPlatform adapter used for diagnostics when unknown cell types fall back to text.
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.
converterConverter owned by a built-in package or third-party plugin.
Converts a persisted sheet cell into the formula value contract.
ReturnsFormula value, including canonical propagated formula errors or #VALUE! for malformed error payloads.
cellMatrix cell to convert; the method never writes back to the sheet matrix.
static readonly symbol: typeof symbolDI token for resolving CellFormulaValueConverterRegistry.
class FormulaResultProviderRegistry extends IFormulaResultProviderInstance-local result provider registry exposed as the renderer's formula result reader.
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): voidBinds post-assembly registration and disposal to the owning command bus.
forEachFormulaResultInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): voidVisits derived result coordinates published by registered providers, once per position.
getFormulaResult(row: number, col: number): FormulaValue | undefinedReads the first defined result supplied by registered providers.
getFormulaResultFormat(row: number, col: number): CellFormat | undefinedDerived format for a numeric formula result; explicit cell formatting takes precedence.
register(registration: FormulaResultProviderRegistration): (): voidRegisters one formula result provider and returns an idempotent disposer.
unregister(id: number): voidRemoves one provider inside the formula owner's unregister command.
static readonly symbol: typeof symbolDI token for resolving the registry owned by one SheetEditor instance.
class FormulaRichResultProviderRegistry extends IFormulaRichResultProviderInstance-local provider registry for formula hyperlinks, images, and future rich results.
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): voidgetFormulaRichResult(row: number, col: number): FormulaRichResult | undefinedregister(registration: FormulaRichResultProviderRegistration): (): voidunregister(id: number): voidstatic readonly symbol: typeof symbolclass FormulaSourceProviderRegistry extends IFormulaSourceProviderEditor-local ordered registry for formula source providers.
enforceCommandBoundary(isExecuting: (): boolean, remove: (id: number): void): voidgetFormulaSource(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.
register(registration: FormulaSourceProviderRegistration): (): voidunregister(id: number): voidstatic readonly symbol: typeof symbolDI token for resolving IFormulaSourceProvider.
Defines how one persisted cell type enters the formula domain.
readonly cellType: stringPersisted cell type identifier handled by this converter.
Converts one sheet matrix element into a formula-engine value.
ReturnsFormula value used by formula evaluation and dependency recalculation.
cellPersisted sheet cell to read without mutating sheet state.
Ordered formula result provider registered for one SheetEditor instance.
readonly priority?: numberHigher priority providers are queried first.
readonly provider: IFormulaResultProviderProvider queried for formula results.
Ordered rich-result provider registered for one SheetEditor instance.
readonly priority?: numberreadonly provider: IFormulaRichResultProviderreadonly priority?: numberreadonly provider: IFormulaSourceProviderreadonly kind: FormulaProviderKindreadonly registrationId: numberFormula-owned provider families sharing one editor-local unregister command.
| Member | Value |
|---|---|
Result |
"result" |
RichResult |
"richResult" |
Source |
"source" |
UnregisterFormulaProviderCommand: SheetCommandDefinition<UnregisterFormulaProviderInput, SheetCommandResult>Removes an editor-local formula provider registration.
Removes one Sheet-owned external formula service contribution.
Removes one function contribution through its Sheet owner.
Removes one Sheet-owned formula text service contribution.
MarkFormulaDirtyCommand and RunFormulaBatchCommand are the command path for scheduled work.
GetFormulaCellStatusCommand reads one cell's status, while WaitForFormulaIdleCommand waits for pending work
to finish. FormulaCalculationTraceObservation reports calculation traces for diagnostics.
Host code should read formula results through a provider or status query. It should not write directly into
FormulaResultStore, because the scheduler owns recalculation order and invalidation.
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.
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.
eventEvent payload without provider-owned sequence metadata.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidSeals event publication after initial formula data has been scanned.
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.
listenerCallback invoked for future calculation trace events.
static readonly symbol: typeof symbolDI token for resolving FormulaCalculationTraceBus.
type FormulaViewportChangeHandler = (): voidCallback invoked when viewport-priority scheduling inputs may have changed.
Invalidates an obsolete formula calculation generation.
MarkFormulaDirtyCommand: SheetCommandDefinition<readonly number[], SheetCommandResult>Marks formula dependencies dirty after an external result or function changes.
Resumes pending formula work when the visible viewport changes.
Executes one scheduled, time-bounded formula calculation batch.
Reference highlighting follows the draft formula and colors referenced ranges while the user edits it.
Optional workbook-owned source for cross-sheet formula reference overlays.
abstract getReferences(selectionRevision: number, selectionSource?: string): readonly FormulaCrossSheetReference[]static readonly symbol: typeof symbolRewrites formula references after Sheet structure changes.
FormulaRefShifter(parser: IFormulaParser): FormulaRefShiftershiftAll(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).
formulasCurrent AST cache for all formulas (CellKey -> AST).
changesStructural change list for row/column insertion and deletion.
static readonly symbol: typeof symbolDI token for resolving FormulaRefShifter.
One workbook-qualified reference projected onto the currently mounted sheet.
type FormulaDependencyReference = FormulaDependencyCellRef & { readonly kind: typeof FormulaNodeKind.Cell } | {
readonly end: FormulaDependencyCellRef;
readonly kind: typeof FormulaNodeKind.Range;
readonly ref: string;
readonly start: FormulaDependencyCellRef;
} | FormulaDependencyCellRef & {
readonly kind: typeof FormulaNodeKind.WorkbookCell;
readonly sheetName: string;
} | {
readonly end: FormulaDependencyCellRef;
readonly kind: typeof FormulaNodeKind.WorkbookRange;
readonly ref: string;
readonly sheetName: string;
readonly start: FormulaDependencyCellRef;
} | {
readonly endCol: number;
readonly kind: typeof FormulaNodeKind.ColumnRange;
readonly ref: string;
readonly startCol: number;
} | {
readonly endRow: number;
readonly kind: typeof FormulaNodeKind.RowRange;
readonly ref: string;
readonly startRow: number;
}Product-facing dependency edge that preserves range-level formula semantics.
Persistent Sheet freeze boundaries and typed command surface.
class SheetFreezeBoundaryError extends SearErrorPublic invalid-boundary error with stable diagnostics.
SheetFreezeBoundaryError(input: SheetFreezeState, rowCount: number, columnCount: number): SheetFreezeBoundaryErrorreadonly code: "SHEET_FREEZE_INVALID_BOUNDARY"Stable machine-readable identifier for this error category.
class SheetFreezeMatrix extends CSRMatrix<number | null>One row with the frozen row and column counts at columns zero and one.
SheetFreezeMatrix(data?: SheetFreezeMatrixData, shape?: [number, number]): SheetFreezeMatrixCreates or restores a freeze matrix.
Inherited from CSRMatrix.
class SheetFreezePlugin extends Plugin<SheetFreezePluginState>Owns the persistent row and column prefix kept visible during scrolling.
SheetFreezePlugin(state: SheetFreezePluginState, shape: (): readonly [number, number]): SheetFreezePluginDocument-state export modules owned by this plugin state.
readonly interestedIn: MatrixOTActionName[]Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
readonly warnOnDuplicateDepth: falseapply(state: SheetFreezePluginState, transaction: Transaction): SheetFreezePluginState | nullApplies a transaction to plugin-owned state and returns the next state.
registerCommands(commands: SheetCommandBus): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetFreezePluginState): SheetFreezeMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetFreezePluginState;
}Registers one or more plugin-owned state records with the host manager.
static readonly documentState: PluginDocumentStateContribution<SheetFreezePluginState, SheetFreezePluginState>static readonly symbol: typeof symbolSparse serialization payload accepted by the freeze matrix.
Document-owned state for one Sheet editor's freeze boundaries.
readonly freeze: SheetFreezeMatrixSparse freeze boundary matrix.
Number of leading rows and columns kept visible while scrolling.
SheetFreezeFieldKey: "sheet.freeze"Plugin-owned data-view field for persistent freeze boundaries.
Supplies current boundaries and sheet dimensions to the command factory.
Reads the currently committed freeze boundaries.
shape(): readonly [number, number]Reads the current row and column counts.
createSetSheetFreezeOperations(input: SheetFreezeState, source: SheetFreezeCommandSource): UpdateCellOTOperation<number | null>[]Creates invertible updates for the changed freeze boundaries.
readSheetFreeze(dataEngine: DataEngine): SheetFreezeStateReads freeze boundaries, returning zeroes when the plugin is absent.
Replaces both freeze boundaries in one transaction.
Commit-driven Sheet and Doc undo and redo stacks.
class NoopSheetExternalHistory extends SheetExternalHistoryOptional parent history visible through a mounted Sheet editor.
Optional parent history visible through a mounted Sheet editor.
abstract getStatus(): SheetExternalHistoryStatusnextSequence(): numberAllocates an order shared with parent history when one is available.
abstract redo(): void | Promise<void>abstract subscribe(listener: (): void): (): voidabstract undo(): void | Promise<void>static readonly symbol: typeof symbolclass SheetHistoryPlugin extends Plugin<null>, SheetHistoryStatusProviderEditor-local command history for plugin-owned Sheet state with registered transaction algebra.
SheetHistoryPlugin(plugins: PluginManager, interaction: SheetInteractionStore, platform: Platform, commands: SheetCommandBus, externalHistory?: SheetExternalHistory): SheetHistoryPluginreadonly warnOnDuplicateDepth: falseapply(_state: null, _transaction: Transaction): nullHistory observes committed commands and owns no transactional sheet projection.
destroy(): voidReleases command/status subscriptions owned by this editor instance.
Returns current undo and redo availability.
registerCommands(commands: SheetCommandBus): voidRegisters typed history commands on this editor's command bus.
registerObservations(observations: ObservationRegistry): voidRegisters the host-facing history status observation for this editor.
registerSessionState(registry: SessionStateRegistry): voidRegisters sheet-local undo and redo history for editor remounts.
registerState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}History state is private runtime state and is never persisted or synchronized.
start(): voidStarts observation of committed commands and local history status.
subscribe(listener: (status: HistoryStatus): void): (): voidSubscribes to future history availability changes.
Inherited from Plugin.
Editor-local DI contract used by plugins that render history controls.
abstract getStatus(): HistoryStatusReturns the current editor-local history availability.
abstract subscribe(listener: (status: HistoryStatus): void): (): voidObserves future history availability changes and returns an idempotent disposer.
static readonly symbol: typeof symbolDI token for resolving the active editor's history status provider.
interface SheetExternalHistoryStatus extends HistoryStatusAvailability of undo and redo actions for an editor.
groupId?: stringPending group token retained until a matching command commits.
redo: Transaction<Operation>[]redoOrder?: numberundo: Transaction<Operation>[]undoOrder?: numberIn-memory history retained for one sheet session while a workbook is open.
readonly redoStack: SheetHistoryEntry[]readonly undoStack: SheetHistoryEntry[]type SheetHistoryStatus = HistoryStatusImmutable status published whenever one editor's history availability changes.
Stable session-state identity owned by SheetHistoryPlugin.
Editor-local undo/redo availability exposed to third-party hosts.
Reapplies the latest sheet mutation reverted by undo.
Reverts the latest successfully committed sheet mutation.
Editor-local locale registration and built-in English and Chinese formula locales.
Editor-local registry for built-in and third-party locale contributions.
enforceCommandBoundary(isExecuting: (): boolean, dispatchRemoval: (id: number): void): voidSeals runtime registrations after every plugin has started.
get(locale: string): SheetI18nLocaleEntry | undefinedReturns a registered locale contribution, if present.
has(locale: string): booleanReturns whether a locale id is registered.
list(): readonly SheetI18nLocaleEntry[]Lists registered locale contributions in stable locale-id order.
register(registration: SheetI18nLocaleRegistration): (): voidRegisters one locale contribution and returns an idempotent disposer.
require(locale: string): SheetI18nLocaleEntryReturns a required locale contribution.
unregister(id: number): voidRemoves one contribution through the locale owner's command after assembly.
static readonly symbol: typeof symbolDI token for resolving SheetI18nLocaleRegistry.
Normalized locale contribution stored by the editor-local registry.
readonly cellFormatLocale: CellFormatLocaleSheet cell number and date/time display defaults for this locale.
readonly dateTimeLocale: FormulaDateTimeLocaleFormula date/time parser and formatter for this locale.
readonly dateTimeSymbols?: FormulaDateTimeSymbolsLocale-specific date/time symbols used by the shared Excel parser.
readonly displayName: stringUser-facing language label supplied by the owner.
readonly locale: stringStable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.
readonly textLocale: FormulaTextLocaleFormula text byte/width strategy for DBCS-compatible functions.
Locale contribution registered with the editor-local i18n registry.
readonly cellFormatLocale?: CellFormatLocaleSheet cell number and date/time display defaults for this locale.
readonly dateTimeLocale?: FormulaDateTimeLocaleFormula date/time parser and formatter for this locale.
readonly dateTimeSymbols?: FormulaDateTimeSymbolsLocale-specific date/time symbols used by the shared Excel parser.
readonly displayName: stringUser-facing language label supplied by the owner.
readonly locale: stringStable locale id, normally a BCP-47 tag such as en, zh-CN, ja-JP, or fr-FR.
readonly textLocale?: FormulaTextLocaleFormula text byte/width strategy for DBCS-compatible functions.
isSheetI18nLocale(value: unknown): valueReturns whether a value is a non-empty locale id.
registerBuiltInSheetI18nLocales(registry: SheetI18nLocaleRegistry): voidRegisters the default English and Chinese locale contributions.
Built-in locale identifiers registered by sear-plugin-i18n.
readonly Chinese: "zh"readonly English: "en"Runtime capability that exposes the sheet i18n locale registry to plugins and hosts.
class SheetI18nPlugin extends Plugin<null>, IFormulaLocaleProvider, ICellFormatLocaleProviderEditor-local i18n plugin for built-in English and Chinese locale services.
apply(state: null, _transaction: Transaction): nullApplies no document mutations because i18n is local runtime state.
ICellFormatLocaleProvider implementation.
IFormulaLocaleProvider implementation.
getLocale(): stringReturns the active locale.
IFormulaLocaleProvider implementation.
initialize(context: { readonly container: Container }): voidDiscovers formula scheduling after the formula runtime has registered its services.
registerCapabilities(registry: RuntimeCapabilityRegistry): voidPublishes the i18n locale registry for third-party locale contributions.
registerCommands(commands: SheetCommandBus): voidRegisters language switching commands.
registerObservations(observations: ObservationRegistry): voidRegisters the current i18n state observation.
registerSessionState(registry: SessionStateRegistry): voidRegisters local i18n state for in-memory editor remounts.
registerState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: null;
}Registers private plugin state.
sealRuntimeWrites(): voidCloses runtime-owned extension writes after every plugin has initialized and started.
setLocale(locale: string): voidUpdates the active locale and notifies observers.
toggleLocale(): voidToggles between English and Chinese.
static registerServices(context: { readonly container: Container }): voidPublishes this plugin as the editor-local formula locale provider.
Inherited from Plugin.
Input for setting the editor-local language.
readonly locale: stringSnapshot published by the sheet i18n observation.
readonly locale: stringtype SheetI18nLocale = stringLocale ids are open so third-party plugins can register their own BCP-47 tags.
Command that updates the editor-local language.
Local sheet i18n locale retained during in-memory editor remounts.
Editor-local sheet i18n locale state.
Command that toggles between the built-in English and Chinese locales.
Removes one editor-local locale contribution.
Sheet row and column dimensions, resize interaction, rendering, and persistence.
Hide commands retain the original dimensions so an unhide operation can restore them.
Public input for hiding columns starting at index.
Public input for hiding rows starting at index.
Public input for unhiding columns starting at index.
Public input for unhiding rows starting at index.
createHideColumnOperations(input: SheetHideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]Creates column hide operations from public command input.
createHideRowOperations(input: SheetHideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]Creates row hide operations from public command input.
createUnhideColumnOperations(input: SheetUnhideColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "getDefaultColumnSize" | "readColumnHiddenOriginalSize" | "readColumnSize">): Operation[]Creates column unhide operations from public command input.
createUnhideRowOperations(input: SheetUnhideRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "getDefaultRowSize" | "readRowHiddenOriginalSize" | "readRowSize">): Operation[]Creates row unhide operations from public command input.
Hides one or more columns by resizing them to zero.
Hides one or more rows by resizing them to zero.
Restores one or more hidden columns from resize-owned hidden-size state.
Restores one or more hidden rows from resize-owned hidden-size state.
Resize commands write row or column dimensions; read helpers expose the values used by rendering.
class SheetResizePlugin extends Plugin<ResizeState>Owns dimensions, structural reducers, semantic commands, and persistence.
SheetResizePlugin(dimensions: SheetResizeDimensions): SheetResizePluginreadonly documentState: {
capture: (state: ResizeState): { rowSizes: RowShapeDimensionsCSRMatrix } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { rowSizes: RowShapeDimensionsCSRMatrix };
key: string;
serialize: (state: RowSizesDocumentState): SerializedSparseMatrix<number>;
};
key: string;
} | {
capture: (state: ResizeState): { columnSizes: ColumnShapeDimensionsCSRMatrix } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { columnSizes: ColumnShapeDimensionsCSRMatrix };
key: string;
serialize: (state: ColumnSizesDocumentState): SerializedSparseMatrix<number>;
};
key: string;
} | {
capture: (state: ResizeState): { rowHiddenOriginalSizes: CSRMatrix<number> } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<number> };
key: string;
serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined;
};
key: string;
} | {
capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<number> } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<number> };
key: string;
serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined;
};
key: string;
}[]Document-state export modules owned by this plugin state.
interestedIn: string[]Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
apply(pluginState: ResizeState, transaction: Transaction): ResizeState | nullApplies a transaction to plugin-owned state and returns the next state.
registerCommands(commands: SheetCommandBus): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (resizeState: ResizeState): CSRMatrix<number> | undefined;
viewKey: string;
}[];
};
key: PluginKey;
state: ResizeState;
}[]Registers one or more plugin-owned state records with the host manager.
static readonly documentState: {
capture: (state: ResizeState): { rowSizes: RowShapeDimensionsCSRMatrix } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { rowSizes: RowShapeDimensionsCSRMatrix };
key: string;
serialize: (state: RowSizesDocumentState): SerializedSparseMatrix<number>;
};
key: string;
} | {
capture: (state: ResizeState): { columnSizes: ColumnShapeDimensionsCSRMatrix } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { columnSizes: ColumnShapeDimensionsCSRMatrix };
key: string;
serialize: (state: ColumnSizesDocumentState): SerializedSparseMatrix<number>;
};
key: string;
} | {
capture: (state: ResizeState): { rowHiddenOriginalSizes: CSRMatrix<number> } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { rowHiddenOriginalSizes: CSRMatrix<number> };
key: string;
serialize: (state: RowHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined;
};
key: string;
} | {
capture: (state: ResizeState): { columnHiddenOriginalSizes: CSRMatrix<number> } | undefined;
codec: {
deserialize: (payload: unknown, path: string): { columnHiddenOriginalSizes: CSRMatrix<number> };
key: string;
serialize: (state: ColumnHiddenOriginalSizesDocumentState): SerializedSparseMatrix<number> | undefined;
};
key: string;
}[]static readonly symbol: symbolOne explicit dimension change used by batch resize commands.
Public input for resizing arbitrary columns to explicit sizes.
readonly sizes: readonly SheetDimensionResizeInput[]Public input for resizing columns starting at index to a shared size.
Resize-owned data required to create invertible row and column dimension operations.
getColumnCount(): numberCurrent column dimension count.
getDefaultColumnSize(): numberDefault column width used when no sparse override is stored.
getDefaultRowSize(): numberDefault row height used when no sparse override is stored.
getRowCount(): numberCurrent row dimension count.
readColumnSize(index: number): numberReads the current column width at index.
readRowSize(index: number): numberReads the current row height at index.
Column dimension matrix used for column width state.
Row dimension matrix used for row height state.
Public input for resizing arbitrary rows to explicit sizes.
readonly sizes: readonly SheetDimensionResizeInput[]Public input for resizing rows starting at index to a shared size.
Public input for resizing columns.
Public input for resizing rows.
createResizeColumnOperations(input: SheetResizeColumnsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getColumnCount" | "readColumnSize">): Operation[]Creates column resize operations from public command input.
createResizeRowOperations(input: SheetResizeRowsInput, dataSource: Pick<SheetResizeDimensionCommandDataSource, "getRowCount" | "readRowSize">): Operation[]Creates row resize operations from public command input.
registerSheetResizeDimensionCommands(commands: SheetCommandBus, dataSource: SheetResizeDimensionCommandDataSource): voidRegisters row and column dimension commands on one sheet command bus.
readSheetColumnSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads column dimensions published by SheetResizePlugin.
readSheetRowSizes(dataEngine: DataEngine): DimensionsCSRMatrix | nullReads row dimensions published by SheetResizePlugin.
Resizes one or more column widths.
Resizes one or more row heights.
SheetColumnSizesFieldKey: "sheet.resize.columnSizes"DataEngine field for column dimensions owned by SheetResizePlugin.
SheetRowSizesFieldKey: "sheet.resize.rowSizes"DataEngine field for row dimensions owned by SheetResizePlugin.
Sheet selection state, navigation, observations, highlights, and commands.
SheetSelectionPlugin owns Sheet selection state. SelectRangeCommand requests a new anchor and focus; the
plugin expands a range when it intersects a merged cell, stages selection operations, and publishes a selection
change after commit. GetSelection and GetSelections read the resulting state, while observations notify a host
that needs to update its interface.
import { GetSelection, SelectRangeCommand } from '@searsuite/sear-plugin-selection';
editor.commands.run(SelectRangeCommand, { anchor: [2, 3], focus: [2, 3] });
const selection = editor.queries.run(GetSelection, undefined);
Use when: responding to pointer, keyboard, or application navigation. Coordinates are zero-based. A host should run the command rather than writing the selection matrix or highlight state directly.
Selection has document-facing operations, local navigation state, and a render projection. SheetHighlightView
draws the current range and can combine additional highlight providers; it does not become the owner of the
selected range. EnsureSelectionVisibleCommand asks the viewport to reveal the selection after navigation.
Workbook remounting captures the local selection session through SheetSelectionSessionStateDefinition. The
feature's command and query contracts remain the same when the active Sheet is recreated.
class SheetSelectionPlugin extends Plugin<[RectRange, RectRange]>Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsApplies a transaction to plugin-owned state and returns the next state.
extendForDownwardEntry(historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}): voidextendForRightwardEntry(historyGroup?: {
readonly id: string;
readonly phase: "begin" | "end";
}): voidgetAdditionalSelections(): readonly SheetRangeBounds[]getDownwardEntryExtensionIndex(): number | nullgetRightwardEntryExtensionIndex(): number | nullisInMergedCell(rangeRect: Rect): Rect | nulllockCommittedState(state: [Rect, Rect]): voidOptionally locks a committed plugin-owned local state value against retained handles.
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.
transactionA committed transaction from the completed pipeline.
reconcileActiveCellVisibility(): voidregisterCommands(commands: SheetCommandBus): voidregisterQueries(queries: SheetQueryRegistry): voidregisterSessionState(registry: SessionStateRegistry): voidregisterState(): {
key: PluginKey;
state: [Rect, Rect];
}Registers one or more plugin-owned state records with the host manager.
interface SelectionChangedInteractionSignal extends SheetInteractionSignalinterface SheetEnsureSelectionVisibleInput extends SheetSelectRangeInputInherited from SheetSelectRangeInput.
Neutral state, planning, and projection dependencies for the selection owner.
readonly codecs?: CellClipboardCodecRegistryreadonly data: DataEnginereadonly formats?: SheetFormatTransferRegistryreadonly merges: Pick<SheetCellMergePlugin, "isMergedCell">readonly ownerData?: SheetClipboardTransferRegistryreadonly queries: SheetQueryRegistryreadonly rangeMoves?: SheetRangeMoveRegistryreadonly validation?: SheetCellInputValidationRegistryPublic programmatic input for selecting a rectangular sheet range.
readonly activeAnchor?: PointOptional active anchor stored for in-progress pointer or keyboard interactions.
readonly activeFocus?: PointOptional active focus stored for in-progress pointer or keyboard interactions.
Transition applied to disjoint local selections at commit.
Final selected range anchor.
readonly ensureVisible?: booleanWhether the command should also scroll the selection into view.
Final selected range focus.
readonly source?: SheetSelectionSourceOrigin of this selection change.
How a selection command updates disjoint local selections.
| Member | Value |
|---|---|
AppendCurrent |
"append-current" |
Clear |
"clear" |
Preserve |
"preserve" |
Enumerates SheetSelectionInteractionName values.
| Member | Value |
|---|---|
Changed |
"selection-changed" |
Observable pipeline and step names owned by the Selection module.
| Member | Value |
|---|---|
SelectionChange |
"selection-change" |
Enumerates SheetSelectionPipelineStepName values.
| Member | Value |
|---|---|
EnsureSelectionVisible |
"selection.ensure-selection-visible" |
RecordSelectionChange |
"selection.record-selection-change" |
UpdateSelection |
"selection.update-selection" |
Enumerates SheetSelectionSource values.
| Member | Value |
|---|---|
Api |
"api" |
Keyboard |
"keyboard" |
Pointer |
"pointer" |
type SheetSelectionSessionState = readonly [RectRange, RectRange]registerSelectionQueries(queries: SheetQueryRegistry, readSelection: (): SheetRangeBounds | null): voidRegisters the selection query against an editor-local query registry.
registerSheetSelectionInteractionReducers(registry: SheetInteractionReducerRegistry): voidRegisters Selection's local interaction projection once per DI container.
GetActiveCell: SheetQueryDefinition<void, readonly [number, number] | null>Reads the cell where the current selection began, including reversed ranges.
GetSelection: SheetQueryDefinition<void, SheetRangeBounds | null>Typed query for the active rectangular selection, independent of selection storage.
GetSelections: SheetQueryDefinition<void, readonly SheetRangeBounds[]>All disjoint selections, with the current active rectangle last.
Drag and move commands update the selected range or fill it, while conflict queries check proposed moves.
class SheetRangeMoveError extends SearErrorA range move rejected before any document state was staged.
SheetRangeMoveError(code: "SHEET_MOVE_INVALID_RANGE" | "SHEET_MOVE_DESTINATION_OCCUPIED", message: string, details: SearErrorDetails): SheetRangeMoveErrorMoves a single rectangle to a new top-left coordinate on the same sheet.
readonly overwrite?: booleanExplicit authorization to replace existing destination data.
readonly source: SheetMoveRangereadonly target: readonly [number, number]Original block and insertion edge of one complete-axis gesture.
Canonical axes for complete row/column selection gestures.
| Member | Value |
|---|---|
Column |
1 |
Row |
0 |
commitAxisDrag(commands: SheetCommandBus, __namedParameters: SheetAxisDragDestination): voidCommits document reordering before updating the local selection to the moved block.
Reads the latest legal destination and owner constraints for a range move.
Clears every rectangle of a disjoint selection in one data transaction.
Fills cells from a selected source rectangle through the pointer destination.
Validates a move and reports whether replacement requires user authorization.
Stable range-move validation failures exposed to hosts.
readonly DestinationOccupied: "SHEET_MOVE_DESTINATION_OCCUPIED"readonly InvalidRange: "SHEET_MOVE_INVALID_RANGE"Sheet cell data ownership and transaction reduction.
class SheetDataPlugin extends Plugin<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.
SheetDataPlugin(state: SheetDataPluginState, formatCodecs?: (): CellFormatTransferRegistry): SheetDataPluginConstructs the sheet data plugin.
stateShared sheet data state.
SheetDataPlugin owns the persisted sheet-data export module.
interestedIn: string[]Sheet data reacts to cell changes and row/column structure edits from any command owner.
readonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Sheet data transactions share the registered MatrixOT algebra.
readonly warnOnDuplicateDepth: falseSheet data is state-only; duplicate render/event depth diagnostics do not apply.
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.
pluginStateCurrent sheet data state.
transactionTransaction containing MatrixOT-compatible operations.
registerFormatTransfers(registry: SheetFormatTransferRegistry): voidContributes this owner's cell state to atomic range moves.
registerQueries(queries: SheetDataQueryRegistry): voidPublishes a live read-only projection for consumers that do not need an export snapshot.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidregisterRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetDataPluginState): SheetMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetDataPluginState;
}Registers the sheet data matrix for commands, rendering, and collaboration.
static readonly documentState: PluginDocumentStateContribution<SheetDataPluginState, SheetDataPluginState>Document-state export contribution for persisted sheet cells.
Stable plugin key shared by all sheet data plugin instances.
static readonly symbol: symbolDI token for resolving the sheet data plugin.
State owned by SheetDataPlugin.
Main sheet matrix containing persisted cell values.
A complete, optional Sheet state-owner plugin example.
class SheetDemoMatrix extends CSRMatrix<SheetDemoMarker | null>One marker per cell; absence and null both mean no marker.
SheetDemoMatrix(data?: SheetDemoMatrixData, shape?: [number, number]): SheetDemoMatrixaddItem(row: number, column: number, marker: SheetDemoMarker | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
setItem(row: number, column: number, marker: SheetDemoMarker | null): thisInherited from CSRMatrix.
class SheetDemoPlugin extends SheetPlugin<SheetDemoPluginState>Reference implementation of a collaborative, matrix-backed Sheet feature.
Document-state export modules owned by this plugin state.
Declares which Sheet OT action names this plugin is interested in.
The engine will only call apply when a transaction contains
at least one operation matching these action names, unless the transaction
is owned by this plugin.
['uc', 'rr', 'rc'] — only called for UpdateCell, ResizeRow, ResizeCol['*'] — called for any transaction (wildcard)[] — only called for this plugin's own transactionsreadonly transactionOT: {
collaborative: boolean;
definition: TransactionOTDefinition<MatrixOTOperation<unknown>>;
ownerId: string;
relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[];
}Shared transaction algebra used by history and collaboration.
readonly warnOnDuplicateDepth: falseapply(state: SheetDemoPluginState, transaction: Transaction): SheetDemoPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
registerCellStyles(registry: SheetCellStyleRegistry): voidContributes semantic cell styles without supplying drawing nodes or native input.
registerCommands(commands: SheetCommandBus): voidRegisters typed commands; subsequent mutations run through the owning command bus.
registerQueries(queries: SheetQueryRegistry): voidRegisters read-only projections without granting mutation authority to callers.
registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes atomic projections for cell-range moves.
registerRangeReorders(registry: SheetRangeReorderRegistry): voidregisterState(): {
dataEngine: {
dataView: {
fieldKey: string;
select: (state: SheetDemoPluginState): SheetDemoMatrix;
viewKey: string;
}[];
};
key: PluginKey;
state: SheetDemoPluginState;
}Registers one or more plugin-owned state records with the host manager.
static readonly documentState: PluginDocumentStateContribution<SheetDemoPluginState, SheetDemoPluginState>static readonly symbol: typeof symbolInherited from SheetPlugin.
readonly markers: SheetDemoMatrixCanonical persisted values owned by the demo feature.
| Member | Value |
|---|---|
Review |
"review" |
Approved |
"approved" |
assertSheetDemoMarker(value: unknown): valueSheetDemoFieldKey: "sheet.demo.markers"The host binds one state object per Sheet editor before plugin construction.
interface SetSheetDemoMarkerInput extends SheetDemoCellInputreadonly marker: SheetDemoMarker | nullreadSheetDemoMarkers(dataEngine: DataEngine): SheetDemoMatrix | nullregisterSheetDemoCommands(commands: SheetCommandBus, source: SheetDemoCommandSource): voidregisterSheetDemoQueries(queries: SheetQueryRegistry, readMatrix: (): SheetDemoMatrix): voidSheet range sorting commands and stable sparse row permutation helpers.
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 override code.
SheetSortError(message: string, details: Record<string, unknown>): SheetSortErrorreadonly code: "SHEET_SORT_INVALID_INPUT"Stable machine-readable identifier for this error category.
class SheetSortPlugin extends Plugin<Record<string, never>>Stateless command owner for stable range sorting.
SheetSortPlugin(dependencies: SheetSortDependencies): SheetSortPluginreadonly warnOnDuplicateDepth: falseapply(state: Record<string, never>, _transaction: Transaction): Record<string, never>Applies a transaction to plugin-owned state and returns the next state.
dispose(): voidregisterCommands(commands: SheetCommandBus): voidregisterState(): {
dataEngine: { enabled: boolean };
key: PluginKey;
state: Record<string, never>;
}Registers one or more plugin-owned state records with the host manager.
Inherited from Plugin.
readonly compareText: (left: string, right: string): numberreadonly readMatrix: (): CSRMatrix<CellMatrixElement>readonly readValue: (row: number, column: number): SheetSortValuereadonly reconcileSelection?: (): voidRepairs a selection hidden by the committed permutation.
readonly reorders: SheetRangeReorderRegistryreadonly firstRowIsHeader?: booleanreadonly keys: readonly SheetSortKey[]readonly range: SheetMoveRangeinferSheetSortHeader(matrix: Pick<CSRMatrix<CellMatrixElement>, "getItem">, range: SheetMoveRange): booleanRecognizes a text header when a column switches to numeric records below it.
readonly column: numberreadonly direction: SheetSortDirectionreadonly changed: booleanreadonly destinationOf: (row: number): numberreadonly range: SheetMoveRange| Member | Value |
|---|---|
Ascending |
"ascending" |
Descending |
"descending" |
type SheetSortValue = number | string | boolean | nullcreateSheetSortPermutation(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.
Platform-neutral drawing contracts with Web Canvas, SVG, WebGL, and headless adapters.
RenderContext is the drawing contract used by scene nodes and render strategies. It receives drawing commands
for a frame; the host chooses the concrete target. A web host can use WebCanvasRenderContext,
WebSvgRenderContext, or WebWebGLRenderContext. A host without a visible view can use
HeadlessRenderContext.
The editor also uses separate offscreen and hit-test contexts. Their DI tokens are
RenderContext.offScreenSymbol and RenderContext.hitSymbol; the visible target uses RenderContext.symbol.
Render code uses these contracts so it does not need to know which host target was chosen.
Platform-neutral immediate-mode drawing contract used by render strategies.
Concrete render targets implement this shape so scene nodes and strategies can draw without depending on host-specific APIs.
isDrawn: booleanWhether the target has received at least one draw operation.
abstract addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
abstract addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
abstract addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
abstract addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
abstract addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
abstract addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
beginNodeSemantics(_semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
abstract beginPath(): voidBegins a new path.
abstract clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
abstract clip(): voidClips future drawing to the active path.
abstract cloneNode(): RenderContextCreates a same-kind render context for an auxiliary render layer.
abstract closePath(): voidCloses the active path.
abstract createHitNode(): RenderContextCreates a same-kind render context configured for hit testing.
abstract drawImage(image: unknown, x: number, y: number): void
abstract drawImage(image: unknown, x: number, y: number, width: number, height: number): void
abstract drawImage(image: unknown, x: number, y: number, width: number, height: number, sx: number, sy: number, sWidth: number, sHeight: number): voidDraws an image at its natural size.
endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
abstract fill(): voidFills the active path with the current fill style.
abstract fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
abstract getAttribute(name: string): stringReads a host-visible attribute from the backing target.
abstract getImageData(x: number, y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
abstract getLineWidth(): numberReturns the current stroke line width.
abstract getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
abstract getRasterScale(): numberRaster units represented by one host-view unit for this context.
abstract getRenderTarget(): unknownReturns the native backing target owned by this render context.
abstract getRoot(): unknownReturns the event root associated with this render context.
abstract getViewScale(): numberReturns the current logical view scale.
abstract initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
abstract lineTo(x: number, y: number): voidAdds a line from the current path cursor.
abstract measureText(text: string): {
fontAscent?: number;
fontDescent?: number;
fontLineGap?: number;
height: number;
width: number;
}Measures text using the active font and returns normalized metrics.
abstract moveTo(x: number, y: number): voidMoves the active path cursor.
abstract putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
abstract rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
abstract removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
abstract removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
abstract removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
abstract removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
abstract removeResizeListener(): voidRemoves the active resize listener, if any.
requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
resetHitFrame(width: number, height: number): voidResets the complete hit-test frame using the target's native lifecycle.
abstract resetTransform(): voidResets the current transform to the identity transform.
abstract resize(width: number, height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
abstract restore(): voidRestores the most recently saved drawing state.
abstract save(): voidSaves the current drawing state.
abstract setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
abstract setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
abstract setFont(font: string): voidSets the active platform-neutral font descriptor.
abstract setLineDash(segments: number[]): voidSets the current line dash pattern.
abstract setLineWidth(width: number): voidSets the current stroke line width.
abstract setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
abstract setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
abstract setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
abstract stroke(): voidStrokes the active path with the current stroke style.
abstract strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
supportsCachedOverlayRedraw(): booleanSupports restoring clipped raster regions from the current body cache.
supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
abstract translate(x: number, y: number): voidTranslates the current drawing transform.
static readonly hitSymbol: symbolDI token for the hit-test render layer.
static readonly offScreenSymbol: symbolDI token for the scroll-optimization render layer.
static readonly symbol: symbolDI token for the primary visible render layer.
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.
readonly clickCount?: numberConsecutive click count normalized by host adapters when available.
Semantic ownership metadata attached to drawing for retained targets and diagnostics.
Pointer event shape shared by renderers without requiring host-native event types.
readonly altKey?: booleanreadonly button?: numberNormalized button index: zero is the primary pointer button.
readonly clickCount?: numberreadonly clientX?: numberreadonly clientY?: numberreadonly ctrlKey?: booleanreadonly detail?: numberreadonly metaKey?: booleanreadonly offsetX: numberreadonly offsetY: numberreadonly shiftKey?: booleanreadonly target?: unknownpreventDefault(): voidstopPropagation(): voidtype RenderGradient = objectOpaque paint handles supplied by a concrete renderer.
type RenderImageSource = unknowntype RenderPaint = string | RenderGradient | RenderPatterntype RenderPattern = objectOpaque pattern handles supplied by a concrete renderer.
Pointer input begins in host-view coordinates, while document content and scrolling use world coordinates.
CoordinateTransformer.viewToWorld() applies the current view scale and scroll offset before hit testing or
selecting content. worldToView() maps a document position back to the visible view.
Use viewToRaster() only when reading pixels from the hit-test target: raster coordinates also account for
that target's pixel scale. CoordinatePoint is the simple {x, y} value passed between these conversions.
Single authority for host-view, world, and raster coordinate conversion.
CoordinateTransformer(scrollManager: ScrollManager, renderContext: RenderContext, hitRenderContext: RenderContext): CoordinateTransformergetVisibleWorldRect(): PositionRect<unknown>Returns the visible world rect.
viewToRaster(point: CoordinatePoint): CoordinatePointConverts a host-view point into raster coordinates for pixel reads.
viewToWorld(point: CoordinatePoint, scroll?: Pick<ScrollManagerState, "x" | "y">): CoordinatePointConverts a host-view point into world coordinates.
worldToView(point: CoordinatePoint, scroll?: Pick<ScrollManagerState, "x" | "y">): CoordinatePointConverts a world point into host-view coordinates.
static readonly symbol: symbolDI token for resolving the host-neutral coordinate transformer.
Headless contexts preserve engine state and hit-test roles without producing a visible raster.
class HeadlessHitRenderContext extends HeadlessRenderContextHit-test layer marker for a headless render pipeline.
static readonly symbol: symbolDI token for resolving HeadlessHitRenderContext.
Inherited from HeadlessRenderContext.
class HeadlessOffScreenRenderContext extends HeadlessRenderContextOff-screen layer marker for a headless render pipeline.
static readonly symbol: symbolDI token for resolving HeadlessOffScreenRenderContext.
Inherited from HeadlessRenderContext.
class HeadlessRenderContext extends RenderContextRender context that preserves engine state while producing no raster output.
addClickEventListener(_callback: (event: EventWithOffset): void): voidAttaches a click listener.
addEventListener(_type: string, _callback: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
addMouseDownEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
addMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
addMouseUpEventListener(_callback: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
addResizeListener(_callback: (): void): voidAttaches a resize listener for host target size changes.
beginPath(): voidBegins a new path.
clearRect(_x: number, _y: number, _width: number, _height: number): voidClears a rectangle from the target.
clip(): voidClips future drawing to the active path.
Creates a same-kind render context for an auxiliary render layer.
closePath(): voidCloses the active path.
Creates a same-kind render context configured for hit testing.
Draws an image at its natural size.
fill(): voidFills the active path with the current fill style.
fillText(_text: string, _x: number, _y: number, _maxWidth?: number): voidDraws text at the given position.
getAttribute(name: string): stringReads a host-visible attribute from the backing target.
getImageData(_x: number, _y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
getLineWidth(): numberReturns the current stroke line width.
getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
getRasterScale(): numberRaster units represented by one host-view unit for this context.
getRenderTarget(): unknownReturns the native backing target owned by this render context.
getRoot(): unknownReturns the event root associated with this render context.
getViewScale(): numberReturns the current logical view scale.
initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
lineTo(_x: number, _y: number): voidAdds a line from the current path cursor.
measureText(text: string): {
height: number;
width: number;
}Measures text using the active font and returns normalized metrics.
moveTo(_x: number, _y: number): voidMoves the active path cursor.
putImageData(_imageData: RenderImageData, _x: number, _y: number): voidWrites raster pixels to the target.
rect(_x: number, _y: number, _width: number, _height: number): voidAdds a rectangle to the active path.
removeClickEventListener(_callback: (event: EventWithOffset): void): voidRemoves a click listener.
removeMouseDownEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
removeMouseMoveEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
removeMouseUpEventListener(_callback: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
removeResizeListener(): voidRemoves the active resize listener, if any.
resetTransform(): voidResets the current transform to the identity transform.
resize(_width: number, _height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
restore(): voidRestores the most recently saved drawing state.
save(): voidSaves the current drawing state.
setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
setFillStyle(_fillStyle: RenderPaint): voidSets the current fill style.
setFont(_font: string): voidSets the active platform-neutral font descriptor.
setLineDash(_segments: number[]): voidSets the current line dash pattern.
setLineWidth(width: number): voidSets the current stroke line width.
setStrokeStyle(_strokeStyle: RenderPaint): voidSets the current stroke style.
setTransform(_a: number, _b: number, _c: number, _d: number, _e: number, _f: number): voidReplaces the current transform matrix.
setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
stroke(): voidStrokes the active path with the current stroke style.
strokeRect(_x: number, _y: number, _width: number, _height: number): voidStrokes a rectangle without requiring a separate path.
translate(_x: number, _y: number): voidTranslates the current drawing transform.
static readonly symbol: symbolDI token for resolving the headless render context.
Conversions between document, viewport, screen, and host-view coordinates.
class CoordinateEngine extends ViewExtensionBase<SearCoreSheet, CellProperties>Sheet view service that tracks pointer and scroll coordinates.
CoordinateEngine is the view-facing facade over CoordinateTransformer: it caches the latest host pointer position, reads ScrollManager state, and exposes conversions between view and world coordinates.
CoordinateEngine(scrollManager: ScrollManager, coordinates: CoordinateTransformer): CoordinateEngineConstructs the coordinate engine and subscribes it to scroll updates.
scrollManagerScroll state manager for the current sheet.
coordinatesShared coordinate transformer.
depth: numberTracks pointer events before visible views consume them.
Returns a detached projection of the current input and viewport coordinates.
Returns the latest pointer position in host-event coordinates.
ReturnsCurrent pointer coordinate as recorded from mouse events.
Returns the latest pointer position in viewport coordinates.
Returns the latest pointer position in scrolled sheet-world coordinates.
ReturnsCurrent pointer converted through the active scroll transform.
getVisibleScreenRect(): PositionRect<unknown>Returns the current host-view viewport rectangle.
ReturnsVisible screen-space rectangle starting at the viewport origin.
getVisibleWorldRect(): PositionRect<unknown>Returns the currently visible sheet-world rectangle.
ReturnsVisible world-space viewport rectangle.
onMouseMove(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidTracks the latest pointer position from sheet mouse-move events.
eventPointer event carrying host-view offsets.
screenToView(screenX: number, screenY: number): CoordinatePointConverts a host-event point into an unscrolled viewport point.
screenToWorld(screenX: number, screenY: number): CoordinatePointConverts a host-event point into sheet-world coordinates.
ReturnsPoint in sheet-world coordinates.
screenXHost-event x-coordinate.
screenYHost-event y-coordinate.
worldToScreen(worldX: number, worldY: number): CoordinatePointConverts a sheet-world point into host-view coordinates.
ReturnsPoint in host-view coordinates.
worldXSheet-world x-coordinate.
worldYSheet-world y-coordinate.
Two-dimensional point in the sheet coordinate system returned by this engine.
Local coordinate state tracked by CoordinateEngine.
mouseScreenX: numberLatest pointer x-position in host-event view coordinates.
mouseScreenY: numberLatest pointer y-position in host-event view coordinates.
scrollX: numberLatest horizontal scroll offset in world coordinates.
scrollY: numberLatest vertical scroll offset in world coordinates.
Creates default local coordinate values.
ReturnsInitial pointer and scroll coordinates.
Portable cursor policies with Web and headless host adapters.
Abstract cursor presentation layer.
Responsibilities: translate a logical CursorToken into a concrete presentation (CSS cursor, Canvas sprite, Electron native cursor, test stub, …). Fully decoupled from the Plugin system and the rule system.
Contract:
abstract apply(token: CursorToken): voidApplies a transaction to CursorEngine state.
abstract mount(target: unknown): voidAttaches this adapter to its host surface.
abstract override(token: CursorToken | null): voidLock the cursor to a fixed token (e.g. during cell editing). Pass null to release.
abstract unmount(): voidDetaches this adapter from its host surface.
static readonly symbol: symbolDI token for resolving CursorEngine.
Stores cursor rules and resolves the correct CursorToken for a given CellProperties.
Resolution priority (highest → lowest):
CursorRegistry(platform?: Platform): CursorRegistryCreates a registry and optionally enables position-rule conflict diagnostics.
register(rule: CursorRule): (): voidRegisters a cursor rule and returns an idempotent disposer that restores the previous rule for the same key when applicable.
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.
rulePosition rule fields excluding the fixed kind discriminator.
resolve(properties: CellProperties | null, position?: CursorPosition): CursorTokenResolves a logical cursor token without exposing presentation details.
propertiesHit-tested cell properties, if any.
positionPointer context used by registered coordinate rules.
static readonly symbol: symbolDI token for resolving CursorRegistry.
class HeadlessCursorEngine extends CursorEngineCursor adapter for environments that have no visible pointer.
apply(_token: CursorToken): voidApplies a transaction to HeadlessCursorEngine state.
mount(_target: unknown): voidAttaches this adapter to its host surface.
override(_token: CursorToken | null): voidApplies a temporary host cursor override.
unmount(): voidDetaches this adapter from its host surface.
static readonly symbol: symbolDI token for resolving HeadlessCursorEngine.
Pointer coordinates supplied to a position cursor rule for one pointer event.
Sheet core whose current data and interaction state may inform the cursor decision.
Original host pointer event.
target: CellProperties | nullHit-tested cell properties, or null when the pointer is not over a scene node.
view: {
x: number;
y: number;
}Pointer location relative to the rendered viewport.
world: {
x: number;
y: number;
}Pointer location in scrollable sheet-world coordinates.
Cursor rule evaluated from the pointer location rather than a hit node. Higher layers win over lower layers and all structural cursor rules. When multiple matching rules share the highest layer, the last registered rule wins and CursorRegistry reports the ambiguous registration once.
Logical cursor presented while this rule owns the pointer.
key: string | symbolStable owner key used for replacement, removal, and conflict diagnostics.
kind: "position"layer: numberPrecedence among position rules; larger values take precedence.
test: (position: CursorPosition): booleanReturns whether this rule owns the supplied pointer location.
Fully custom predicate rule.
priority: 'high' → evaluated before region/type rules (e.g., isEdit override). priority: 'low' → evaluated after region/type rules as a fallback (default).
Exact region-match rule (highest priority among structural rules).
Type-field match rule (secondary match).
Built-in tokens plus an extension point for third-party plugins.
readonly Cell: "cell"readonly ColumnResize: "col-resize"readonly ColumnSelect: "col-select"readonly Copy: "copy"readonly Default: "default"readonly Grab: "grab"readonly Grabbing: "grabbing"readonly Move: "move"readonly NotAllowed: "not-allowed"readonly Pointer: "pointer"readonly RowResize: "row-resize"readonly RowSelect: "row-select"readonly Text: "text"readonly Position: "position"readonly Predicate: "predicate"readonly Region: "region"readonly Type: "type"readonly High: "high"readonly Low: "low"Frame scheduling, dirty-region coordination, and Sheet render orchestration.
DataEngine publishes typed field projections from state-owning features. SheetRenderEngine consumes the selected
projections, tracks dirty regions, and schedules a frame. Render nodes and strategies turn those values into draw
operations on a RenderContext; the host supplies the concrete drawing adapter.
A command changes owner state first. After commit, the relevant projection and dirty region determine what is repainted. Rendering a value does not make it durable document state: formula results, layout caches, and viewport data may be derived or local to one editor session.
A visual editor needs a render context, text shaping, input, and viewport adapters compatible with its host.
RenderContextFactory helps the assembly obtain the chosen context; Canvas, SVG, and other concrete adapters stay
outside the portable domain model. A headless editor can omit visual services.
Use when: building a visual host or contributing a rendering feature. Register the feature's data field or visual reader at its owner, then consume that projection in the render layer. Host event handlers should request edits through commands rather than changing render data directly.
class RenderEngine<NodeType>Rendering boundary between the editor's scene and a host render context.
A concrete engine chooses strategies for painting, dirty regions, and cache reuse. The core supplies scene nodes after state commits; callers can mark affected regions, resize the target, or invalidate cached pixels before the next render. The abstract class does not select a browser drawing API.
RenderEngine<NodeType>(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, renderStrategyManager: RenderStrategyManager<NodeType>): RenderEngine<NodeType>readonly configEngine: ConfigEnginereadonly renderContext: RenderContextreadonly renderStrategyManager: RenderStrategyManager<NodeType>readonly scrollManager: ScrollManagerabstract initialize(): voidInitializes RenderEngine.
abstract invalidateScreenCache(): voidDiscard pixel-cache reuse before the next render.
abstract markDirty(rect: PositionRect<templateLiteral>): voidMarks a region or the current scene for rendering on the next frame.
Renders RenderEngine scene output.
abstract resize(width: number, height: number, scale: number): voidResizes the render target and invalidates dependent frame state.
abstract setViewScale(scale: number): voidUpdates the view scale.
static readonly symbol: symbolDI token for resolving RenderEngine.
Factory registry for render-context implementations.
static createContext(type: string | symbol, args: unknown): RenderContextCreates a render context for a registered type.
ReturnsNew render context instance.
typeContext type key.
argsAdapter-specific construction input.
static registerContext(type: string | symbol, contextCreator: (args: unknown): RenderContext): voidRegisters a render-context creator.
typeContext type key.
contextCreatorFactory invoked by createContext().
class SheetRenderEngine extends RenderEngine<CellProperties>Concrete Sheet renderer composed from screen, dirty, sticky, and overlay passes.
The passes run in that order so sticky headers survive dirty-region redraws and overlays remain visible above cell content. Resizing or changing the view scale invalidates retained screen pixels; the next render repaints through the configured render contexts.
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>): SheetRenderEngineapply(operations: MatrixOTOperation<number>[]): voidApplies a transaction to SheetRenderEngine state.
canRestoreOverlay(): booleanWhether only the final sticky and edit layers need to be recomposited.
getLayer(): voidReturns the layer.
getStage(): voidReturns the stage.
initialize(): voidInitializes SheetRenderEngine.
invalidateScreenCache(): voidDrops retained screen content so the next frame repaints it.
markDirty(rect: PositionRect<templateLiteral>): voidMarks a region or the current scene for rendering on the next frame.
onClick(): voidHandles the click lifecycle event.
onScroll(scrollManagerState: ScrollManagerState): voidHandles the scroll lifecycle event.
render(node: Node<CellProperties>): voidRenders SheetRenderEngine scene output.
renderOverlay(node: Node<CellProperties>, damage: readonly PositionRect<templateLiteral>[]): voidComposites all decorations once, clipped to the union of damaged viewport rectangles.
resize(width: number, height: number, scale: number): voidResizes every canvas layer and invalidates scroll optimization buffers.
setViewScale(scale: number): voidUpdates the view scale.
class DocRenderEngine extends RenderEngine<NodeProperties>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.
DocRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, stage: SceneGraph<NodeProperties>, renderStrategyManager: RenderStrategyManager<NodeProperties>, screenRenderStrategy: ScreenRenderStrategy<NodeProperties>, dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>, stickyRenderStrategy: StickyRenderStrategy<NodeProperties>, overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>): DocRenderEnginegetLastScreenRenderMode(): ScreenRenderFrameMode | nullReturns the screen strategy mode used by the last render pass, if it painted.
initialize(): voidInitializes DocRenderEngine.
invalidateScreenCache(): voidInvalidates the off-screen body cache used by the screen strategy.
markDirty(rect: PositionRect<templateLiteral>): voidMarks one document-world rectangle dirty for the next dirty pass.
render(node: Node<NodeProperties>): voidRuns the configured document render strategies over the current scene graph.
resize(width: number, height: number, scale: number): voidResizes all Doc render layers and invalidates screen-cache reuse.
setBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): voidSupplies one layout-shift raster-copy plan for the next screen render pass.
setViewport(viewport: DocRenderViewport): voidUpdates the viewport model used by subsequent render frames.
setViewScale(scale: number): voidUpdates the view scale on every render strategy context.
static readonly symbol: symbolDI token for resolving DocRenderEngine.
Inherited from RenderEngine.
Snapshot of the current document viewport used by render strategies.
readonly contentRect: PositionRectPropsEditable content rectangle inside the viewport.
readonly height: numberVisible viewport height in host-view units.
readonly width: numberVisible viewport width in host-view units.
Hit testing and render-node event propagation.
class ViewExtensionBase<Context, Properties> extends ViewExtension<Context, Properties>Presentation identity and local lifecycle guards, without document state or reducers.
readonly [ViewExtensionRole]: trueIdentifies this contribution as presentation rather than a document state owner.
readonly depth: numberOrders scene contributions; lower values are drawn first.
Stable identity used to register and dispose this contribution within one editor.
readonly warnOnDuplicateDepth: booleanEnables diagnostics when presentation priorities collide.
enforceRuntimeWriteBoundary(assertWrite: (): void): voidInstalls the editor's authority check for view-local commands and session restoration.
registerConfig(): {
config: object;
key: OwnerKey;
}[]Default display configuration contributions for this view.
class ViewExtensionRegistry<Context, Properties>Editor-local presentation registrations, independent of state-owner registration.
destroy(): voidReleases every presentation, including listeners and renderer registrations.
forEach(visit: (extension: ViewExtension<Context, Properties>): void): voidVisits view extensions in drawing order.
forEachInput(visit: (extension: ViewExtension<Context, Properties>): void): voidDispatch order follows registration so input controllers can consume events before selection.
get(key: OwnerKey): ViewExtension<Context, Properties> | undefinedResolves a view identity without accessing a state plugin.
getAll(): readonly ViewExtension<Context, Properties>[]Lists presentation contributions without exposing business state owners.
register(extension: ViewExtension<Context, Properties>): (): voidRegisters one presentation and returns its owned disposer.
subscribeRemovals(listener: (extension: ViewExtension<Context, Properties>): void): (): voidLets a scene consumer release retained nodes and input bindings on removal.
unregister(key: OwnerKey): voidRemoves one view together with its owned listeners and retained scene output.
static readonly symbol: typeof symbolinterface ViewExtension<Context, Properties>Optional presentation of state read through a host-owned view context.
readonly [ViewExtensionRole]: trueIdentifies this contribution as presentation rather than a document state owner.
readonly depth?: numberOrders scene contributions; native input follows view registration order.
readonly invalidatesRetainedViews?: booleanTrue while this contribution changes the painting of other retained views on commit.
Stable identity used to register and dispose this contribution within one editor.
readonly rectangularOverlay?: booleanRectangular, viewport-bounded decorations composited over the cached body.
readonly retainOnOwnerChange?: readonly OwnerKey[]Sole state owners whose commits leave this view's retained nodes valid.
readonly warnOnDuplicateDepth?: booleanEnables diagnostics when presentation priorities collide.
destroyView(): voidReleases this presentation and its native listeners without changing document state.
dirtyRect(context: Context, transaction: Transaction): PositionRect<unknown> | null | undefinedComputes view-local damage from committed changes when partial repainting is supported.
initializeView(context: Context): voidBinds presentation services after every view contribution has been registered.
onClick(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | voidTranslates a click into typed commands; false consumes the event.
onCommit(context: Context): voidSynchronizes view-local resources after a successful state publication and before painting.
onDblClick(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | voidTranslates a double click into typed commands; false consumes the event.
onMouseDown(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | voidBegins a pointer gesture through typed commands; false consumes the event.
onMouseMove(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | voidUpdates a view-owned pointer gesture; false consumes the event.
onMouseUp(context: Context, event: EventWithOffsetAndTarget<Properties>): boolean | voidEnds a view-owned pointer gesture and releases capture; false consumes the event.
onResize(): voidRefreshes view-local geometry after the host viewport changes.
onScroll(state: ScrollManagerState): voidReceives viewport movement without modifying document content.
registerConfig(): {
config: object;
key: OwnerKey;
}[]Supplies display defaults before the first scene is constructed.
Reads committed state and returns retained nodes for the current viewport.
renderScrolled(context: Context, previous: readonly Node<Properties>[]): Node<Properties>[]Returns the next viewport scene, optionally reusing attached nodes on a pure scroll.
ViewExtensionRole: unique symbolExplicit presentation role; state owners cannot register as views accidentally.
class EventEngine<NodeTypeProperties> extends EventListener<string>Coordinates render-context events, hit testing and plugin event dispatch.
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.
readonly configEngine: ConfigEnginereadonly eventRegistrar: EventRegistrarreadonly eventRenderStrategy: EventRenderStrategy<NodeTypeProperties>readonly hitRenderStrategy: HitRenderStrategy<NodeTypeProperties>readonly renderContext: RenderContextreadonly scrollManager: ScrollManagerreadonly stageNode: SceneGraph<NodeTypeProperties>addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidRegisters a named render strategy used by event handling.
destroy(ownerToken?: object): voidClears plugin handlers so a destroyed sheet cannot react to host events.
getNodeAtViewPoint(x: number, y: number): Node<NodeTypeProperties> | nullResolves a screen point through the same hit layer used by pointer events.
getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefinedReturns a previously registered event render strategy.
initialize(): voidRegisters built-in strategies and attaches render-context listeners.
registerEvent<Event>(eventKey: string, handler: (event: Event): void): (): voidRegisters a plugin event handler for a normalized event key.
Attaches platform event listeners to the underlying render context.
Rebuilds the hit layer for the given scene graph.
renderHitOnNextFrame(node: Node<NodeTypeProperties>): voidCoalesces scroll-driven hit refreshes to at most one per animation frame.
renderImmediate(node: Node<NodeTypeProperties>): voidRender the hit canvas immediately, bypassing the debounce timer.
See HitRenderStrategy.renderImmediate() for details.
static readonly symbol: symbolDI token for resolving the event engine.
Base registry for event names supported by one host event adapter.
registeredEvents: string[]Normalized event names currently registered for dispatch.
enforceCommandBoundary(assertWrite: (): void): voidPublishes a read-only event-name view after editor assembly.
register(eventKey: string): voidRegisters an event name after normalizing platform casing.
eventKeyEvent name requested by a plugin.
unregister(eventKey: string): voidRemoves a registered event name.
eventKeyEvent name requested by a plugin.
static readonly symbol: symbolDI token for resolving the event registrar.
class HeadlessEventRegistrar extends EventRegistrarEvent registrar for hosts without a native event source.
static readonly symbol: symbolDI token for resolving HeadlessEventRegistrar.
interface EventWithOffsetAndTarget<NodeTypeProperties>Plugin event payload enriched with hit-tested scene target.
clickCount?: numberConsecutive click count for this pointer activation, when known.
Original host event emitted by the render context.
Topmost scene node hit by the event, or null when empty.
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.
readonly clickCount?: numberConsecutive click count normalized by host adapters when available.
getViewHandlerName(eventKey: string): stringDerives the plugin handler method name for a given event key.
e.g. mousedown / mouseDown → onMouseDown
normalizeEventKey(eventKey: string): stringNormalizes an event key (whether lowercased like mousedown or camelCased like mouseDown)
to its canonical engine identifier (mouseDown).
Keyboard, pointer, text-input, and composition routing contracts.
class HeadlessKeyboardRouter extends KeyboardRouterKeyboard router for hosts that do not expose a keyboard event source.
startListener(): voidStarts listening to the host input source.
stopListener(): voidStops listening to the host input source.
subscribe(_handlers: KeyboardRouterHandlers): voidSubscribes to state changes and returns an idempotent disposer.
static readonly symbol: symbolDI token for resolving HeadlessKeyboardRouter.
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.
abstract startListener(): voidStarts listening to the host input source.
abstract stopListener(): voidStops listening to the host input source.
Registry for input adapters owned by one editor instance.
InputManager(textInput: Input): InputManagerConstructs the manager with the configured text input adapter.
textInputText input adapter resolved from the host.
get<T>(symbol: symbol): T | undefinedRetrieves an input adapter by symbol.
ReturnsRegistered adapter, or void 0 when absent.
symbolAdapter symbol.
getTextInput(): TextInput | undefinedReturns the text-input adapter when it has been registered.
Registers an input adapter.
symbolAdapter symbol.
inputAdapter instance.
static readonly symbol: symbolDI token for resolving the input manager.
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. Unlike TextInput,
implementations MUST work regardless of which DOM element currently holds
focus – this is the key contract that fixes the "Ctrl+A lost after clicking
canvas" problem.
Lifecycle:
startListener() – attach the listener for the editor instance.
stopListener() – detach it when the editor is destroyed.
abstract subscribe(handlers: KeyboardRouterHandlers): void | (): voidInstalls handlers; implementations may return a disposer that restores the previous handlers.
static readonly symbol: symbolDI token for resolving KeyboardRouter.
Inherited from Input.
Callbacks for all keyboard-shortcut / action-key events that the editor needs
to intercept. These are intentionally separate from text composition events
(which remain the responsibility of TextInput).
onArrowDown?: (shiftKey: boolean, metaKey: boolean): voidonArrowLeft?: (shiftKey: boolean, metaKey: boolean, altKey?: boolean): voidonArrowRight?: (shiftKey: boolean, metaKey: boolean, altKey?: boolean): voidonArrowUp?: (shiftKey: boolean, metaKey: boolean): voidonCopy?: (): voidCtrl/Cmd + C - copy the active sheet selection.
onCopyFormulaAbove?: (): voidCtrl+' copies the formula above the active cell exactly.
onCut?: (): voidCtrl/Cmd + X - cut the active sheet selection.
onDelete?: (direction?: "backward" | "forward", byWord?: boolean): voidBackspace / Delete key, with its deletion direction and word modifier.
onDeleteCells?: (): voidOpens the selected-cell deletion choices.
onEdit?: (): voidEnters editing while retaining the selected cell's content.
onEnd?: (shiftKey: boolean): voidMoves to the last occupied cell of the sheet.
onEnter?: (shiftKey: boolean, primaryModifier?: boolean): voidEnter key – commit the current edit.
onEscape?: (): boolean | voidEscape key – cancel the current edit; return false to leave the key to the host.
onFillDown?: (): voidCtrl/Cmd + D/R - fill the selection from its top row/left column.
onFillRight?: (): voidonHideColumns?: (): voidonHideRows?: (): voidHides the selected rows or columns in a sheet host.
onHome?: (primaryModifier: boolean, shiftKey: boolean): voidMoves to the start of the active row, or sheet with a primary modifier.
onHorizontalPage?: (direction: -1 | 1, shiftKey: boolean): voidMoves the active selection and viewport horizontally by one page.
onInsertCurrentDate?: (): booleanCtrl+; inserts the current date as a static cell value.
onInsertCurrentTime?: (): booleanCmd+; inserts the current time as a static cell value.
onLineEnd?: (shiftKey: boolean): voidMoves the active text caret to the end of its line while editing.
onPage?: (direction: -1 | 1, shiftKey: boolean): voidMoves the active selection by roughly one viewport.
onPaste?: (valuesOnly: boolean): voidCtrl/Cmd + V - paste from the host clipboard.
onRedo?: (): voidCtrl/Cmd + Shift + Z or Ctrl/Cmd + Y - redo the latest undone mutation.
onSelectAll?: (): voidCtrl/Cmd + A – select all content in the editor.
onSelectColumn?: (): voidSelects the entire active column.
onSelectRow?: (): voidSelects the entire active row.
onSoftEnter?: (): voidAlt/Option + Enter – insert a line break (soft enter) inside the cell.
onTab?: (shiftKey: boolean): voidTab / Shift+Tab - move the active sheet selection horizontally.
onToggleBold?: (): voidCtrl/Cmd + B - toggle bold text in the active rich-text editor.
onToggleItalic?: (): voidCtrl/Cmd + I - toggle italic text in the active rich-text editor.
onToggleReference?: (): voidCycles the reference at the formula caret through relative and absolute modes.
onToggleStrikethrough?: (): voidCtrl/Cmd + Shift + X - toggle strikethrough text in the active rich-text editor.
onToggleUnderline?: (): voidCtrl/Cmd + U - toggle underlined text in the active rich-text editor.
onUndo?: (): voidCtrl/Cmd + Z - undo the latest sheet mutation.
onUnhandledEscape?: (): booleanEscape not handled by a focused host control; return true only when consumed.
onZoomIn?: (): voidonZoomOut?: (): voidonZoomReset?: (): voidclass HeadlessPointerCapture extends PointerCaptureNo-op pointer capture adapter for hosts without a pointer event source.
start(_handlers: PointerCaptureHandlers): (): voidStarts one capture session and returns a disposer for that session.
stop(): voidStops the active session without invoking its release callback.
Platform-neutral, editor-local host-wide pointer capture contract.
abstract start(handlers: PointerCaptureHandlers): (): voidStarts one capture session and returns a disposer for that session.
abstract stop(): voidStops the active session without invoking its release callback.
static readonly symbol: symbolDI token for resolving the pointer capture adapter.
Callbacks active for one host-wide pointer capture session.
Pointer position normalized to the editor render root's view coordinates.
readonly view: {
readonly x: number;
readonly y: number;
}class HeadlessTextInput extends TextInputText-input adapter that intentionally owns no platform input element.
startListener(): voidStarts forwarding host text and composition events.
stopListener(): voidStops forwarding host text and composition events.
subscribe(_handlers: TextInputHandlers): voidSubscribes to state changes and returns an idempotent disposer.
static readonly symbol: symbolDI token for resolving HeadlessTextInput.
Routes host text and composition input through portable subscriptions.
refocus(): voidRestores focus to the hidden host text-input surface.
setPosition(_x: number, _y: number): voidUpdates the position.
startListener(): voidStarts forwarding host text and composition events.
stopListener(): voidStops forwarding host text and composition events.
subscribe(_handlers: TextInputHandlers): voidSubscribes to state changes and returns an idempotent disposer.
static readonly symbol: symbolDI token for resolving TextInput.
static isTextInput<T>(event: T): eventClassifies text events within a typed input-action union.
Portable text and selection-deletion subscriptions.
onCut?: (): string | nullSupplies selected text for a host-native cut event.
onDelete?: (): voidReceives a clipboard cut as deletion of the current selection.
onPaste?: (text: string): booleanReturns true when a host handles a native paste as a committed grid operation.
onTextInput?: (event: TextInputEvent): voidReceives committed text and composition updates through one ordered stream.
Platform-neutral text shaping and glyph measurement contracts.
class RenderContextTextShaper extends TextShaperPortable fallback backed by the host's render-neutral text measurements.
Owns reusable semantic text measurements for one editor runtime.
TextMeasurementManager(textShaper: TextShaper): TextMeasurementManagerclear(): voidClears semantic measurements without taking ownership of the text shaper.
measureSpace(font: string): TextShapeResultMeasures one space for a font and reuses the editor-local result.
static readonly symbol: typeof symbolDI token for resolving the editor-local text measurement manager.
Abstract adapter boundary for HarfBuzz, Skia, browser-native, or platform text-shaping implementations.
Concrete adapters translate the normalized request to their shaping library and return engine-neutral glyph/cluster data.
clearCache(): voidClears all cached shaping results owned by this adapter.
shape(input: TextShapeInput): TextShapeResultShapes one homogeneous text run, reusing an identical cached request.
static readonly symbol: symbolDI token for resolving the editor-local text-shaper provider.
Structured font values supplied by editor configuration and host contexts.
readonly fontFamily: stringreadonly fontSize: numberA logical caret boundary produced by the shaping implementation.
readonly textOffset: numberUTF-16 source-text offset for this caret boundary.
readonly x: numberAdvance position in the shaped run's logical direction.
One positioned glyph returned by a text-shaping implementation.
Mapping between source text and the glyph range generated for it.
readonly glyphEnd: numberreadonly glyphStart: numberreadonly textEnd: numberreadonly textStart: numberInput passed to a text-shaper implementation. Offsets are UTF-16 offsets.
readonly direction?: TextShapeDirectionreadonly features?: Readonly<Record<string, TextShapeFeatureValue>>Explicit OpenType feature settings, for example { liga: true, kern: true }.
readonly font: stringFont descriptor understood by the selected shaping implementation.
readonly language?: stringISO/BCP language tag, when known.
readonly script?: stringOpenType script tag, when known.
readonly text: stringreadonly variations?: Readonly<Record<string, number>>Variation-axis values for variable fonts, keyed by four-character axis tag.
Engine-neutral result of shaping one homogeneous text run.
readonly caretStops: readonly ShapedCaretStop[]readonly clusters: readonly ShapedTextCluster[]readonly fontAscent?: numberreadonly fontDescent?: numberreadonly fontLineGap?: numberreadonly glyphs: readonly ShapedGlyph[]readonly height: numberTotal vertical advance, normally zero for horizontal text.
readonly width: numberTotal horizontal advance of the shaped run.
type NormalizedTextShapeInput = Required<TextShapeInput>Input shape passed from the base class to a concrete text-shaper adapter.
type TextShapeDirection = "ltr" | "rtl"Direction of a shaped text run in logical document order.
type TextShapeFeatureValue = boolean | numberOpenType feature value accepted by a text-shaper adapter.
createFontDescriptor(input: FontDescriptorInput): stringCreates the low-level font descriptor consumed by text shaping and rendering.
createMeasuredTextShapeResult(text: string, measured: {
fontAscent?: number;
fontDescent?: number;
height: number;
width: number;
}, measurePrefix: (end: number): number): TextShapeResultConverts complete-run and prefix measurements into neutral caret geometry.
Retained scene nodes, rich-text render registries, and spatial indexing.
Plugin-owned render behavior for one inline text-style concern.
readonly key: stringStable contribution key used for duplicate detection and unregister.
applyRenderState(input: {
readonly context: RenderContext;
readonly style: Readonly<Record<string, unknown>> | undefined;
}): voidApplies renderer state before the text run is painted.
paintRun(input: RichTextRunPaintInput): voidPaints plugin-owned details for an already painted text run.
resolveFont(input: {
readonly font: string;
readonly style: Readonly<Record<string, unknown>> | undefined;
}): stringResolves the font used by shaping and painting for a styled run.
Creates the render-layer bold contribution.
Creates the render-layer font-family contribution.
Creates the render-layer font-size contribution.
Creates the render-layer italic contribution.
Creates the render-layer strikethrough contribution.
Creates the render-layer text-color contribution.
Creates the render-layer underline contribution.
SceneGraph is the root of the retained render tree. A plugin contributes one or more Node values under its
own key. addPluginNode() replaces that plugin's top-level nodes; reconcilePluginNodes() retains nodes with
stable keys and updates only what changed. FrameDirtyTracker records the regions that need repainting.
Use this layer when implementing a renderer or a visual plugin. Content and selection still come from their domain owners; scene nodes hold the geometry and paint behavior for a view.
class SceneGraph<T> extends Node<T>Editor-local scene tree assembled from plugin-owned render nodes.
Each plugin registers its top-level nodes under a stable key. Replacing or reconciling those nodes updates the tree and marks affected regions dirty; the render engine then paints the current tree. Stable node keys allow retained nodes to survive an update when their geometry has not changed.
SceneGraph<T>(container: Container): SceneGraph<T>Creates a scene graph bound to one editor-local DI runtime.
addPluginNode(pluginKeyString: string, node: Node<T> | Node<T>[], options?: { readonly markDirty?: boolean }): voidReplaces all scene nodes owned by one plugin.
pluginKeyStringStable plugin key.
nodeNode or nodes produced by the plugin render method.
clear(context: RenderContext): voidSceneGraph is cleared through strategy-owned dirty regions.
drawHit(context: RenderContext): voidSceneGraph is a root container and is not drawn into the hit layer directly.
drawScene(context: RenderContext): voidSceneGraph is a root container and is not drawn directly.
getPluginNodes(key: string): Node<T>[]Returns the currently attached top-level nodes of one contribution.
markRemovePluginNode(pluginKeyString: string, options?: { readonly markDirty?: boolean }): voidMarks and removes all existing top-level nodes owned by one plugin.
pluginKeyStringStable plugin key.
reconcilePluginNodes(pluginKeyString: string, node: Node<T> | Node<T>[], options?: {
readonly markDirty?: boolean;
readonly replaceRetainedGeometryChanged?: boolean;
readonly replaceRetainedKeys?: ReadonlySet<string>;
readonly retainExisting?: boolean;
readonly updateRetainedGeometry?: boolean;
}): 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.
updateViewportNodes(pluginKey: string, nodes: readonly Node<T>[]): voidUpdates a scrolling viewport, preserving exactly the nodes returned by identity.
static readonly symbol: symbolDI token for resolving the scene graph.
class Node<T> extends EventListener<string>Abstract base class for all nodes in the render tree. Handles geometry, appearance, event management, and hierarchical relationships.
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.
propsPartial properties and position for initialization.
readonly childKeys: string[]Keys of direct child nodes registered via add(), used for recursive cleanup.
depth: numberRender and event ordering depth for Node.
name: stringName of the node, defaults to the class name.
readonly nodeKey: stringStable key used by SceneGraph, DataStorage and spatial indexes.
parentKey: string | nullParent node's stable render key, used for tree relationships.
readonly positionRect: PositionRect<string>Rectangle representing the node's position and size.
properties: Partial<T>Visual and geometric properties of the node.
readonly randomColorKey: templateLiteral | nullUnique random color key used for hit detection.
sticky: booleanWhether this node remains fixed while its scroll container moves.
bottom: T["bottom"] | undefinedThe lower boundary of this node in parent coordinates.
Editor-local configuration for this node's owning scene graph.
fill: stringGets or sets the fill color of the node.
height: numberGets the height of the node.
horizontalAlign: T["horizontalAlign"] | undefinedHorizontal alignment used when positioning this node.
left: T["left"] | undefinedThe left boundary of this node in parent coordinates.
lineDash: number[] | undefinedDash pattern used when stroking this node.
right: T["right"] | undefinedThe right boundary of this node in parent coordinates.
stroke: stringGets or sets the stroke color of the node.
strokeWidth: numberStroke width used when painting this node.
top: T["top"] | undefinedThe upper boundary of this node in parent coordinates.
verticalAlign: T["verticalAlign"] | undefinedVertical alignment used when positioning this node.
width: numberGets the width of the node.
x: numberGets the x-coordinate of the node.
y: numberGets the y-coordinate of the node.
Implements the single-node and multiple-node add overloads.
ReturnsThe current node (for chaining).
childThe child node to add.
addEventListener(type: string, handler: Function): voidAdds an event listener for the specified event type.
typeThe event type to listen for.
handlerThe function to handle the event.
bindRuntime(container: Container): voidBinds this node tree to the editor-local services owned by one SceneGraph.
abstract clear(context: RenderContext): voidClears state owned by Node.
dispose(): voidDisposes this node and all of its descendants recursively. Removes nodes from DataStorage and positionRectStorage, and releases their hit color keys.
draw(sceneContext: RenderContext, hitContext: RenderContext): voidDraws the node in both the scene and hit detection contexts.
sceneContextThe context for scene rendering.
hitContextThe context for hit detection rendering.
abstract drawHit(context: RenderContext): voidAbstract method to draw the node's hit detection representation. Must be implemented by subclasses.
contextThe rendering context.
abstract drawScene(context: RenderContext, clipRegion?: ClipRegion): voidAbstract method to draw the node's scene representation. Must be implemented by subclasses.
contextThe rendering context.
clipRegionOptional clipping region: a PositionRect for axis-aligned rectangular clip,
or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.
getNodeByNodeKey(key: string): Node<T> | nullFinds a node by its stable render-node key.
ReturnsThe node if found, otherwise null.
keyThe stable render node key.
getNodeByRandomColorKey(key: templateLiteral): Node<T> | nullFinds a node by its random color key.
ReturnsThe node if found, otherwise null.
keyThe random color key to search for.
query(range: PositionRect<templateLiteral>): Node<T>[]Queries all nodes within a given rectangular range.
ReturnsAn array of nodes found within the range.
rangeThe rectangle to query.
removeChild(child: Node<T>): voidRemoves a child node from this node and disposes its entire subtree.
removeEventListener(type: string): voidRemoves an event listener for the specified event type.
typeThe event type to remove.
setStickyTree(sticky: boolean, affix?: Pick<NodeProperties, "top" | "left">): thisMarks this node tree as sticky and applies the supplied affix axes to every descendant.
toJSON(): {}Converts the node and its properties to a JSON object. Can be extended to recursively serialize children.
class RenderNode<T> extends Node<T>Abstract class for render nodes. Extend this for nodes that manage rendering.
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.
propsPartial properties and position for initialization.
class BlockManager extends RichTextBlockLayoutProviderMeasures rich-document blocks and produces wrapped rich-text layout lines.
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.
maxWidth: numberMaximum measured unwrapped block width.
add(node: RichDocNode): voidAdds a rich document block and records its measured size.
calculateLayout(width: number): RichTextLine[]Calculates a flattened list of wrapped rich-text lines for all blocks.
calculateLayoutPerParagraph(width: number): RichTextLine[][]Calculates wrapped rich-text lines per paragraph while preserving paragraph mapping.
clear(): voidClears all measured blocks and cached size information.
Creates an unshared measurement workspace for a read-only layout request.
enforceCommandBoundary(isCommandExecuting: (): boolean): voidCloses direct block writes after the owning editor has assembled.
getUnwrappedSize(): {
height: number;
width: number;
}Returns the size of the measured blocks before wrapping.
setBaseFont(font: string): voidSelects the transient base font used for the next layout pass.
static readonly symbol: typeof symbolDI token for resolving the rich-document block manager.
class Container extends EventListener<string>Scene node that owns, queries, and serializes an ordered child collection.
readonly randomColorKey: templateLiteral | nullUnique random color key for hit detection.
children: templateLiteral[]The direct scene children in paint order.
Adds the value.
descendants(): never[]Iterates every descendant in scene order.
query(): voidReturns descendants whose boundaries intersect the supplied rectangle.
remove(): voidRemoves the value.
toJSON(): {}Serializes this scene structure into diagnostic JSON.
updateBoundary(): voidUpdates the indexed boundary after geometry changes.
DI token placeholder for the dirty-region spatial index.
static readonly symbol: symbolDI token used to resolve the dirty tree implementation.
Frame-scoped dirty-region tracker.
A scene mutation may replace several view extensions before the render pass starts. Every affected region must therefore remain recorded until DirtyRenderStrategy has consumed the frame. In particular, node replacement must never clear regions recorded by an earlier replacement in that frame.
FrameDirtyTracker(tree: Tree<PositionRect<templateLiteral>>): FrameDirtyTrackerhasDamage: booleanPending body damage must be consumed before reusing cached body pixels.
clear(): voidFrame-end full cleanup (called by DirtyRenderStrategy.render()). All items are removed regardless of generation.
getBoundary(): PositionRect<templateLiteral>Returns the boundary.
mark(rect: PositionRect<templateLiteral>): voidRecords a region until the current dirty render pass finishes.
query(range: PositionRect<templateLiteral>): PositionRect<templateLiteral>[]Returns dirty regions intersecting the supplied frame bounds.
static readonly symbol: symbolDI token for resolving FrameDirtyTracker.
class LayoutNode<T> extends Node<T>Abstract class for layout nodes. Extend this for nodes that manage layout.
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.
propsPartial properties and position for initialization.
class Tree<T>Shared spatial-index contract. The item shape is owned by each index.
Tree<T>(boundary: PositionRect<templateLiteral>, capacity: number): Tree<T>abstract clear(): voidClears state owned by Tree.
abstract getBoundary(): PositionRect<templateLiteral>Returns the boundary.
abstract insert(item: T): booleanInserts a bounded entry into the spatial index.
abstract query(range: PositionRect<templateLiteral>): T[]Returns indexed entries whose boundaries intersect the supplied rectangle.
abstract remove(item: T, predicate?: (rect: PositionRect<templateLiteral>): boolean): booleanRemoves the value.
abstract toJSON(): objectSerializes this scene structure into diagnostic JSON.
abstract updateBoundary(boundary: PositionRect<templateLiteral>): voidUpdates the indexed boundary after geometry changes.
static readonly symbol: symbolDI token for resolving Tree.
type NodeProperties = unknownbottom?: numbercontentInsetEnd?: numberSpace reserved after projected text for a cell visual.
contentInsetStart?: numberSpace reserved before projected text for a cell visual.
cornerRadius?: [number, number, number, number]depth?: numberfill?: stringfitNumberValue?: numberRaw General-format number fitted against the actual render width.
hideText?: booleanSuppresses projected text while preserving its underlying value.
isEdit?: booleanleft?: numberlineDash?: number[]Stable render-node key.
When omitted, Node falls back to its generated hit color key for backwards compatibility. Semantic render nodes should provide stable ids such as block ids here instead of using hit colors as identity.
Optional world-coordinate clip applied by OverlayRenderStrategy. Overlay nodes normally render above sticky UI; this lets a visual stay within a host-defined content region instead (for example, a sheet selection must not draw over row/column headers).
right?: numbersemanticOwner?: stringStable semantic ownership exposed by retained render targets.
semanticRole?: stringStable semantic role exposed by retained render targets.
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.
skipHit?: booleanVisual-only nodes do not participate in hit canvas.
Background: FixBoxNode.drawHit fills the entire rect with random color for Hit Canvas lookup.
But once visual-only nodes (such as selection strokes and header highlight backgrounds)
enter the Hit Canvas,
they can cover underlying cell hit colors and block click-through.
Setting skipHit: true in properties makes drawHit skip directly.
stroke?: stringstrokeWidth?: numbertextColor?: stringtextFillCharacter?: stringCharacter repeated to fill the remaining inline width of formatted text.
textOverflowWidth?: numberMaximum width available to single-line text across adjacent empty cells.
Foreground color used by text-rendering nodes.
top?: numbertype RenderNodeKey = stringStable key used by SceneGraph, Tree and DataStorage to identify render nodes.
class AffixNode<T> extends FixBoxNode<T>Sticky box node used for row/column headers and other affixed sheet regions.
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.
propsPartial properties and position for initialization.
sticky: booleanAffix nodes render in the sticky strategy instead of the scrolled content layer.
class AffixTextNode<T> extends TextNode<T>Sticky text node used inside affixed header cells.
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.
valueText or rich-text value to render.
positionRectInitial node bounds.
propertiesRender properties inherited from the parent cell.
sticky: booleanAffix text renders in the sticky strategy together with its parent.
class BoxNode<T> extends LayoutNode<T>The BoxNode class represents a block-level node in a scene graph.
It behaves similarly to an HTML element with position: relative,
where its position is determined relative to its parent or siblings.
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.
propsPartial properties and position for initialization.
clear(context: RenderContext): voidClears state owned by BoxNode.
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).
contextThe rendering context used to draw the hit area.
drawScene(context: RenderContext): voidDraws the scene for this node and all its descendants.
This method recursively calls drawScene on all child nodes.
contextThe rendering context used to draw the scene.
class DashedLineNode<T> extends RenderNode<T>Scene node that renders one dashed line segment.
DashedLineNode<T>(positionRect: PositionRectProps, props: Partial<T>, line: {
x1: number;
x2: number;
y1: number;
y2: number;
}): DashedLineNode<T>Constructs a dashed line node.
positionRectDirty/hit bounds covering the line.
propsRender properties including stroke and dash pattern.
lineExact line segment coordinates.
clear(context: RenderContext): voidClears the line bounds with stroke padding.
contextRender context to clear.
drawHit(): voidDashed lines are visual-only and do not participate in hit testing.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the dashed line into the render context.
contextRender context receiving draw commands.
class FixBoxNode<T> extends RenderNode<T>Scene node that renders a rectangular box with optional fill, stroke, and clipping.
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.
propsPartial properties and position for initialization.
clear(context: RenderContext): voidClears this node's bounds from a raster context using stroke padding.
contextRender context to clear.
drawHit(context: RenderContext): voidDraws the node into the hit-test context unless the node is visual-only.
contextHit render context.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the box into the visible render context.
contextRender context receiving draw commands.
clipRegionOptional rectangle or polygon clipping region.
class SheetCornerNode<T> extends AffixNode<T>Paints the sheet's select-all marker inside the corner's rectangular hit area.
SheetCornerNode<T>(positionRect?: PositionRectProps, props?: Partial<T>, runtime?: Container): SheetCornerNode<T>Constructs a new Node<T> instance with specified properties and position. Updates the boundary in the positionRectStorage if necessary.
propsPartial properties and position for initialization.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the box into the visible render context.
contextRender context receiving draw commands.
clipRegionOptional rectangle or polygon clipping region.
class StickyNode<T> extends BoxNode<T>Box node specialization reserved for sticky-layer rendering.
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.
propsPartial properties and position for initialization.
class TextNode<T> extends RenderNode<T>Scene node that renders plain text derived from string or rich-text content.
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.
valueText or rich-text value to render.
positionRectInitial node bounds.
propertiesRender properties inherited from the parent cell.
depth: numberText draws above the box background by default.
readonly value: string | RichDocNodeText value rendered by this node.
width: numberReturns measured text width once attached, otherwise the declared width.
clear(context: RenderContext): voidText nodes are cleared through their parent box dirty region.
drawHit(context: RenderContext): voidText nodes do not draw separate hit regions; the parent box owns hit testing.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws text inside the parent node using the parent's alignment and padding.
contextRender context receiving text commands.
clipRegionOptional clipping region inherited from render strategies.
class ViewportOverlayNode extends RichTextVisualNodeViewport overlay node that draws transient UI under an identity transform.
ViewportOverlayNode(input: {
readonly depth?: number;
readonly drawOverlay: (context: RenderContext): void;
readonly nodeKey: string;
readonly rect: PositionRectProps;
readonly role?: "selection" | "caret";
}): ViewportOverlayNodeCreates a viewport overlay render node.
drawScene(context: RenderContext): voidDraws overlay content; the node owns transform isolation for viewport-space plugins.
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.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.
class CellVisualLayerNode<T> extends RenderNode<T>Draws a feature-contributed visual between a cell background and its content.
CellVisualLayerNode<T>(rect: PositionRectProps, properties: Partial<T>, layer: CellVisualLayer): CellVisualLayerNode<T>clear(context: RenderContext): voidClears state owned by Node.
drawHit(): voidAbstract method to draw the node's hit detection representation. Must be implemented by subclasses.
drawScene(context: RenderContext): voidAbstract method to draw the node's scene representation. Must be implemented by subclasses.
contextThe rendering context.
One text label drawn within a feature-contributed visual layer.
A visual rectangle, icon or sequence of labels within its cell bounds.
readonly fill?: string | {
readonly end: string;
readonly start: string;
}readonly height: numberreadonly icon?: {
readonly color: string;
readonly level?: number;
readonly shape: CellVisualIconShape;
readonly totalLevels?: number;
}readonly labels?: readonly CellVisualLabel[]Ordered labels, clipped to the layer bounds without changing the cell value.
readonly shape?: CellVisualLayerShapereadonly slot: stringreadonly width: numberreadonly x: numberreadonly y: numberreadonly zIndex?: numberPaint order among visual layers; use values from 0 to 1, with higher values drawn later.
Primitive shapes available to feature-contributed cell layers.
| Member | Value |
|---|---|
Rectangle |
"rectangle" |
TopLeftTriangle |
"topLeftTriangle" |
Rich text uses block, line, run, caret, and selection nodes. RichTextRunRenderRegistry lets a feature provide
paint behavior for a run without changing the shared tree. HitColorRegistry and the spatial indexes support
finding nodes from pointer coordinates. Start with SceneGraph for ownership, then choose the node type that
represents the visual element you need to paint or hit test.
class RichTextCaretNode extends RichTextVisualNodeScene node that draws a rich-text caret.
RichTextCaretNode(input: {
readonly caret: {
readonly height: number;
readonly pixelOffset?: number;
readonly visible: boolean;
readonly x: number;
readonly y: number;
};
readonly depth?: number;
readonly nodeKey: string;
readonly rect: PositionRectProps;
readonly scroll?: {
readonly x: number;
readonly y: number;
};
readonly viewportOverlay?: boolean;
}): RichTextCaretNodeCreates a caret overlay node.
drawScene(context: RenderContext): voidDraws the caret when the blink state says it is visible.
class RichTextCompositionNode extends RichTextVisualNodeScene node that draws active IME composing text and underline.
RichTextCompositionNode(input: {
readonly anchor: {
readonly height: number;
readonly x: number;
readonly y: number;
};
readonly depth?: number;
readonly font: string;
readonly nodeKey: string;
readonly rect: PositionRectProps;
readonly scroll?: {
readonly x: number;
readonly y: number;
};
readonly text: string;
readonly viewportOverlay?: boolean;
}): RichTextCompositionNodeCreates an IME composition overlay node.
drawScene(context: RenderContext): voidDraws composing text in world or viewport coordinates.
class RichTextContentNode extends RichTextVisualNodeScene node that draws laid-out rich-text lines in world coordinates.
RichTextContentNode(input: {
readonly blockIndexes?: readonly number[];
readonly depth?: number;
readonly font?: string;
readonly lineRenderer: RichTextLineRenderer;
readonly lines: readonly RichTextRenderLine[];
readonly nodeKey: string;
readonly origin: Pick<PositionRectProps, "x" | "y">;
readonly rect: PositionRectProps;
}): RichTextContentNodeCreates a rich-text content node from pre-computed layout lines.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws every included layout line inside this node's clip.
Paints laid-out rich-text lines by grouping adjacent characters into runs.
RichTextLineRenderer(inlineStyles: RichTextInlineStyleRegistry, runRenderer: RichTextRunRenderer): RichTextLineRendererCreates a line renderer with domain style comparison and run rendering.
paint(context: RenderContext, input: {
readonly font?: string;
readonly line: RichTextRenderLine;
readonly origin: Pick<PositionRectProps, "x" | "y">;
}): voidPaints one laid-out line at the supplied world-space origin.
static readonly symbol: typeof symbolDI token for resolving the line renderer.
Paints one contiguous rich-text run using the registered render contributions.
Creates a run renderer backed by the render contribution registry.
paint(context: RenderContext, input: {
readonly baselineY: number;
readonly font: string;
readonly fontAscent: number;
readonly fontDescent: number;
readonly height: number;
readonly style: Readonly<Record<string, unknown>> | undefined;
readonly text: string;
readonly width: number;
readonly x: number;
}): voidPaints one run and restores all renderer state changed by its style plugins.
static readonly symbol: typeof symbolDI token for resolving the run renderer.
Render-layer registry for plugin-owned rich-text run behavior.
applyRenderState(context: RenderContext, style: Readonly<Record<string, unknown>> | undefined): voidApplies all registered render-state contributions before text painting.
enforceWriteBoundary(assertWrite: (): void): voidpaintRun(input: RichTextRunPaintInput): voidPaints all registered plugin-owned run details.
register(contribution: RichTextRunRenderContribution): (): voidRegisters one render contribution.
resolveFont(font: string, style: Readonly<Record<string, unknown>> | undefined): stringResolves the final font descriptor after all registered contributions run.
static readonly symbol: typeof symbolDI token for resolving the rich-text run render registry.
class RichTextSelectionNode extends RichTextVisualNodeScene node that draws rich-text selection rectangles.
RichTextSelectionNode(input: {
readonly depth?: number;
readonly nodeKey: string;
readonly offset?: {
readonly x: number;
readonly y: number;
};
readonly rect: PositionRectProps;
readonly rects: readonly RichTextSelectionRect[];
readonly viewportOverlay?: boolean;
}): RichTextSelectionNodeCreates a selection overlay node.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws selection rectangles in world or viewport coordinates.
getSelectionRects(): readonly RichTextSelectionRect[]World-space regions where text should be painted above the highlight.
class RichTextVisualNode extends Node<RichTextRenderNodeProperties>Base class for rich-text nodes that only draw pixels and do not own hit state.
clear(_context: RenderContext): voidRich-text visual node pixels are cleared by strategy-owned dirty rectangles.
drawHit(_context: RenderContext): voidRich-text visual nodes are ignored by hit testing unless a subclass opts in.
class RichTextBlockNode extends RichTextVisualNodeScene node that indexes and draws one top-level rich-text block.
RichTextBlockNode(input: {
readonly block: {
readonly id: string;
readonly index: number;
};
readonly font: string;
readonly lineRenderer: RichTextLineRenderer;
readonly lines: readonly RichTextRenderLine[];
readonly origin?: Pick<PositionRectProps, "x" | "y">;
readonly rect: PositionRectProps;
}): RichTextBlockNodeCreates a block-level rich-text scene node.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws all visible text runs inside this block.
class RichTextRunNode extends RichTextVisualNodeScene node that draws one contiguous styled rich-text run in world coordinates.
RichTextRunNode(input: {
readonly baselineY: number;
readonly font: string;
readonly fontAscent: number;
readonly fontDescent: number;
readonly properties: Partial<RichTextRenderNodeProperties>;
readonly rect: PositionRectProps;
readonly runRenderer: RichTextRunRenderer;
readonly style?: Readonly<Record<string, unknown>>;
readonly text: string;
}): RichTextRunNodeCreates a text-run scene node.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidDraws the text run into the active world-space transform.
Minimal rich-text character shape consumed by render nodes.
Geometry and render state for one contiguous rich-text run.
readonly baselineY: numberreadonly context: RenderContextreadonly fontAscent: numberreadonly fontDescent: numberreadonly height: numberreadonly style: Readonly<Record<string, unknown>> | undefinedreadonly text: stringreadonly width: numberreadonly x: numberRectangle highlighted as part of a rich-text selection.
Shared construction options for visual-only rich-text render nodes.
readonly blockId?: stringreadonly blockIndex?: numberreadonly depth: numberreadonly isEdit?: booleanreadonly nodeKey: stringreadonly rect: PositionRectPropsreadonly renderRole: NonNullable<"selection" | "block" | "page" | "line" | "text-run" | "caret" | "composition" | undefined>readonly semanticRole: stringMinimal layout-line shape consumed by rich-text render nodes.
readonly chars: readonly RichTextRenderChar[]readonly charStartOffset: numberreadonly cursorXOffsets?: readonly number[]readonly fontAscent: numberreadonly height: numberreadonly textNodePath: readonly number[]readonly x: numberreadonly y: numberinterface RichTextRenderNodeProperties extends NodePropertiesRender-node properties used by rich-text scene graphs.
readonly blockId?: stringStable top-level rich-text block id.
readonly blockIndex?: numberTop-level rich-text block index.
readonly lineIndex?: numberLayout line index inside the full rich-text snapshot.
readonly renderRole?: "selection" | "block" | "page" | "line" | "text-run" | "caret" | "composition"Semantic role for rich-text render nodes.
Inherited from NodeProperties.
type RichTextBlockId = stringStable rich-text block identifier.
type RichTextInlineStyle = Readonly<Record<string, unknown>>Domain-neutral inline style bag carried by measured rich-text chars.
resolveRichTextInsertionFont(input: {
readonly document: readonly RichDocNode[];
readonly font: string;
readonly inlineStyles: RichTextInlineStyleRegistry;
readonly position: DocCursorPos;
readonly runRenderers: RichTextRunRenderRegistry;
readonly typingStyle?: Readonly<Record<string, unknown>>;
}): stringResolves insertion typography through the same style contributions as document runs.
createRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>Creates a world-space rectangle for one rich-text line/run.
Spatial indexes narrow the nodes considered for hit testing; hit colors connect painted regions back to nodes.
Simple bounding-volume hierarchy spatial index implementation.
clear(): voidRemoves all indexed items.
getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
insert(data: T): booleanInserts one item into the root child list.
query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
remove(data: T): booleanRemoves one item by object identity.
toJSON(): objectSerializes debug data for this spatial index.
updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the tree boundary and clears indexed items.
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.
emit(eventString: CustomEventTypes, ...args: unknown[]): booleanTriggers an event, calling all associated handlers in registration order.
Propagation control:
If any handler synchronously returns false, dispatch to subsequent handlers stops.
Returning true / undefined / void means dispatch continues.
This enables ordered plugin suppression for the same event (for example, a cell
editor can block a selection plugin on dblClick) without direct plugin-to-plugin
state mutation.
Returnsfalse if a handler actively stopped propagation; otherwise true.
eventStringThe name of the event to trigger.
argsArguments to pass to the event handlers.
enforceWriteBoundary(assertWrite: (): void, teardownToken: object): voidCloses registration changes after an owning runtime has assembled.
off(eventString?: CustomEventTypes, handler?: Function): voidRemoves event handlers for a specific event or all events.
eventStringThe name of the event to remove handlers for. If not provided, all event handlers are removed.
on(eventString: CustomEventTypes, handler: Function): EventListener<CustomEventTypes>Registers an event handler for a specific event.
ReturnsThe current instance to allow method chaining.
eventStringThe name of the event to listen for.
handlerThe function to be called when the event is triggered.
class HilbertRTree<T> extends Tree<T>Hilbert-sorted R-tree style spatial index for rectangular data.
HilbertRTree<T>(boundary: PositionRect<templateLiteral>, maxChildren?: number): HilbertRTree<T>Constructs a Hilbert R-tree.
boundaryRoot spatial boundary.
maxChildrenMaximum children retained by the shared tree contract.
clear(): voidRemoves all indexed items.
getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
insert(data: T): booleanInserts one item and maintains Hilbert ordering.
query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
remove(data: T): booleanRemoves an item by matching rectangle bounds.
toJSON(): objectSerializes debug data for this spatial index.
updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
Maps hit-canvas color keys back to render nodes.
static readonly symbol: symbolDI token for resolving the hit-color registry.
KD-tree spatial index for rectangular scene data.
KDTree<T>(boundary?: PositionRect<templateLiteral>, capacity?: number): KDTree<T>Constructs a KD-tree.
boundaryRoot spatial boundary.
capacityRetained for the shared Tree contract.
clear(): voidRemoves all indexed items.
getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
insert(data: T): booleanInserts an item by alternating x/y split axes.
query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
remove(data: T): booleanRemoves one item by object identity and rebuilds the experimental tree.
toJSON(): objectSerializes debug data for this spatial index.
updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
Simple Octree-shaped spatial index for rectangular scene data.
clear(): voidRemoves all indexed items.
getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
insert(data: T): booleanInserts one item into the root child list.
query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
remove(data: T): booleanRemoves one item by object identity.
toJSON(): objectSerializes debug data for this spatial index.
updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
class QuadTree extends Tree<PositionRect<HexColor>>QuadTree spatial index used by scene and dirty-region lookups.
QuadTree(boundary: PositionRect<templateLiteral>, capacity: number): QuadTreeConstructs a QuadTree node.
boundaryNode boundary.
capacityMaximum items before subdivision.
bottomleft: QuadTree | nullBottom-left child node.
bottomright: QuadTree | nullBottom-right child node.
divided: booleanWhether this node has been subdivided into children.
rects: PositionRect<templateLiteral>[]Rectangles stored directly in this node.
Top-left child node.
Top-right child node.
clear(): voidClears all indexed rectangles and child quadrants.
contains(boundary: PositionRect<templateLiteral>, rect: PositionRect<templateLiteral>): booleanReturns whether boundary fully contains rect.
getBoundary(): PositionRect<templateLiteral>Returns the root boundary for this tree node.
insert(data: PositionRect<templateLiteral>): booleanInserts a rectangle into the tree.
ReturnsTrue when data intersects this tree boundary.
dataRectangle to index.
intersects(a: PositionRect<templateLiteral>, b: PositionRect<templateLiteral>): booleanReturns whether two rectangles overlap.
query(range: PositionRect<templateLiteral>, found?: PositionRect<templateLiteral>[]): PositionRect<templateLiteral>[]Queries rectangles intersecting a range.
ReturnsMatching rectangles.
rangeSearch rectangle.
foundAccumulator used during recursion.
remove(data: PositionRect<templateLiteral>, predicate?: (rect: PositionRect<templateLiteral>): boolean): booleanRemoves matching rectangle entries.
ReturnsTrue when an entry was removed.
dataRectangle coordinates to remove.
predicateOptional predicate for entries with matching bounds.
subdivide(): voidSplits this node into four child quadrants and redistributes contained items.
toJSON(): objectSerializes debug data for this tree.
updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and reinserts existing rectangles.
boundaryNew root boundary.
class QuadTreeFactory<T> extends TreeFactory<PositionRect<HexColor>>Factory that creates QuadTree spatial indexes for rectangular scene data.
create(boundary: PositionRect<templateLiteral>, capacity: number): QuadTreeCreates a QuadTree.
boundaryRoot spatial boundary.
capacityMaximum items in a leaf before subdivision.
Simple R-tree spatial index for rectangular scene data.
clear(): voidRemoves all indexed items.
getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
insert(data: T): booleanInserts one item into the root child list.
query(range: PositionRect<templateLiteral>): T[]Returns items whose rectangles intersect the query range.
remove(data: T): booleanRemoves one item by object identity.
toJSON(): objectSerializes debug data for this spatial index.
updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
class SpatialHash<T> extends Tree<T>Spatial hash index that buckets rectangular items by their top-left cell.
SpatialHash<T>(cellSize?: number, boundary?: PositionRect<templateLiteral>, capacity?: number): SpatialHash<T>Constructs a spatial hash index.
cellSizeLogical size of one hash bucket.
boundaryRoot spatial boundary.
capacityRetained for the shared Tree contract.
clear(): voidRemoves all indexed items.
getBoundary(): PositionRect<templateLiteral>Returns the current tree boundary.
insert(data: T): booleanInserts an item into the bucket containing its top-left corner.
query(range: PositionRect<templateLiteral>): T[]Returns items in intersecting buckets whose rectangles overlap the query range.
remove(data: T): booleanRemoves one item from its hashed bucket.
toJSON(): objectSerializes debug data for this spatial index.
updateBoundary(boundary: PositionRect<templateLiteral>): voidReplaces the boundary and clears indexed items.
type HitColorKey = HexColorColor key used only by hit-canvas rendering and pixel-to-node lookup.
Editor-local registries that connect cell types and Sheet state to renderers.
Render contribution belonging to one spreadsheet cell definition.
readonly cellType: string | symbolregister(renderCoordinator: SheetRenderCoordinatorManager): (): voiddefineCellRenderer<DataType, Properties>(cellType: string | symbol, cell: (data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<DataType>): CellRendererDefinitionCreates the standard renderer definition for a Cell subclass.
class AffixCell extends Cell<CellProperties<string | number | null | SheetDocumentNode>>Rendering-only cell used for fixed row/column header affixes.
AffixCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): AffixCellgetDisplayText(): stringReturns plain display text for numeric/string labels and rich header content.
render(): Node<CellProperties<string | number | Schema | null>> | Node<CellProperties<string | number | Schema | null>>[]Renders the affix background and optional text content.
static readonly symbol: symbolBuilt-in affix cell type symbol.
class BooleanCell extends Cell<CellProperties<boolean>>Draws a persisted logical cell using spreadsheet TRUE/FALSE labels.
BooleanCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): BooleanCellgetDisplayText(): stringReturns this cell's plain-text representation for:
Each subclass implements its own semantics, so callers do not need type switches.
render(): Node<CellProperties<boolean>> | Node<CellProperties<boolean>>[]Renders Cell scene output.
static readonly symbol: typeof symbolclass Cell<T>Base render node for a projected Sheet cell.
Cell<T>(data: T, positionRect: PositionRectProps, properties: T, context?: CellContext): Cell<T>readonly context: CellContextreadonly data: Treadonly positionRect: PositionRectPropsreadonly properties: Tabstract getDisplayText(): stringReturns this cell's plain-text representation for:
Each subclass implements its own semantics, so callers do not need type switches.
Renders Cell scene output.
class EditorCell extends Cell<CellProperties<SheetDocumentNode[]>>Rendering-only cell used by the inline rich-text editor overlay.
EditorCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EditorCellgetDisplayText(): stringExtracts plain text from the editor document.
render(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]Renders editor content, marking edit-mode nodes as overlay content when needed.
static readonly symbol: symbolBuilt-in editor cell type symbol.
class EmptyCell extends Cell<CellProperties<null>>Renderer for empty persisted cells and active empty editor cells.
EmptyCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): EmptyCellgetDisplayText(): stringReturns the formatted projection when a formula spills into this cell.
render(): Node<CellProperties<null>> | Node<CellProperties<null>>[]Renders an empty box or editable rich-text placeholder.
static readonly symbol: symbolBuilt-in empty cell type symbol.
class FormulaCell extends Cell<CellProperties<string>>Renders the calculated projection of a formula cell.
FormulaCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): FormulaCellgetDisplayText(): stringReturns the display text.
render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]Renders FormulaCell scene output.
static readonly symbol: symbolDI token for resolving FormulaCell.
class NumberCell extends Cell<CellProperties<number>>Renders a persisted numeric value without converting its storage type to text.
NumberCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): NumberCellgetDisplayText(): stringReturns the display text.
render(): Node<CellProperties<number>> | Node<CellProperties<number>>[]Renders NumberCell scene output.
static readonly symbol: symbolDI token for resolving NumberCell.
class RichTextCell extends Cell<CellProperties<SheetDocumentNode[]>>Renderer for persisted rich-text cell values.
RichTextCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): RichTextCellgetDisplayText(): stringExtracts plain text from the rich-text document.
render(): Node<CellProperties<Schema[]>> | Node<CellProperties<Schema[]>>[]Renders a rich-text document inside the cell bounds.
static readonly symbol: symbolBuilt-in rich-text cell type symbol.
class StringCell extends Cell<CellProperties<string>>Renderer for persisted plain-string cell values.
StringCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): StringCellgetDisplayText(): stringReturns the stored string value for measurement and formula display.
render(): Node<CellProperties<string>> | Node<CellProperties<string>>[]Renders text content inside a standard cell box.
static readonly symbol: symbolBuilt-in string cell type symbol.
Cell construction context injected by callers such as SheetGridRender and SheetResizePlugin. It lets Cell subclasses access external services on demand and avoids caller-side type switches.
Design principle: adding a cell type or external service should not require callers to add if/else branches. Callers add the service to CellContext, and the corresponding Cell subclass reads it.
The current capabilities are explicit read-only rendering dependencies. Do not pass a DI container or generic service locator into Cell; that would make Cell implicitly depend on the entire application service graph.
Sheet-local defaults for formatting numbers and date/time serials.
col?: numberCurrent cell column index (0-based); optional for non-grid cells.
Read-only access to derived formula results; optional when formulas are disabled.
Read-only metadata for host-rendered formula links and images.
row?: numberCurrent cell row index (0-based); optional for non-grid cells.
Read-only provider for calculated formula results.
Rendering and other consumers use this interface to read per-client derived formula values without depending on a concrete formula plugin implementation.
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.
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.
rowRow index (0-based).
colColumn index (0-based).
getFormulaResultFormat(row: number, col: number): CellFormat | undefinedDerived format for a numeric formula result; explicit cell formatting takes precedence.
| Member | Value |
|---|---|
Grid |
"grid" |
RowHeader |
"row-header" |
ColumnHeader |
"column-header" |
Corner |
"corner" |
| Member | Value |
|---|---|
Affix |
"affix" |
Editor |
"rich_text" |
type CellProperties = NodeProperties & {
endColIndex?: number;
endRowIndex?: number;
format?: unknown;
isEdit?: boolean;
region?: CellRegion;
startColIndex?: number;
startRowIndex?: number;
type: string | symbol;
value?: T;
}Registries connect cell behavior and visual readers to a Sheet renderer. The coordinator manages those registrations for an editor.
class NodeFactory<NodeType>Factory contract for creating renderable cell/node instances by data type.
abstract create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): NodeTypeCreates a node instance for typed data.
ReturnsCreated node instance.
dataPersisted or rendering-only cell data.
positionRectNode bounds.
propertiesRender properties passed to the node.
contextOptional cell rendering context.
abstract 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.
typeType identifier used by incoming data.
ctorConstructor used to create the node.
static readonly symbol: symbolDI token for resolving the active node factory.
Coordinates cell creation and rendering for a concrete renderer registry.
abstract create<T>(): TCreates a cell instance from registered type metadata.
abstract registerRenderer(): voidRegisters renderer functions supported by the coordinator.
abstract registerType(): voidRegisters cell/node types supported by the coordinator.
Renders an already-created cell or node.
abstract renderCell<T>(): Node<T> | Node<T>[]Creates and renders a cell from type and render properties.
static readonly symbol: symbolDI token for resolving the active render coordinator manager.
class RendererRegistry<RegistryProperties>Registry contract for mapping typed render inputs to scene nodes.
abstract 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.
typeType identifier owned by the cell or feature domain.
rendererFnFunction that converts input into scene nodes.
Renders a registered input.
ReturnsScene node or nodes produced by the registered renderer.
inputInput accepted by the concrete registry implementation.
static readonly symbol: symbolDI token for resolving the active renderer registry.
Composes editor-local, plugin-owned visual properties for Sheet cells.
destroy(): voidRemoves all editor-local reader registrations.
nextConditionalPriority(): numberAllocates an order after every registered conditional rule owner.
read(position: SheetCellVisualReadPosition): Partial<CellProperties>Reads and combines every registered visual contribution for one cell.
readVisual(position: SheetCellVisualReadPosition): {
layers: readonly CellVisualLayer[];
properties: Partial<CellProperties>;
}Composes base properties, matched rules and visual layers in one pass.
register(reader: SheetCellVisualReader): (): voidRegisters one reader and rejects duplicate ids or property ownership.
registerConditional(reader: SheetCellConditionalVisualReader): (): voidRegisters a rule source whose matches are composed across feature plugins.
registerOverride(reader: SheetCellVisualOverride): (): voidRegisters explicit-priority overrides without acquiring base property ownership.
static readonly symbol: typeof symbolDI token for the editor-local registry.
class SheetNodeFactory extends NodeFactory<Cell<CellProperties<unknown>>>Default NodeFactory implementation for sheet cells.
create<DataType, Properties>(data: DataType, positionRect: PositionRectProps, properties: Properties, context?: CellContext): Cell<CellProperties<unknown>>ReturnsCreated Cell instance.
dataCell data carrying a type identifier.
positionRectCell bounds.
propertiesRender properties.
contextOptional cell rendering context.
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.
typeCell type identifier.
ctorCell constructor used to create render cells.
Coordinates cell projection and rendering for a Sheet frame.
SheetRenderCoordinatorManager(nodeFactory: SheetNodeFactory, rendererRegistry: SheetRendererRegistry<CellProperties>, formulaResultProvider: IFormulaResultProvider, platform?: Platform | undefined, cellFormatLocaleProvider?: ICellFormatLocaleProvider, formulaRichResultProvider?: IFormulaRichResultProvider): SheetRenderCoordinatorManagerreadonly nodeFactory: SheetNodeFactoryreadonly rendererRegistry: SheetRendererRegistry<CellProperties>create<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Cell<T> | undefinedCreates the value.
createCellContext(row?: number, col?: number): CellContextBuilds the explicit, read-only context shared by render and measurement paths.
registerCell<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): voidRegisters a cell constructor and its default Cell.render() adapter together.
registerRenderer<T>(type: T["type"], renderer: <U>(cell: Cell<U>): Node<CellProperties> | Node<CellProperties>[]): (): voidRegisters the renderer.
registerStoredValueValidator(type: string | symbol, validator: (cell: CellProperties): boolean): (): voidRegisters the stored value validator.
registerType<DataType, U>(type: string | symbol, ctor: (data: DataType, positionRect: PositionRectProps, properties: U, context?: CellContext): Cell<DataType>): (): voidRegisters the type.
render<T>(cell: Cell<T>): Node<CellProperties> | Node<CellProperties>[]Renders SheetRenderCoordinatorManager scene output.
renderCell<T>(data: T, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): Node<CellProperties> | Node<CellProperties>[]Projects and renders one visible Sheet cell.
static readonly symbol: symbolDI token for resolving SheetRenderCoordinatorManager.
class SheetRendererRegistry<RegistryProperties> extends RendererRegistry<RegistryProperties>Renderer registry for sheet cell instances.
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.
typeCell type identifier.
rendererFnFunction that renders matching cell instances.
Renders a cell through its registered renderer.
ReturnsScene node or nodes produced by the renderer.
inputCell instance to render.
Visual readers supply feature-owned details such as labels or conditional appearance without changing stored cell data.
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.
EmbeddedEditorRenderNode<T>(document: readonly Schema[], positionRect: {
height: number;
width: number;
x: number;
y: number;
}, properties: T, editSession?: SheetEditSession, editRenderOptions?: SheetEditRenderOptions): EmbeddedEditorRenderNode<T>clear(context: RenderContext): voidClears state owned by Node.
drawHit(_context: RenderContext): voidRich-text content is visual-only; the cell box owns hit detection.
drawScene(context: RenderContext, clipRegion?: ClipRegion): voidAbstract method to draw the node's scene representation. Must be implemented by subclasses.
contextThe rendering context.
clipRegionOptional clipping region: a PositionRect for axis-aligned rectangular clip,
or a Point[] polygon (array of [x, y] vertices) for arbitrary shape clip.
class SheetCellVisualReaderError extends SearErrorPublic error raised for invalid Sheet cell visual-reader contributions.
SheetCellVisualReaderError(code: SheetCellVisualReaderErrorCode, message: string, details?: SearErrorDetails): SheetCellVisualReaderErrorreadonly code: SheetCellVisualReaderErrorCodeStable machine-readable identifier for this error category.
One matched conditional rule; higher priority wins for overlapping properties and layer slots.
readonly id: stringreadonly layers?: readonly CellVisualLayer[]readonly priority: numberreadonly properties?: Readonly<Partial<CellProperties>>readonly id: stringreadonly properties: readonly "value" | "type" | "format" | unknown | "region" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]read(position: SheetCellVisualReadPosition): readonly SheetCellConditionalVisual[]readHighestPriority(): numberReads the owner's current rule order after staged transactions commit.
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.
readonly priority: numberPlugin-owned reader declaring exclusive ownership of base visual properties.
readonly id: stringreadonly properties: readonly "value" | "type" | "format" | unknown | "region" | "startRowIndex" | "startColIndex" | "endRowIndex" | "endColIndex"[]read(position: SheetCellVisualReadPosition): Readonly<Partial<CellProperties>>Minimal configuration access available while plugins register visual readers.
readDefaultConfig(): Readonly<Record<string, unknown>>Coordinates supplied to one visual reader for a rendered Sheet cell.
readonly columnIndex: numberreadonly rowIndex: numberStable failure codes exposed by SheetCellVisualReaderRegistry.
| Member | Value |
|---|---|
DuplicateReader |
"SHEET_CELL_VISUAL_READER_DUPLICATE_READER" |
PropertyConflict |
"SHEET_CELL_VISUAL_READER_PROPERTY_CONFLICT" |
UndeclaredProperty |
"SHEET_CELL_VISUAL_READER_UNDECLARED_PROPERTY" |
InvalidPriority |
"SHEET_CELL_VISUAL_READER_INVALID_PRIORITY" |
OverrideConflict |
"SHEET_CELL_VISUAL_READER_OVERRIDE_CONFLICT" |
A rectangle positioned within a cell using fractions of its width and height.
Logical scrolling, axis locking, boundary feedback, and host scroller adapters.
class HeadlessScroller extends ScrollerScroller adapter for hosts that have no native scroll surface.
Constructs a scroller adapter.
Returns the publisher.
static readonly symbol: symbolDI token for resolving HeadlessScroller.
Locks a continuous input gesture to its first dominant axis.
configure(config: Partial<ScrollAxisLockConfig>): voidApplies validated host overrides and resets an in-progress gesture.
consume(x: number, y: number): {
x: number;
y: number;
}Filters one two-dimensional input sample through the active direction lock.
getAxis(): ScrollAxis | nullReturns the currently selected axis, or null before activation.
getWheelEndDelay(): numberReturns the configured wheel gesture-end delay.
reset(): voidEnds the current gesture and clears uncommitted sub-threshold input.
class ScrollAxisLockConfigError extends SearErrorStable public error raised for invalid scroll-axis lock configuration.
ScrollAxisLockConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): ScrollAxisLockConfigErrorreadonly code: "SEAR_SCROLL_INVALID_AXIS_LOCK_CONFIG"Stable machine-readable identifier for this error category.
Base class for host scroll adapters.
Concrete scrollers own platform scroll surfaces while ScrollManager owns the platform-neutral viewport state.
readonly configEngine: ConfigEngineConfiguration engine available to concrete scroller adapters.
static readonly ContainerSymbol: symbolDI token used by hosts that provide a scroller container.
static readonly symbol: symbolDI token for resolving the active scroller adapter.
Factory registry for host scroller adapters.
static createScroller(type: string | symbol, args: unknown): ScrollerCreates a scroller for a registered type.
ReturnsNew scroller adapter.
typeScroller type key.
argsAdapter-specific construction input.
static registerScroller(type: string | symbol, scrollerCreator: (args: unknown): Scroller): voidRegisters a scroller creator.
typeScroller type key.
scrollerCreatorFactory invoked by createScroller().
Owns viewport scroll state and fans updates out to render subscribers.
ScrollManager(width: number, height: number): ScrollManagerCreates a scroll manager for a viewport of the given dimensions.
addPublisher(publisher: ScrollPublisher): (): voidConnects a scroll-event source and returns an idempotent disposer.
applyInputScroll(state: ScrollManagerState): voidApplies platform scroll data within the owning editor's command.
destroy(ownerToken?: object): voidDisconnects publishers and subscribers owned by this manager.
enforceCommandBoundary(isExecuting: (): boolean): voidCloses direct viewport writes after the owning editor finishes restoration.
enforceTeardownBoundary(ownerToken: object): voidReserves publisher cleanup for the owning editor.
getContentBoundary(): [number, number]Returns the maximum logical scroll positions for platform adapters.
getPositionRect(): PositionRect<templateLiteral>Returns the viewport rectangle as (0, 0, width, height).
The scroll position is NOT included in the returned rect. Consumers that need the world-coordinate viewport should construct their own rect using scrollState.x/y (available via getState()).
Historically this method returned (state.x, state.y, width, height), but since ScrollManager.update() now clamps state.x/y in-place, including them caused double-offset bugs in render strategies that already add scrollState.x/y to compute world-coordinate query rects.
getPreviousState(): ScrollManagerState | nullReturns the previous committed scroll state.
Returns the scroll state that render strategies should use for viewport copy planning.
deltaX and deltaY are computed from the last position marked as
rendered to the current committed position. This keeps wheel scrolling and
programmatic scrollTo() jumps on the same delta convention expected by
RasterCopyPlan: previous minus current.
getShape(): [number, number]Returns the viewport dimensions as [width, height].
Returns the current committed scroll state.
hasUnrenderedScroll(): booleanReturns whether the current scroll position has not yet been rendered.
markScrollStateRendered(): voidMarks the current committed scroll position as consumed by a render frame.
requestScrollTo(x: number, y: number): voidRequests an absolute scroll position through the owning editor.
resize(width: number, height: number): voidUpdates viewport dimensions and clamps the current position without emitting a scroll render.
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.
setContentBoundary(maxWidth: number, maxHeight: number): voidSet the content boundary for scroll clamping.
maxWidthMaximum scrollable x position (contentWidth - viewportWidth)
maxHeightMaximum scrollable y position (contentHeight - viewportHeight)
This should be called after initialization once the total sheet dimensions are known (e.g. by expandTreeBoundaryToSheetSize).
setInputUpdateExecutor(executor: (state: ScrollManagerState): void): voidRoutes platform-originated viewport input through the host's action boundary.
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.
setScrollToExecutor(executor: (x: number, y: number): void): voidBinds programmatic scroll requests to the owning editor's command bus.
subscribeScroll(callback: ScrollSubscriber, prepend?: boolean): (): voidSubscribes to scroll-state changes and returns an idempotent disposer.
prepend is reserved for updates that must run before render strategies.
static readonly symbol: symbolDI token for resolving the scroll manager.
Host-tunable direction-lock parameters for DOM scrolling gestures.
activationThreshold: numberAccumulated pixels required before selecting the dominant axis.
enabled: booleanwheelEndDelay: numberWheel silence in milliseconds that separates two gestures.
Scroll offset snapshot published to render and coordinate subscribers.
type ScrollAxis = "x" | "y"Axis selected for one continuous wheel or touch gesture.
type ScrollPublisher = (manager: ScrollManager, updateState: (newState: ScrollManagerState): void): (): voidPlatform adapter that connects a scroll event source to ScrollManager.
Creates the default zero-offset scroll state.
class RubberBandConfigError extends SearErrorStable public error raised for invalid rubber-band physics configuration.
RubberBandConfigError(message: string, details?: SearErrorDetails, options?: ErrorOptions): RubberBandConfigErrorreadonly code: "SEAR_SCROLL_INVALID_RUBBER_BAND_CONFIG"Stable machine-readable identifier for this error category.
class RubberBandController extends RubberBandMotionPlatform-neutral Safari-style overscroll physics.
Logical positions never leave their boundaries. Raw excess input is mapped to a visual displacement with WebKit's viewport-relative resistance curve, then returned by a damped harmonic spring during wheel input or after touch release.
RubberBandController(platform: Platform, publishOffset: (offset: RubberBandOffset): void): RubberBandControllerCreates one controller and publishes every visual displacement change.
configure(config: Partial<RubberBandConfig>): voidApplies validated host overrides and resets immediately when disabled.
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.
Returns a copy of the current transient visual displacement.
release(delay?: number, preserveVelocity?: boolean): voidStarts the boundary return after the configured input-settle delay.
reset(): voidCancels pending work and restores the exact zero-displacement state.
Host-tunable parameters for Safari-style boundary resistance and return motion.
enabled: booleanmaxOffset: numberTouch displacement limit in viewport pixels.
resistance: numberInitial slope of the rubber-band curve. Lower values reduce sensitivity.
returnDelay: numberDefault delay used when release is called without an explicit delay.
springDamping: numberViscous damping used by the damped harmonic return motion.
springMass: numberSpring mass used by the damped harmonic return motion.
springStiffness: numberSpring stiffness used by the damped harmonic return motion.
wheelMaxViewportScale?: numberWheel displacement limit as a multiple of the viewport size.
wheelResistanceScale?: numberFraction of touch resistance used for wheel input at a boundary.
One logical input sample consumed by RubberBandController.
readonly boundary: RubberBandOffsetreadonly continueReturnOnOutwardInput?: booleanKeeps an already scheduled return alive for same-direction input.
readonly displacement: RubberBandOffsetContent displacement: positive values move the visible surface right/down.
readonly position: RubberBandOffsetreadonly source?: "wheel" | "touch"readonly viewport: RubberBandOffsetOverscroll motion contract consumed by host scrollers.
configure(config: Partial<RubberBandConfig>): voidconsume(input: RubberBandInput): RubberBandOffsetrelease(delay?: number, preserveVelocity?: boolean): voidreset(): voidTransient visual displacement in viewport pixels.
rubberBandDistance(excess: number, viewport: number, resistance?: number, maxOffset?: number): numberSafari-like rubber-band mapping with a smooth maximum visual displacement.
Full, dirty-region, retained, and incremental rendering policies.
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.
DirtyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): DirtyRenderStrategy<NodeTypeProperties>compositeViewportDamage(damage: readonly PositionRect<templateLiteral>[], composite: (regions: readonly PositionRect<templateLiteral>[]): void): voidComposites cached decorations once inside the union of their visible damage.
Returns the screen render context used by this strategy.
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Dirty strategy does not currently expose coordinate lookup.
ThrowsError Always thrown until this API is implemented.
Redraws all dirty regions for both render targets.
Each dirty rect is processed atomically: clearRect followed immediately by redraw of intersecting nodes. This guarantees that a later rect's clear can erase pixels re-painted by an earlier rect's redraw — critical for cases like cell-editor exit where the overflow area must stay clean despite the grid cell's TextNode redrawing overflow text into it.
static readonly symbol: typeof symbolDI token for resolving DirtyRenderStrategy.
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.
EventRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): EventRenderStrategy<NodeTypeProperties>Returns the context used by this strategy.
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Event-layer hit lookup is not implemented yet.
ThrowsError Always thrown until this API is implemented.
Executes event-layer rendering.
Current implementation is intentionally a no-op.
static readonly symbol: typeof symbolDI token for resolving EventRenderStrategy.
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.
HitRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker, platform: Platform): HitRenderStrategy<NodeTypeProperties>debouncedRender(node: Node<NodeTypeProperties>): voidActually performs the hit-canvas rendering after debounce.
nodeNode to render
destroy(): voidCancels deferred hit-layer work when the owning editor is destroyed.
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.
Get the current rendering context.
ReturnsRenderContext
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Get all nodes at the given (x, y) coordinate by reading the hit-canvas pixel.
ReturnsArray of nodes at the given coordinate
nodeRoot node to search from
xX coordinate
yY coordinate
Debounced render entry. Only the last call within the delay will trigger rendering.
nodeNode to render
delayDebounce delay in ms
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.
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.
static readonly symbol: typeof symbolDI token for resolving HitRenderStrategy.
class OverlayRenderStrategy<NodeTypeProperties> extends RenderStrategy<NodeTypeProperties>Render pass that paints editor overlays at the very end of the pipeline.
This pass guarantees edit-mode visuals stay above sticky headers and any
other layers by drawing nodes with isEdit after StickyRenderStrategy.
OverlayRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): OverlayRenderStrategy<NodeTypeProperties>Returns the context.
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Returns the node by coordinates.
Renders OverlayRenderStrategy scene output.
static readonly symbol: typeof symbolDI token for resolving OverlayRenderStrategy.
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:
Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.
RenderStrategy<T>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<T>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): RenderStrategy<T>readonly dirtyTree: FrameDirtyTrackerreadonly hitRenderContext: RenderContextreadonly offScreenRenderContext: RenderContextreadonly renderContext: RenderContextreadonly scrollManager: ScrollManagerreadonly stage: SceneGraph<T>readonly tree: Tree<PositionRect<templateLiteral>>abstract getContext(): RenderContextReturns the render context owned by this strategy.
abstract getNodeByCoordinates(node: Node<T>, x: number, y: number): Node<T>[]Resolves nodes around the provided coordinates for this strategy layer.
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.
Renders the target node tree according to the strategy semantics.
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.
addStrategy(name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidRegisters or replaces a strategy under the provided key.
addStrategyAfter(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately after an existing strategy.
addStrategyBefore(reference: string | Symbol, name: string | Symbol, strategy: RenderStrategy<NodeTypeProperties>): voidInserts a strategy immediately before an existing strategy.
enforceCommandBoundary(isExecuting: (): boolean): voidCloses direct strategy and view-scale changes after Sheet startup.
getAllStrategy(): RenderStrategy<NodeTypeProperties>[]Returns all currently registered strategies in insertion order.
getStrategy(name: string | Symbol): RenderStrategy<NodeTypeProperties> | undefinedRetrieves a strategy by key.
setViewScale(scale: number): voidPropagates view scale to every context contributed by registered strategies. Shared base/off-screen/hit contexts are updated once.
static readonly symbol: symbolDI token for resolving RenderStrategyManager.
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:
Subclasses only need to implement how they render, which context they expose, and how they perform coordinate-based node lookup for their layer.
ScreenRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker, rasterCopyExecutor: RasterCopyExecutor): ScreenRenderStrategy<NodeTypeProperties>Creates a screen render strategy with injected render targets and copy executor.
configureRuntime(runtime: ScreenRenderStrategyRuntime<NodeTypeProperties>): voidConfigures host-specific viewport, query, and drawing semantics.
Returns the current render context.
The returned context targets the on-screen canvas.
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Not implemented: Finds nodes at the given coordinates.
ThrowsError
Renders the scene graph node using an off-screen buffer for efficient scrolling.
nodeThe root node to render.
restoreRegion(rect: PositionRect<templateLiteral>): voidRestores previously painted body pixels in visible viewport coordinates.
static readonly symbol: typeof symbolDI token for resolving ScreenRenderStrategy.
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.
StickyRenderStrategy<NodeTypeProperties>(renderContext: RenderContext, offScreenRenderContext: RenderContext, hitRenderContext: RenderContext, scrollManager: ScrollManager, configEngine: ConfigEngine, stage: SceneGraph<NodeTypeProperties>, tree: Tree<PositionRect<templateLiteral>>, dirtyTree: FrameDirtyTracker): StickyRenderStrategy<NodeTypeProperties>Returns the current render context.
getNodeByCoordinates(node: Node<NodeTypeProperties>, x: number, y: number): Node<NodeTypeProperties>[]Not implemented: Finds nodes at the given coordinates.
ThrowsError
Renders all StickyNode descendants of the given node. Sticky nodes are positioned according to their sticky logic (top/left).
nodeThe root node to search for StickyNode descendants.
static readonly symbol: typeof symbolDI token for resolving StickyRenderStrategy.
interface ScreenRenderStrategyRuntime<NodeTypeProperties>readonly consumeBlockRasterCopyPlan?: (): BlockRasterCopyPlan | nullConsumes a pending block-copy plan for layout-shift frames, if the host has one.
readonly drawNodes?: (input: {
readonly context: RenderContext;
readonly nodes: readonly Node<NodeTypeProperties>[];
readonly scrollState: ScrollManagerState;
readonly worldRect: PositionRect<templateLiteral>;
}): voidDraws already queried nodes into the visible render context.
readonly forceFullRepaint?: (): booleanForces a full visible body repaint even when the off-screen cache is ready.
readonly getScrollState?: (): ScrollManagerStateReturns the scroll state used for world queries and raster copy deltas.
readonly getViewport?: (): PositionRect<templateLiteral>Returns the viewport-space rectangle covered by this screen layer.
readonly isScrollStateChanged?: (scrollState: ScrollManagerState): booleanReturns whether the current scroll state requires a scroll-copy frame.
readonly onFrameRendered?: (mode: ScreenRenderFrameMode): voidCalled after a full, scroll, or rebuilt frame is rendered.
readonly queryNodes?: (root: Node<NodeTypeProperties>, worldRect: PositionRect<templateLiteral>): readonly Node<NodeTypeProperties>[]Returns screen-body nodes to draw for the supplied world-space rectangle.
readonly requiresFrameRebuild?: (): booleanReturns whether this frame should rebuild a retained render target.
readonly toWorldRect?: (viewportRect: PositionRect<templateLiteral>, scrollState: ScrollManagerState): PositionRect<templateLiteral>Maps a viewport-space repaint rectangle to a world-space query rectangle.
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:
Dirty regions and the incremental policy decide whether a frame can reuse the previous one or needs a rebuild.
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.
DirtyRegionCollector<T>(source: DirtyRegionSource<T>): DirtyRegionCollector<T>Creates a collector around a frame-scoped dirty source.
sourceDirty source owned by the host renderer.
clear(): voidClears all dirty rectangles from the underlying source.
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.
static createClipRegion<T>(dirtyRect: PositionRect<T>, nodeRect: PositionRect<T>, strokeWidth: number, useUnionClip: boolean): [number, number][] | PositionRect<templateLiteral>Builds the repaint clip for one dirty region and one intersecting node.
Most nodes can repaint within the expanded dirty rectangle. Selection-like nodes may need a concave clip covering the union of the dirty region and the node's previous bounds so erased borders do not leave seams.
ReturnsA rectangle or polygon accepted by scene node draw calls.
dirtyRectDirty rectangle in world coordinates.
nodeRectNode bounds in world coordinates.
strokeWidthStroke width used to expand both dirty and node bounds.
useUnionClipWhether to compute the concave union boundary.
static dedupePoints(points: [number, number][]): [number, number][]Removes duplicated points while preserving first occurrence order.
ReturnsDeduplicated polygon points.
pointsPolygon points.
static expand<T>(rect: PositionRect<T>, padding: number): PositionRect<templateLiteral>Expands a dirty rectangle by a symmetric stroke padding.
ReturnsExpanded rectangle suitable for clipping repaint work.
rectDirty rectangle in world coordinates.
paddingPixels added to every edge.
static removeCollinear(points: [number, number][]): [number, number][]Drops middle vertices that lie on a straight line.
Degenerate polygons are preserved as-is so callers can fall back to a rectangle when the boundary cannot form a useful clip.
ReturnsCleaned polygon points.
pointsPolygon points in boundary order.
static traceUnionBoundary(rectA: DirtyRegionBounds, rectB: DirtyRegionBounds): [number, number][]Traces the outer boundary of the union of two axis-aligned rectangles.
The returned path may be concave and is intended for clip construction, not for hit testing or layout geometry.
ReturnsBoundary points in drawing order.
rectAFirst rectangle bounds.
rectBSecond rectangle bounds.
Decides whether an incremental render candidate is worth using for the next frame.
evaluate(candidate: IncrementalRenderCandidate, limits?: IncrementalRenderPolicyLimits): IncrementalRenderDecisionstatic readonly symbol: typeof symbolDI token for resolving IncrementalRenderPolicy.
Manages the off-screen viewport frame used by Canvas scroll optimization.
The cache wraps RenderContext.isDrawn so consumers do not need to reach into
the render target directly. It provides explicit operations for clearing,
priming after first paint, and refreshing after an incremental scroll redraw.
ViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCacheCreates a viewport frame cache facade.
cacheContextOff-screen render target that stores the last complete base frame.
copyExecutorRaster copy executor used for cache synchronization.
clear(viewport: PositionRectProps): voidClears the cached viewport with an identity transform.
viewportViewport-space rectangle to erase from the cache.
invalidate(): voidMarks the cached frame invalid so the next render performs a full prime.
isReady(): booleanReturns whether the cache already contains a complete base frame.
markReady(): voidMarks the cached frame ready after a complete frame has been copied in.
primeFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): voidPrimes the cache from the visible frame after a first full paint.
visibleContextVisible render target containing a complete base frame.
viewportViewport-space rectangle to clear before copying.
refreshFromVisibleFrame(visibleContext: RenderContext, viewport: PositionRectProps): voidRefreshes the cache from the visible target after incremental redraw.
visibleContextVisible render target containing the latest base frame.
viewportViewport-space rectangle to copy into the cache.
Boundary represented by four world-space edges.
interface DirtyRegionSource<T>Minimal dirty-region storage contract consumed by DirtyRegionCollector.
Sheet uses FrameDirtyTracker; future document renderers can provide
a block/page dirty source with the same boundary, query and frame-clear
contract without depending on Sheet scene internals.
clear(): voidClears dirty state after the owning frame has consumed it.
getBoundary(): PositionRect<T>Returns the total query boundary that contains all possible dirty entries.
query(range: PositionRect<T>): PositionRect<T>[]Returns dirty rectangles intersecting the provided query range.
Measured cost shape for one proposed incremental render frame.
readonly copiedArea: numberTotal destination pixel area copied from the retained/off-screen frame cache.
readonly copyCount: numberNumber of raster copy rectangles in the candidate plan.
readonly invalidArea: numberTotal world pixel area that still needs redraw after raster reuse.
readonly invalidRectCount: numberNumber of invalid redraw rectangles in the candidate plan.
readonly viewport: Pick<PositionRectProps, "width" | "height">Viewport dimensions used as the baseline for area ratios.
readonly accepted: booleanreadonly reason: IncrementalRenderDecisionReasonGuardrails used to decide whether an incremental render plan is cheaper and safe enough to use.
readonly maxCopiedAreaRatio: numberMaximum total copied pixel area divided by viewport area. Values above 1 allow overlapping or repeated copies.
readonly maxCopyCount: numberMaximum number of raster copy rectangles allowed in one frame.
readonly maxInvalidAreaRatio: numberMaximum invalid redraw area divided by viewport area after raster copies have been applied.
readonly maxInvalidRectCount: numberMaximum number of invalid redraw rectangles allowed in one frame.
Capability snapshot used by viewport render coordinators before choosing a raster strategy.
readonly requiresExplicitNodeClear: booleanreadonly requiresFrameRebuild: booleanreadonly supportsDirtyRedraw: boolean| Member | Value |
|---|---|
Accepted |
"accepted" |
NotCandidate |
"not-candidate" |
EmptyViewport |
"empty-viewport" |
ExcessiveCopiedArea |
"excessive-copied-area" |
ExcessiveInvalidArea |
"excessive-invalid-area" |
ExcessiveCopyCount |
"excessive-copy-count" |
ExcessiveInvalidRectCount |
"excessive-invalid-rect-count" |
clearViewport(context: RenderContext, viewport: PositionRectProps): voidclearViewportRect(context: RenderContext, rect: PositionRectProps): voidcreateViewportFrameCache(cacheContext: RenderContext, copyExecutor: RasterCopyExecutor): ViewportFrameCacherequiresViewportExplicitNodeClear(context: RenderContext): booleanrequiresViewportFrameRebuild(context: RenderContext): booleansupportsViewportDirtyRedraw(context: RenderContext): booleanworldRectToViewportClearRect<T>(rect: PositionRect<T>, scrollX: number, scrollY: number, padding: number): PositionRect<templateLiteral>Raster copy plans reuse already painted pixels when a viewport change makes that safe.
Raster-copy plan for layout shifts where unchanged blocks move within the viewport.
BlockRasterCopyPlan(viewport: PositionRectProps, clearViewportRects: readonly PositionRect<templateLiteral>[], cacheToViewportCopies: readonly RasterCopyRect[], invalidWorldRects: readonly PositionRect<templateLiteral>[]): BlockRasterCopyPlanreadonly cacheToViewportCopies: readonly RasterCopyRect[]readonly clearViewportRects: readonly PositionRect<templateLiteral>[]readonly invalidWorldRects: readonly PositionRect<templateLiteral>[]readonly viewport: PositionRectPropsstatic fromLayoutShift(input: BlockRasterCopyPlanInput): BlockRasterCopyPlan | nullExecutes 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.
copy(source: RenderContext, destination: RenderContext, copy: RasterCopyRect): voidCopies a rectangular pixel region from one render target into another.
sourceSource render context.
destinationDestination render context.
copySource and destination rectangles in viewport coordinates.
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.
sourceSource render context.
destinationDestination render context.
xDestination x-coordinate.
yDestination y-coordinate.
static readonly symbol: typeof symbolDI token for resolving RasterCopyExecutor.
Immutable plan for reusing viewport pixels across render targets.
A plan describes the off-screen-to-visible copy for a scroll frame, the newly exposed viewport rectangle that still needs node redraw, and the final visible-to-off-screen copy that refreshes the cache after redraw.
RasterCopyPlan(viewport: PositionRect<templateLiteral>, cacheToViewportCopy: RasterCopyRect, blankViewportRect: PositionRect<templateLiteral>, blankWorldRect: PositionRect<templateLiteral>, viewportToCacheCopy: RasterCopyRect): RasterCopyPlanCreates a raster copy plan.
viewportViewport rectangle in viewport coordinates.
cacheToViewportCopyCopy from the cached frame into the visible target.
blankViewportRectNewly exposed viewport-space area to redraw.
blankWorldRectNewly exposed world-space area to query from the scene.
viewportToCacheCopyCopy from the visible target back into the cache.
readonly blankViewportRect: PositionRect<templateLiteral>Newly exposed viewport-space area to redraw.
readonly blankWorldRect: PositionRect<templateLiteral>Newly exposed world-space area to query from the scene.
readonly cacheToViewportCopy: RasterCopyRectCopy from the cached frame into the visible target.
readonly viewport: PositionRect<templateLiteral>Viewport rectangle in viewport coordinates.
readonly viewportToCacheCopy: RasterCopyRectCopy from the visible target back into the cache.
getExposedViewportRects(edgePadding?: number): readonly PositionRect<templateLiteral>[]Disjoint exposed bands. A diagonal blit uncovers both a horizontal and a vertical strip.
static createViewportToCacheCopy(viewport: PositionRectProps): RasterCopyRectCreates a full-viewport copy from the visible target into the frame cache.
ReturnsCopy rectangle with identical source and destination bounds.
viewportViewport-space bounds to copy.
static fromScroll(viewport: PositionRect<templateLiteral>, scrollState: ScrollManagerState): RasterCopyPlanBuilds the scroll-copy plan used by Canvas viewport renderers.
The delta convention follows RenderStrategy: delta is previous minus
current, while drawImage source offsets use current minus previous.
ReturnsPlan for copy, exposed-area redraw, and cache refresh.
viewportVisible viewport rectangle in viewport coordinates.
scrollStateCurrent scroll snapshot.
readonly destination: PositionRectPropsreadonly source: PositionRectPropsreadonly clearWorldRects: readonly PositionRectProps[]readonly copies: readonly BlockRasterCopyCandidate[]readonly invalidWorldRects: readonly PositionRectProps[]readonly scrollState: Pick<ScrollManagerState, "x" | "y">readonly viewport: PositionRectPropsSource and destination rectangles for one raster copy.
readonly destination: PositionRectPropsDestination pixels inside the destination render target, expressed in viewport coordinates.
readonly source: PositionRectPropsSource pixels inside the source render target, expressed in viewport coordinates.
Public rendering facade that composes contexts, nodes, strategies, and registries.
class SheetCellBorderView extends ViewExtensionBase<SearCoreSheet, CellProperties>Independent scene projection of the border owner's committed field.
readonly retainOnOwnerChange: PluginKey[]The cell scene is independent of the selected range.
render(context: SearCoreSheet): CellBorderLineNode[]renderScrolled(context: SearCoreSheet, previous: readonly Node<CellProperties>[]): CellBorderLineNode[]Reuses resolved shared edges that remain visible at the new scroll position.
class SheetCellEditorView extends ViewExtensionBase<SearCoreSheet, CellProperties>Coordinates Sheet cell edit sessions, text input, and embedded editors.
SheetCellEditorView(owner: SheetCellEditorPlugin, options: SheetCellEditorViewOptions): SheetCellEditorViewreadonly depth: 0Orders scene contributions; lower values are drawn first.
bindCore(core: SearCoreSheet): voiddestroyView(): voidinitializeView(core: SearCoreSheet): voidonCommit(): voidonDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): booleanonMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseUp(_searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidregisterCommands(commands: SheetCommandBus): voidregisterConfig(): {
config: ConfigUnit<SheetCellEditorConfig>;
key: OwnerKey;
}[]Registers visual defaults for the inline cell editor.
render(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}): Node<CellProperties>[]Renders SheetCellEditorView scene output.
static readonly defaultConfig: SheetCellEditorConfigDefault visual configuration for the inline cell editor.
static readonly symbol: typeof symbolclass SheetCheckboxView extends ViewExtensionBase<unknown, CellProperties>Renders checkbox values and translates glyph hits into semantic commands.
readonly depth: -25Orders scene contributions; lower values are drawn first.
destroyView(): voidonDblClick(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseDown(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidclass SheetColumnLabelView extends ViewExtensionBase<SearCoreSheet, CellProperties>Renders sticky column header cells for the visible viewport range.
Constructs the column header plugin.
getConfig(searCore: SearCoreSheet): {
defaultBackgroundColor: string;
defaultBorderColor: string;
defaultHeight: number;
}Reads the column header render configuration from ConfigEngine.
initialize(): voidInitializes column header runtime state.
onResize(): voidColumn header dimensions are recomputed during render after resize.
onScroll(_scrollManagerState: ScrollManagerState): voidColumn header positions are recomputed during render from scroll state.
registerConfig(): {
config: ConfigUnit<{
defaultBackgroundColor: string;
defaultBorderColor: string;
defaultHeight: number;
}>;
key: OwnerKey;
}[]Registers default column header configuration.
render(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}): Node<CellProperties>[]Renders visible column header cells.
ReturnsRender nodes for visible column headers.
searCoreSheet core containing data and render services.
offsetWorld offset applied by sticky rendering.
static readonly defaultConfig: {
defaultBackgroundColor: string;
defaultBorderColor: string;
defaultHeight: number;
}Default visual configuration for column headers.
static readonly symbol: symbolDI token for resolving the column header plugin.
class SheetCornerView extends ViewExtensionBase<SearCoreSheet, CellProperties>Renders the sticky sheet corner cell where row and column headers meet.
Constructs the sheet corner plugin.
getConfig(searCore: SearCoreSheet): {
backgroundColor: string;
borderColor: string;
height: number;
width: number;
}Reads the sheet corner render configuration from ConfigEngine.
initialize(): voidInitializes sheet corner runtime state.
onResize(): voidSheet corner dimensions are recomputed during render after resize.
onScroll(_scrollManagerState: ScrollManagerState): voidSheet corner position is recomputed during render from scroll state.
registerConfig(): {
config: ConfigUnit<{
backgroundColor: string;
borderColor: string;
height: number;
width: number;
}>;
key: OwnerKey;
}[]Registers default sheet corner configuration.
render(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}): Node<CellProperties>[]Renders the sheet corner cell.
ReturnsRender nodes for the sheet corner.
searCoreSheet core containing render services.
offsetWorld offset applied by sticky rendering.
static readonly symbol: symbolDI token for resolving the sheet corner plugin.
class SheetCursorView extends ViewExtensionBase<SearCoreSheet, CellProperties>Projects Sheet interaction state into host cursor behavior.
SheetCursorView(cursorRegistry: CursorRegistry, cursorEngine: CursorEngine, coordinates: CoordinateEngine, renderContext: RenderContext): SheetCursorViewonMouseMove(_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.
static readonly symbol: symbolDI token for resolving SheetCursorView.
class SheetDataValidationView extends ViewExtensionBase<unknown, CellProperties>Validation markers and numeric control interactions over semantic rule queries.
readonly depth: -23Orders scene contributions; lower values are drawn first.
destroyView(): voidonMouseDown(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseUp(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidclass SheetDropdownView extends ViewExtensionBase<unknown, CellProperties>Dropdown labels, arrow geometry, and pointer-to-command translation.
readonly depth: -24Orders scene contributions; lower values are drawn first.
destroyView(): voidonMouseDown(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseUp(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidclass SheetFocusCellView extends ViewExtensionBase<SearCoreSheet, CellProperties>Optional view that highlights the rows and columns surrounding each selected range.
SheetFocusCellView(queries: SheetQueryRegistry, visuals: SheetCellVisualReaderRegistry, preference: { enabled: boolean }): SheetFocusCellViewBinds the current editor's selection queries and cell renderers.
invalidatesRetainedViews: booleanThe focus color is baked into grid cells when cross-highlighting is enabled.
destroyView(): voidReleases the editor-local paint override.
initializeView(core: SearCoreSheet): voidAdds the focus color to the grid's existing visible-cell paint pass.
onCommit(): voidReads the selected ranges once before the grid rebuilds its visible cells.
registerCommands(commands: SheetCommandBus): voidRegisters the local toggle without creating a document transaction.
registerQueries(queries: SheetQueryRegistry): voidExposes the toggle state to status-bar controls.
static readonly preferenceSymbol: symbolA workbook may bind one shared preference across its sheet views.
static readonly symbol: typeof symbolToken for registering this view in a Sheet or Workbook.
static registerServices(__namedParameters: { container: Container }): voidSupplies a sheet-local preference when the host has not provided one.
class SheetFormulaHyperlinkView extends ViewExtensionBase<unknown, CellProperties>Converts a hyperlink cell hit into the formula owner's semantic command.
SheetFormulaHyperlinkView(commands: SheetCommandBus, results: IFormulaRichResultProvider, services: IFormulaExternalServiceProvider): SheetFormulaHyperlinkViewonMouseUp(_context: unknown, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidstatic readonly symbol: typeof symbolHighlights 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.
SheetFormulaReferenceHighlightView(statusProvider: IFormulaStatusProvider, configEngine: ConfigEngine, highlightRegistry: SheetHighlightRegistry, interactionStore: SheetInteractionStore): SheetFormulaReferenceHighlightViewdepth: numberDraw above regular cells and below Selection's edit overlay.
bindCrossSheetSource(source: FormulaCrossSheetHighlightSource): voidBinds an optional workbook-owned reference source for this Sheet instance.
getHighlights(context: SheetHighlightContext): SheetRangeHighlight[]The provider contract consumed by SheetHighlightView.
registerConfig(): {
config: ConfigUnit<FormulaReferenceHighlightConfig>;
key: PluginKey;
}[]Default display configuration contributions for this view.
static readonly highlightProviderKey: "formula-selection-references"Stable key for the formula-reference highlight contribution.
Stable plugin key for SheetFormulaReferenceHighlightView.
static readonly symbol: typeof symbolDI token for resolving SheetFormulaReferenceHighlightView.
class SheetGridView extends ViewExtensionBase<SearCoreSheet, CellProperties>Composite plugin that assembles sheet chrome, body grid, and merged-cell nodes.
SheetGridView(sheetCornerPlugin: SheetCornerView, sheetColumnLabelPlugin: SheetColumnLabelView, sheetRowNumberPlugin: SheetRowNumberView, sheetGridRender: SheetGridRender): SheetGridViewConstructs the grid plugin from its child sheet render plugins.
readonly retainOnOwnerChange: PluginKey[]The cell scene is independent of the selected range.
onDblClick(earCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidForwards double-click handling to the body grid renderer.
registerConfig(): {
config: ConfigUnit<{
backgroundColor: string;
borderColor: string;
height: number;
width: number;
}>;
key: OwnerKey;
}[]Registers configuration contributed by every child sheet render plugin.
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.
searCoreSheet core containing data and render services.
renderScrolled(searCore: SearCoreSheet, previous: readonly Node<CellProperties>[]): Node<CellProperties>[]Carries visible body cells forward while rebuilding sticky chrome at its new offset.
static readonly symbol: symbolDI token for resolving the composite sheet grid plugin.
class SheetHeaderHighlightView extends ViewExtensionBase<SearCoreSheet, CellProperties>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.
SheetHeaderHighlightView(sheetSelectionPlugin: SheetSelectionPlugin, sheetCornerPlugin: SheetCornerView): SheetHeaderHighlightViewdepth: numberBase render depth for plugin-generated nodes.
The plugin places highlight background at depth + 1.5 and emphasis bars at depth + 3
to guarantee stable stacking relative to default header nodes.
readonly rectangularOverlay: trueregisterConfig(): {
config: ConfigUnit<{
columnHeaderHeight: number;
headerHighlightActiveBarThickness: number;
headerHighlightActiveBorderColor: string;
headerHighlightBackgroundColor: string;
headerHighlightBorderColor: string;
mode: SheetHeaderHighlightMode;
}>;
key: OwnerKey;
}[]Registers default configuration for this plugin.
render(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}): Node<CellProperties>[]Builds highlight nodes for row and column headers based on current selection and mode.
Rendering flow:
SheetSelectionPlugin.ReturnsFlat list of nodes to add into the stage for this frame.
searCoreActive core sheet instance.
offsetWorld-space offset propagated by the render pipeline.
class SheetHighlightView extends ViewExtensionBase<SearCoreSheet, CellProperties>Renders registered range-highlighter output as a single managed scene layer.
render(searCore: SearCoreSheet): Node<CellProperties>[]Renders SheetHighlightView scene output.
class SheetHistoryKeyboardView extends ViewExtensionBase<unknown, CellProperties>Native shortcut bindings for the independent history command surface.
SheetHistoryKeyboardView(keyboard: KeyboardRouter, commands: SheetCommandBus): SheetHistoryKeyboardViewdestroyView(): voidinitializeView(): voidstatic readonly symbol: typeof symbolclass SheetResizeView extends ViewExtensionBase<SearCoreSheet, CellProperties>Owns row and column resize state, interaction, and visual feedback.
SheetResizeView(stateOwner: SheetResizePlugin, coordEngine: CoordinateEngine, cursorEngine: CursorEngine, textShaper: TextShaper, displayTextRegistry: CellDisplayTextReader, pointerCapture: PointerCapture, commands?: SheetCommandBus, platform?: Platform, cursorRegistry?: CursorRegistry, commandDataEngine?: DataEngine, embeddedEditor?: SheetEmbeddedEditor, keyboardRouter?: KeyboardRouter): SheetResizeViewdepth: numberOrders scene contributions; lower values are drawn first.
beginResizeDrag(input: SheetBeginResizeDragInput): voidApplies a command-owned resize drag start to local interaction state.
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.
searCoreSheet core containing render and scroll services.
transactionTransaction to inspect for resize operations.
endResizeDrag(): voidClears command-owned resize drag state.
getResizeState(): ResizeDragStateReturns a detached view of the local drag session.
onDblClick(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseDown(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseMove(searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidonMouseUp(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidregisterCommands(commands: SheetCommandBus): voidRegisters the commands.
render(searCore: SearCoreSheet): Node<CellProperties>[] | nullRenders SheetResizePlugin scene output.
setProjectedCells(source: SheetResizeProjectedCells): voidIncludes sparse derived display cells in auto-fit measurements.
updateResizeDrag(input: SheetUpdateResizeDragInput): voidApplies a command-owned resize drag move to local interaction state.
static readonly symbol: typeof symbolclass SheetRowNumberView extends ViewExtensionBase<SearCoreSheet, CellProperties>Renders sticky row header cells for the visible viewport range.
Constructs the row header plugin.
getConfig(searCore: SearCoreSheet): {
defaultBackgroundColor: string;
defaultBorderColor: string;
defaultWidth: number;
}Reads the row header render configuration from ConfigEngine.
initialize(): voidInitializes row header runtime state.
onResize(): voidRow header dimensions are recomputed during render after resize.
onScroll(_scrollManagerState: ScrollManagerState): voidRow header positions are recomputed during render from scroll state.
registerConfig(): {
config: ConfigUnit<{
defaultBackgroundColor: string;
defaultBorderColor: string;
defaultWidth: number;
}>;
key: OwnerKey;
}[]Registers default row header configuration.
render(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}): Node<CellProperties>[]Renders visible row header cells.
ReturnsRender nodes for visible row headers.
searCoreSheet core containing data and render services.
offsetWorld offset applied by sticky rendering.
static readonly defaultConfig: {
defaultBackgroundColor: string;
defaultBorderColor: string;
defaultWidth: number;
}Default visual configuration for row headers.
static readonly symbol: symbolDI token for resolving the row header plugin.
class SheetSelectionView extends ViewExtensionBase<SearCoreSheet, CellProperties>Presents Sheet selections and translates native input into owner commands.
The independent selection plugin owns ranges and navigation state. This view owns pointer capture, keyboard routing, viewport effects and visual highlights.
SheetSelectionView(owner: SheetSelectionPlugin, merges: SheetCellMergePlugin, keyboard: KeyboardRouter, platform: Platform, rangeDrag: SheetRangeDrag, highlights: SheetHighlightRegistry, pointer: PointerCapture, text: TextInput, formats: SheetFormatTransferRegistry, commands: SheetCommandBus, queries: SheetQueryRegistry): SheetSelectionViewdepth: numberOrders scene contributions; lower values are drawn first.
readonly rectangularOverlay: truedestroyView(): voidCancels transient pointer work before this editor is released.
initializeView(core: SearCoreSheet): voidBinds this presentation to the core owned by its editor-local container.
onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the dbl click lifecycle event.
onFillHandleDoubleClick(event: EventWithOffsetAndTarget<CellProperties>): booleanLets the editor distinguish the fill handle from a cell-body double click.
onMouseDown(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the mouse down lifecycle event.
onMouseMove(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the mouse move lifecycle event.
onMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): boolean | voidHandles the mouse up lifecycle event.
registerCommands(commands: SheetCommandBus): voidregisterConfig(): {
config: ConfigUnit<{
defaultBackgroundColor: string;
defaultBorderColor: string;
}>;
key: OwnerKey;
}[]Default display configuration contributions for this view.
registerEffects(registry: SheetCommandEffectRegistry): voidrender(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}): Node<CellProperties>[]Renders the committed selection as view-owned scene nodes.
static readonly symbol: typeof symbolclass SheetZoomView extends ViewExtensionBase<SearCoreSheet, CellProperties>Local-only Excel-style sheet view zoom. It never changes document data or OT state.
SheetZoomView(keyboardRouter: KeyboardRouter, commands?: SheetCommandBus, platform?: Platform): SheetZoomViewgetConfig(): unknownReturns the plugin config.
getScale(): numberReturns the scale.
initializeView(core: SearCoreSheet): voidBinds command and session behavior independently of scene generation.
registerCommands(commands: SheetCommandBus): voidRegisters the commands.
registerConfig(): {
config: ConfigUnit<{
maxScale: number;
minScale: number;
step: number;
}>;
key: OwnerKey;
}[]Default display configuration contributions for this view.
registerObservations(observations: ObservationRegistry): voidregisterQueries(queries: SheetQueryRegistry): voidExposes the current zoom without requiring a session-state capture.
registerSessionState(registry: SessionStateRegistry): voidRegisters local view scale after Core initialization makes zoom effects available.
setScale(nextScale: number): voidUpdates the scale.
readonly commands: SheetCommandBusreadonly coordinates: CoordinateTransformerreadonly cursor: CursorEnginereadonly cursors: CursorRegistryreadonly embeddedEditor: SheetEmbeddedEditorreadonly highlighter: Highlighterreadonly keyboard: KeyboardRouterreadonly merges: SheetCellMergePluginreadonly onFillHandleDoubleClick: (event: EventWithOffsetAndTarget<CellProperties>): booleanLets the selection presentation consume a fill gesture before cell editing.
readonly pointer: PointerCapturereadonly references?: FormulaReferencePickServicereadonly selection: SheetSelectionPluginreadonly textShaper: TextShaperView-only services for checkbox glyphs and pointer activation.
readonly commands: SheetCommandBusreadonly coordinator: SheetRenderCoordinatorManagerreadonly cursor: CursorRegistryreadonly types: CellTypeCatalogbeforeToggle(): booleanreadonly commands: SheetCommandBusreadonly coordinates: Pick<CoordinateEngine, "screenToWorld">readonly registry: SheetCellVisualReaderRegistryreadonly source: Pick<SheetDataValidationPlugin, "readIssue" | "readNumericControl" | "validate">beforeChange(): booleanreadonly commands: SheetCommandBusreadonly coordinates: Pick<CoordinateEngine, "screenToWorld">readonly registry: SheetCellVisualReaderRegistryreadonly source: Pick<SheetDropdownPlugin, "readIndicator">beforeOpen(): booleanComputed 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).
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.
scrollManagerThe scroll manager that holds viewport + scroll position
rowSizesRow dimension matrix (heights with cumulative boundary lookups)
columnSizesColumn dimension matrix (widths with cumulative boundary lookups)
offsetRender offset (e.g. frozen header offsets), added to viewport origin
createBuiltinSheetCellView(coordinator: SheetRenderCoordinatorManager, types: CellTypeCatalog): ViewExtension<unknown, CellProperties>Installs the default presentation of built-in cell types and view-only roles.
registerSheetCellStyleView(registry: SheetCellVisualReaderRegistry, styles: SheetCellStyleReader): (): voidPresents the core's composed style without duplicating feature evaluation.
Shared identity for formula plugin state and configuration.
Owns one local range-border gesture; document changes enter through the move command.
SheetRangeDrag(commands: SheetCommandBus, queries: SheetQueryRegistry, coordinates: CoordinateEngine, pointer: PointerCapture, keyboard: KeyboardRouter, cursorRules: CursorRegistry, cursor: CursorEngine, highlights: SheetHighlightRegistry, platform: Platform, interactions: SheetInteractionStore, inputValidation: SheetCellInputValidationRegistry, cellCodecs: CellClipboardCodecRegistry, formats: SheetFormatTransferRegistry, ownerData: SheetClipboardTransferRegistry): SheetRangeDragbind(core: SearCoreSheet, readSelection: (): Rect, ownerToken: object): voidInstalls editor-local cursor and preview contributions once Core is available.
destroy(ownerToken?: object): voidIdempotently releases preview, cursor, pointer capture and animation resources.
isActive(): booleanonFillHandleDoubleClick(event: EventWithOffsetAndTarget<CellProperties>): booleanFills down to the end of a continuous adjacent column when the handle is double-clicked.
onMouseDown(event: EventWithOffsetAndTarget<CellProperties>): booleanStarts on selection borders or already selected axis headers.
registerCommands(commands: SheetCommandBus): voidRoutes local pointer and animation inputs through the editor command boundary.
setUserInteraction(service: UserInteractionService | undefined): voidBinds the optional host-owned confirmation service during assembly.
static readonly symbol: typeof symbolDetached input coordinates for a selection pointer transition.
readonly action: SheetSelectionPointerActionreadonly ctrlKey?: booleanreadonly metaKey?: booleanreadonly shiftKey?: booleanreadonly target?: {
readonly endColIndex: number | undefined;
readonly endRowIndex: number | undefined;
readonly region: CellRegion | undefined;
readonly startColIndex: number | undefined;
readonly startRowIndex: number | undefined;
} | nullreadonly view?: {
readonly x: number;
readonly y: number;
}Pointer-session transitions owned by the Sheet selection plugin.
| Member | Value |
|---|---|
Down |
"down" |
Move |
"move" |
Tick |
"tick" |
Up |
"up" |
type SheetRangeDragInput = {
readonly action: typeof SheetRangeDragAction.Begin | typeof SheetRangeDragAction.FillBegin | typeof SheetRangeDragAction.Update | typeof SheetRangeDragAction.Release;
readonly point: PointerCapturePoint;
} | {
readonly action: typeof SheetRangeDragAction.Cancel | typeof SheetRangeDragAction.Tick;
}Portable inputs for one local gesture, never persisted as document state.
buildSelectionUpdate(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>, extendFromEdit?: PluginKey): {
active?: Point;
anchor: Point;
focus: Point;
} | nullBuild a selection transaction from the click event target.
Mirrors the logic in SheetSelectionPlugin.onMouseDown so that clicking a different cell while editing commits the edit AND selects the new cell in a single batch dispatch.
Returns null if the event has no valid cell target.
createAxisDragHighlight(__namedParameters: SheetAxisDragDestination, rows: number, columns: number): SheetRangeHighlightPaints the assessed destination without changing its dimensions or topology.
resolveAxisInsertionBoundary(dimensions: DimensionsCSRMatrix, coordinate: number): numberResolves the closest insertion edge, including both outer sheet boundaries.
Starts the local text-selection drag after the pointer command succeeds.
EndCellEditorDragSelectionCommand: SheetCommandDefinition<{ readonly disposeCapture: boolean }, SheetCommandResult>Ends the local text-selection drag and optionally releases pointer capture.
HandleSheetSelectionPointerCommand: SheetCommandDefinition<SheetSelectionPointerInput, SheetCommandResult>Routes selection pointer-session changes through the editor command bus.
Canonical phases of a local range-border gesture.
readonly Begin: "begin"readonly Cancel: "cancel"readonly FillBegin: "fill-begin"readonly Release: "release"readonly Tick: "tick"readonly Update: "update"Stable semantic attributes emitted by retained render targets for Selection.
readonly outlineRole: "selection-outline"readonly owner: "sheet-selection"readonly shadeRole: "selection-shade"Read surface needed to measure text extending beyond an edited cell.
readonly cellAlignments?: { getItem(row: number, column: number): string | null | undefined } | nullreadonly sheetData: {
getItem(row: number, column: number): { readonly value?: unknown } | null | undefined;
}Pointer selection update inside an active embedded editor.
readonly clickCount?: numberreadonly point: {
readonly x: number;
readonly y: number;
}readonly type: "pointerDown" | "pointerMove"computeCellEditorOverflowLeftX(config: Partial<SheetConfig>, state: CellEditorOverflowFields, textShaper: Pick<TextShaper, "shape"> | undefined, anchor: readonly [number, number], cellLeftX: number, baseWidth: number, cellPadding: number): numberReturns the left edge of center/right-aligned text, or the cell edge when it does not overflow.
readCellEditorGeometryFields(dataEngine: DataEngine): {
columnSizes: DimensionsCSRMatrix;
rowSizes: DimensionsCSRMatrix;
} | nullHandleCellEditorPointerCommand: SheetCommandDefinition<SheetCellEditorPointerInput, SheetCommandResult>Updates the embedded editor's cursor or drag selection.
Command that requests a render pass for the cell editor overlay.
class CellBorderLineNode extends RenderNode<CellProperties>Visual-only custom-border segment, including double and slanted line styles.
CellBorderLineNode(line: BorderLineSegment, border: SheetBorderStroke, edgeKey?: string): CellBorderLineNodereadonly edgeKey?: stringclear(context: RenderContext): voidClears state owned by Node.
drawHit(): voidAbstract method to draw the node's hit detection representation. Must be implemented by subclasses.
drawScene(context: RenderContext, _clipRegion?: ClipRegion): voidAbstract method to draw the node's scene representation. Must be implemented by subclasses.
contextThe rendering context.
matches(line: BorderLineSegment, stroke: SheetBorderStroke): booleanWhether this shared edge still resolves to the same geometry and paint.
Exact world-coordinate segment contributed by the border renderer.
Public input for starting a resize drag session.
readonly axis: SheetResizeAxisreadonly initialSizes: readonly SheetResizeDragInitialSize[]readonly primaryIndex: numberreadonly world: {
readonly x: number;
readonly y: number;
}Resize drag-session state controller owned by SheetResizePlugin.
beginResizeDrag(input: SheetBeginResizeDragInput): voidendResizeDrag(): voidupdateResizeDrag(input: SheetUpdateResizeDragInput): voidOne captured size at the start of a resize drag.
Derived cells that have display text without a stored Sheet data entry.
forEachProjectedCellInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (cell: {
formula?: string;
type: string | symbol;
value?: unknown;
}, row: number, col: number): void): voidPublic input for moving an active resize drag session.
readonly world: {
readonly x: number;
readonly y: number;
}type SheetResizeAxis = "row" | "col"Supported resize interaction axis.
registerSheetResizeDragCommands(commands: SheetCommandBus, controller: SheetResizeDragCommandController): voidRegisters resize drag-session command factories on one editor command bus.
commandsCommand bus owned by the current sheet editor.
controllerResize plugin controller that owns local drag-session state.
renderCellBorders(core: SearCoreSheet, matrix: CellBorderMatrix, retained?: ReadonlyMap<string, CellBorderLineNode>): CellBorderLineNode[]Builds only visible edge nodes; merged interiors never receive custom strokes.
Command that starts resize drag-session state through the command bus.
Command that clears resize drag-session state through the command bus.
UpdateSheetResizeDragCommand: SheetCommandDefinition<SheetUpdateResizeDragInput, SheetCommandResult>Command that updates resize drag-session state through the command bus.
class FormulaReferenceHighlighter extends HighlighterFormula implementation of the editor's generic Highlighter contract.
FormulaReferenceHighlighter(parser: IFormulaParser, configEngine: ConfigEngine): FormulaReferenceHighlighterclear(): voidReleases any session-scoped resources. Stateless highlighters need not override this.
highlight(formula: string, context?: HighlightContext): HighlightingReturns highlighted segments for the supplied source range.
static readonly symbol: symbolDI token for resolving FormulaReferenceHighlighter.
Extensible editor highlighting contract.
Implementations translate an editor's current text into generic text styles and optional sheet ranges. They must not mutate the editing document.
clear(): voidReleases any session-scoped resources. Stateless highlighters need not override this.
abstract highlight(text: string, context?: HighlightContext): HighlightingReturns highlighted segments for the supplied source range.
static readonly symbol: symbolDI token for resolving Highlighter.
Registry for independently replaceable sheet-range highlighters.
The registry owns provider activation and change notification; the paired SheetHighlightView owns scene-node creation and teardown.
SheetHighlightRegistry(platform?: Platform): SheetHighlightRegistrygetHighlights(context: SheetHighlightContext): SheetRangeHighlight[]Returns the highlights.
invalidate(): voidRequests a new provider evaluation when state read by a provider (for example selection, search terms, or remote cursors) changes externally.
register(provider: SheetHighlightProvider): (): voidRegisters the value.
setEnabled(providerKey: string, enabled: boolean): voidUpdates the enabled.
subscribe(listener: (): void): (): voidSubscribes to state changes and returns an idempotent disposer.
static readonly symbol: typeof symbolDI token for resolving SheetHighlightRegistry.
A sheet rectangle rendered as part of an editor highlight.
Named palette entries stay compatible with the reactive configuration engine.
Formula-reference overlay settings used while editing a formula.
activeReferenceFillOpacity: numberOpacity of the referenced-cell overlay under the formula cursor.
Stable, high-contrast colors assigned to formula references.
referenceFillOpacity: numberOpacity of referenced-cell overlays when the cursor is elsewhere.
Generic editor state that can influence a highlighter's presentation.
cursorOffset?: numberZero-based cursor position in the editor's plain-text content.
Presentation-only output shared by all editor highlighters.
textAttributes: TextAttributeRange<Readonly<Record<string, unknown>>>[]Read-only sheet state made available to every range-highlight provider.
Extension point for range decorations such as formula precedents, search results, validation errors, collaboration selections, and audit trails.
key: stringgetHighlights(context: SheetHighlightContext): SheetRangeHighlight[]A visual-only cell range supplied by an independently registered provider.
Observable pipeline steps owned by the generic range-highlight host.
| Member | Value |
|---|---|
Refresh |
"sheet-highlight.refresh" |
| Member | Value |
|---|---|
CellRange |
"cellRange" |
ColumnRange |
"columnRange" |
RowRange |
"rowRange" |
Viewport-spanning overlay guide anchored to a cell-range edge.
| Member | Value |
|---|---|
Bottom |
"bottom" |
Left |
"left" |
Right |
"right" |
Top |
"top" |
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.getFormulaReferenceColor(referenceIndex: number, colors?: FormulaReferenceColorPalette): stringAssigns a formula reference its Excel-style, position-based palette color.
resolveReferenceHighlightBounds(reference: SheetReferenceHighlight, shape: {
colCount: number;
rowCount: number;
}): {
end: [number, number];
start: [number, number];
} | nullReadSheetFocusHighlightQuery: SheetQueryDefinition<void, boolean>Reads the highlighting preference used by the mounted sheet.
Sets the in-memory selection highlighting preference.
Runtime configuration for header highlighting.
These values are intentionally tuned for readability against default header colors.
columnHeaderHeight: numberLogical header height used for column-header overlay rectangles.
Emphasis line thickness in px (the blue bar facing the grid).
headerHighlightActiveBorderColor: stringEmphasis line color (the blue bar facing the grid).
headerHighlightBackgroundColor: stringHeader highlight background color: slightly darkened neutral gray (no blue tint).
headerHighlightBorderColor: stringHeader highlight separator color must be one step darker than
headerHighlightBackgroundColor, otherwise row/column separators can visually disappear.
The default header border (rgba(220,221,229,1)) differs from the highlight background
by only 1-2 color levels, which is often not enough contrast in highlighted areas.
This value intentionally uses a darker neutral gray for clearer separation.
Highlight behavior mode.
class CheckboxCell extends Cell<CellProperties<boolean>>Renders a centered symbol while leaving the rest of the cell available for selection.
CheckboxCell(data: CellProperties, positionRect: PositionRectProps, properties: CellProperties, context?: CellContext): CheckboxCellgetDisplayText(): stringPreserves boolean editor, auto-size and plain-text semantics.
render(): FixBoxNode<CellProperties<boolean>>Creates a glyph only for well-formed boolean values.
class CheckboxGlyphNode extends FixBoxNode<CellProperties<boolean>>Portable checkbox symbol; its own bounds are the pointer hit region.
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.
propsPartial properties and position for initialization.
drawScene(context: RenderContext, _clip?: ClipRegion): voidPaints the symbol using paths supported by every render adapter.
Stable semantic state roles used by checkbox render targets and diagnostics.
readonly Checked: "checked"readonly Unchecked: "unchecked"Manages the cursor blink timer and visibility state for the cell editor.
Calls the provided onTick callback each time the blink phase toggles,
allowing the caller to schedule a rerender.
EditorCursorBlinker(platform: Platform, onTick: (): void): EditorCursorBlinkervisible: booleanWhether the cursor bar should be drawn in the current frame.
ReadSheetZoomQuery: SheetQueryDefinition<void, number>Reads the active editor's local view scale.
Command that updates local sheet view zoom; input is the next zoom scale.
Publishes changes to the active editor's local view scale.
maxScale: numberminScale: numberstep: numberStable session-state identity owned by SheetZoomView.
numericValidationControlValueAt(control: NumericValidationControl, bounds: {
readonly height: number;
readonly width: number;
readonly x: number;
readonly y: number;
}, x: number, y: number): number | nullregisterSheetFilterVisuals(registry: SheetCellVisualReaderRegistry, source: Pick<SheetFilterPlugin, "isHeaderCell">): (): voidAdds header affordances from a semantic filter-header query.
class SheetCellMergeRender extends ViewExtensionBase<SearCoreSheet, CellProperties>Renders merged ranges owned by SheetCellMergePlugin.
SheetCellMergeRender(cellVisualReaders: SheetCellVisualReaderRegistry): SheetCellMergeRenderreadonly depth: 1Orders scene contributions; lower values are drawn first.
getConfig(searCore: SearCoreSheet): { defaultBorderColor: string }onMouseDown(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): voidonMouseMove(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): voidonMouseUp(_searCore: SearCoreSheet, _event: EventWithOffsetAndTarget<CellProperties>): voidregisterConfig(): {
config: ConfigUnit<{ defaultBorderColor: string }>;
key: OwnerKey;
}[]Default display configuration contributions for this view.
render(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}): Node<CellProperties>[]class SheetGridRender extends ViewExtensionBase<SearCoreSheet, CellProperties>Renders visible sheet body cells.
SheetGridRender(cellVisualReaders: SheetCellVisualReaderRegistry): SheetGridRenderConstructs the body grid renderer.
getConfig(searCore: SearCoreSheet): {
defaultBackgroundColor: string;
defaultBorderColor: string;
}Reads the body grid render configuration from ConfigEngine.
onDblClick(searCore: SearCoreSheet, event: EventWithOffsetAndTarget<CellProperties>): voidHandles double-click interactions on grid cells.
registerConfig(): {
config: ConfigUnit<{
defaultBackgroundColor: string;
defaultBorderColor: string;
}>;
key: OwnerKey;
}[]Registers default body grid configuration.
render(searCore: SearCoreSheet, offset?: {
x: number;
y: number;
}, previous?: readonly Node<CellProperties>[]): Node<CellProperties>[]Renders visible grid cells, skipping cells covered by merged ranges.
ReturnsRender nodes for visible body cells.
searCoreSheet core containing data and render services.
offsetOffset after accounting for row/column headers.
static readonly symbol: symbolDI token for resolving the body grid renderer.
Explicit layout inputs required to convert a sheet range to canvas coordinates.
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.
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.
Browser implementations of SearSuite platform, rendering, input, text, and transport contracts.
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.
addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): voidRegisters a host event listener and returns an idempotent disposer.
cancelAnimationFrame(handle: number): voidCancels a previously scheduled host animation frame.
clearInterval(handle: number): voidCancels a repeating host timer.
clearTimeout(handle: number): voidCancels a one-shot host timer.
createId(prefix?: string): stringCreates a Web-platform client/runtime identifier.
currentDateTime(): numberReturns the host wall-clock time as Unix milliseconds.
now(): numberReturns the host's monotonic time in milliseconds.
observeResize(target: unknown, callback: (size: {
height: number;
width: number;
}): void): (): voidObserves host-view size changes and returns an idempotent disposer.
queueMicrotask(callback: (): void): voidSchedules a callback in the host microtask queue.
readViewOffset(target: unknown): PlatformViewOffsetReads an element's document-relative viewport offset.
requestAnimationFrame(callback: PlatformFrameRequestCallback): numberSchedules a callback for the next host animation frame.
setInterval(callback: (): void, ms: number): numberUpdates the interval.
setTimeout(callback: (): void, ms: number): numberUpdates the timeout.
warn(message: string, ...details: unknown[]): voidReports a non-fatal diagnostic through the host warning channel.
static readonly symbol: symbolDI token for resolving BrowserPlatform.
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.
WebCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebCanvasRenderContextConstructs a Canvas render context from a host canvas.
renderTargetHTMLCanvasElement supplied by the host adapter.
addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidRegisters a host pointer event listener on the canvas root.
addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
beginPath(): voidBegins a new path.
clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
clip(): voidClips future drawing to the active path.
Clones the backing canvas dimensions into a detached WebCanvasRenderContext.
closePath(): voidCloses the active path.
Creates a detached render context used by hit rendering.
Draws an image at its natural size.
fill(): voidFills the active path with the current fill style.
fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
getAttribute(name: string): stringReads a host-visible attribute from the backing target.
getImageData(x: number, y: number, width: number, height: number): {
data: [number, number, number, number][];
height: number;
width: number;
}Reads raster pixels from the target.
getLineWidth(): numberReturns the current stroke line width.
getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
getRasterScale(): numberReturns the host-view to raster scale, excluding logical sheet zoom.
getRenderTarget(): HTMLCanvasElementReturns the native backing target owned by this render context.
getRoot(): HTMLCanvasElementReturns the event root associated with this render context.
getViewScale(): numberReturns the logical view scale.
initialize(scale: number): voidInitializes canvas sizing and marks the canvas with the shared render-context token.
scaleDevice pixel ratio used for backing-store dimensions.
lineTo(x: number, y: number): voidAdds a line from the current path cursor.
measureText(text: string): {
fontAscent?: number;
fontDescent?: number;
height: number;
width: number;
}Measures text using the active font and returns normalized metrics.
moveTo(x: number, y: number): voidMoves the active path cursor.
putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raw pixel data to the backing context.
imageDataCompact image data shape used by RenderContext.
xRaster x-coordinate.
yRaster y-coordinate.
rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
removeResizeListener(): voidRemoves the active resize listener, if any.
resetTransform(): voidResets the current transform to the identity transform.
resize(width: number, height: number, scale?: number): voidResizes the canvas backing store for a logical host viewport.
widthHost-view width.
heightHost-view height.
scaleRaster scale to apply to the backing store.
restore(): voidRestores the most recently saved drawing state.
save(): voidSaves the current drawing state.
setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
setFont(font: string): voidSets the active platform-neutral font descriptor.
setLineDash(segments: number[]): voidSets the current line dash pattern.
setLineWidth(width: number): voidSets the current stroke line width.
setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
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.
setViewScale(scale: number): voidUpdates the logical view scale used by sheet zoom.
scaleNew view scale.
stroke(): voidStrokes the active path with the current stroke style.
strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
supportsCachedOverlayRedraw(): booleanCanvas2D preserves a clip across the sticky and overlay drawing passes.
translate(x: number, y: number): voidTranslates the current drawing transform.
static readonly symbol: symbolDI token for resolving the visible canvas render context.
class WebCursorEngine extends CursorEngineBrowser CSS cursor implementation. Maps CursorToken to CSS cursor values (including SVG data URI custom cursors).
apply(token: CursorToken): voidApplies a transaction to WebCursorEngine state.
mount(target: unknown): voidAttaches this adapter to its host surface.
override(token: CursorToken | null): voidApplies a temporary host cursor override.
registerToken(token: string, cssCursor: string): voidAllow third parties to extend or override Token → CSS mapping.
unmount(): voidDetaches this adapter from its host surface.
class WebEventRegistrar extends EventRegistrarBrowser event registrar with the built-in mouse event surface enabled.
registeredEvents: string[]Normalized mouse events supported by the browser registrar.
class WebFetchServiceClient extends WebServiceClientBrowser fetch adapter. CORS and host security policy remain browser-owned concerns.
request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>Performs one request; callers own caching, cancellation, and invalidation.
static readonly symbol: symbolDI token for resolving the editor-local web-service adapter.
class WebFileDownload extends FileDownloadWeb file-save adapter; native elements and object URLs never enter the neutral contract.
WebFileDownload(platform: Platform): WebFileDownloadReceives the owning host's timer adapter explicitly.
destroy(): voidCancels pending release callbacks and revokes every retained object URL.
download(request: FileDownloadRequest): voidInitiates a native file save and tracks its delayed resource release.
class WebHitCanvasRenderContext extends WebCanvasRenderContextCanvas render context specialization for the hit-test layer.
WebHitCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebHitCanvasRenderContextConstructs a Canvas render context from a host canvas.
renderTargetHTMLCanvasElement supplied by the host adapter.
static readonly symbol: symbolDI token for resolving the hit canvas context.
Inherited from WebCanvasRenderContext.
class WebKeyboardRouter extends KeyboardRouterBrowser implementation of KeyboardRouter.
Attaches a keydown listener to the injected EventTarget in the capture
phase so that keyboard shortcuts are intercepted before any bubbling-phase
handler can act on them, and – critically – regardless of which DOM element
holds editor focus at the time. Native host form controls retain their own keys. This means shortcuts like Ctrl+A remain functional
even after a canvas click has shifted browser focus away from the hidden
<input> used for IME composition.
The EventTarget (typically document) is injected via DI using
WebKeyboardRouter.eventTargetSymbol, keeping this class free of hard-coded
browser globals and making it straightforward to test with a stub.
The listener is active only between startListener() / stopListener().
WebKeyboardRouter(eventTarget: EventTarget): WebKeyboardRouterstartListener(): voidStarts listening to the host input source.
stopListener(): voidStops listening to the host input source.
subscribe(handlers: KeyboardRouterHandlers): (): voidInstalls handlers; implementations may return a disposer that restores the previous handlers.
static readonly eventTargetSymbol: symbolDI token for the keyboard event source, normally document.
class WebOffScreenCanvasRenderContext extends WebCanvasRenderContextCanvas render context specialization for scroll optimization buffers.
WebOffScreenCanvasRenderContext(renderTarget: unknown, readbackOptimized?: boolean, platform?: Platform): WebOffScreenCanvasRenderContextConstructs a Canvas render context from a host canvas.
renderTargetHTMLCanvasElement supplied by the host adapter.
static readonly symbol: symbolDI token for resolving the off-screen canvas context.
Inherited from WebCanvasRenderContext.
class WebPointerCapture extends PointerCaptureBrowser pointer capture adapter that emits render-root view coordinates.
WebPointerCapture(renderContext: RenderContext, platform: Platform, eventTarget: unknown): WebPointerCaptureCreates one editor-local browser pointer capture adapter.
start(handlers: PointerCaptureHandlers): (): voidStarts one capture session and returns a disposer for that session.
stop(): voidStops the active session without invoking its release callback.
static readonly eventTargetSymbol: symbolDI token for the host-wide event source, normally document.
class WebRenderContext extends RenderContextExperimental Web-backed render context used for element-based rendering experiments.
WebRenderContext(container: HTMLDivElement, platform?: Platform): WebRenderContextCreates a Web render context attached to the provided container.
addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
addResizeListener(): voidAttaches a resize listener for host target size changes.
beginPath(): voidClear timing
clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
clip(): voidClips future drawing to the active path.
Creates a same-kind render context for an auxiliary render layer.
closePath(): voidCloses the active path.
Creates a same-kind render context configured for hit testing.
Draws an image at its natural size.
fill(): voidFills the active path with the current fill style.
fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
getAttribute(name: string): stringReads a host-visible attribute from the backing target.
getImageData(x: number, y: number, width: number, height: number): {
data: [number, number, number, number][];
height: number;
width: number;
}Reads raster pixels from the target.
getLineWidth(): numberReturns the current stroke line width.
getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
getRasterScale(): numberRaster units represented by one host-view unit for this context.
getRenderTarget(): unknownReturns the native backing target owned by this render context.
getRoot(): HTMLDivElementReturns the event root associated with this render context.
getViewScale(): numberReturns the current logical view scale.
initialize(): voidInitializes target sizing and adapter-specific state.
lineTo(x: number, y: number): voidAdds a line from the current path cursor.
measureText(text: string): {
height: number;
width: number;
}Measures text using the active font and returns normalized metrics.
moveTo(x: number, y: number): voidMoves the active path cursor.
putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
removeResizeListener(): voidRemoves the active resize listener, if any.
resetTransform(): voidResets the current transform to the identity transform.
resize(): voidResizes the backing render target to the host view's logical size and raster scale.
restore(): voidRestores the most recently saved drawing state.
save(): voidSaves the current drawing state.
setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
setFont(font: string): voidSets the active platform-neutral font descriptor.
setLineDash(segments: number[]): voidSets the current line dash pattern.
setLineWidth(width: number): voidSets the current stroke line width.
setStrokeStyle(strokeStyle: string): voidSets the current stroke style.
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
setViewScale(_scale: number): voidLogical view scale (distinct from device pixel ratio).
stroke(): voidStrokes the active path with the current stroke style.
strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
translate(x: number, y: number): voidTranslates the current drawing transform.
static readonly symbol: symbolDI token for resolving the Web render context.
class WebScroller extends ScrollerAdapts a Web scroll surface to logical editor viewport coordinates.
WebScroller(target: unknown, platform: Platform): WebScrollerroot: HTMLElementThe host element that owns the scroll surface.
configureAxisLock(config: Partial<ScrollAxisLockConfig>): voidEnables or tunes Safari-style dominant-axis locking for wheel and touch gestures.
configureRubberBand(config: Partial<RubberBandConfig>): voidEnables or tunes the Safari-style overscroll effect. Logical editor coordinates remain clamped; only the visible surface moves.
getPublisher(): (scrollStateInstance: ScrollManager, updateState: (newState: ScrollManagerState): void): (): voidReturns the publisher.
static readonly symbol: symbolDI token for resolving WebScroller.
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.
connect(options: CollaborationTransportConnectOptions): Promise<void>Opens the collaboration transport and begins receiving messages.
disconnect(): voidCloses the collaboration transport and releases its listeners.
send(message: CollaborationSubmission): voidSends one encoded collaboration message through the transport.
subscribe(handler: (message: CollaborationServerMessage): void): (): voidSubscribes to parsed server messages.
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.
WebSvgRenderContext(root: unknown, platform?: Platform): WebSvgRenderContextCreates an SVG render context with a detached raster mirror for Canvas-only APIs.
rootSVG element that receives retained draw output.
platformOptional platform diagnostics adapter.
addClickEventListener(callBack: (event: EventWithOffset): void): voidAttaches a click listener.
addEventListener(type: string, callBack: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
addMouseDownEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
addMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
addMouseUpEventListener(callBack: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
addResizeListener(callBack: (): void): voidAttaches a resize listener for host target size changes.
beginFrame(): voidReplaces retained SVG output before a full shared-engine render pass.
beginNodeSemantics(semantics: RenderNodeSemantics): voidMarks subsequent drawing operations as belonging to one semantic scene node.
beginPath(): voidBegins a new path.
clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
clip(): voidClips future drawing to the active path.
Creates a same-kind render context for an auxiliary render layer.
closePath(): voidCloses the active path.
Creates a same-kind render context configured for hit testing.
Draws an image at its natural size.
endNodeSemantics(): voidEnds the semantic scene-node boundary started by beginNodeSemantics.
fill(): voidFills the active path with the current fill style.
fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
getAttribute(name: string): stringReads a host-visible attribute from the backing target.
getImageData(x: number, y: number, width: number, height: number): {
data: [number, number, number, number][];
height: number;
width: number;
}Reads raster pixels from the target.
getLineWidth(): numberReturns the current stroke line width.
getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
getRasterScale(): numberRaster units represented by one host-view unit for this context.
getRenderTarget(): SVGSVGElementReturns the native backing target owned by this render context.
getRoot(): SVGSVGElementReturns the event root associated with this render context.
getViewScale(): numberReturns the current logical view scale.
initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
lineTo(x: number, y: number): voidAdds a line from the current path cursor.
measureText(text: string): {
fontAscent?: number;
fontDescent?: number;
height: number;
width: number;
}Measures text using the active font and returns normalized metrics.
moveTo(x: number, y: number): voidMoves the active path cursor.
putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
removeClickEventListener(callBack: (event: EventWithOffset): void): voidRemoves a click listener.
removeMouseDownEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-press listener.
removeMouseMoveEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-move listener.
removeMouseUpEventListener(callBack: (event: EventWithOffset): void): voidRemoves a pointer-release listener.
removeResizeListener(): voidRemoves the active resize listener, if any.
requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
resetHitFrame(_width: number, _height: number): voidResets the complete hit-test frame using the target's native lifecycle.
resetTransform(): voidResets the current transform to the identity transform.
resize(width: number, height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
restore(): voidRestores the most recently saved drawing state.
save(): voidSaves the current drawing state.
setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
setFont(font: string): voidSets the active platform-neutral font descriptor.
setLineDash(segments: number[]): voidSets the current line dash pattern.
setLineWidth(width: number): voidSets the current stroke line width.
setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
stroke(): voidStrokes the active path with the current stroke style.
strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
translate(x: number, y: number): voidTranslates the current drawing transform.
static readonly symbol: symbolDI token for resolving the SVG render context.
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 to
WebKeyboardRouter so that those shortcuts remain functional even when
browser focus shifts away from this element (e.g. after a canvas click).
The hidden input must still hold focus during active editing so that the OS
IME candidate window is anchored to it. Call refocus() whenever a
pointer event inside the editor area moves focus elsewhere.
onCut?: (): string | nullonDelete?: (): voidHandles the delete lifecycle event.
onPaste?: (text: string): booleanonTextInput?: (event: TextInputEvent): voidHandles the input lifecycle event.
refocus(): voidRestore focus to the hidden input (e.g. after a canvas click moves focus away).
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.
startListener(): voidStarts forwarding host text and composition events.
stopListener(): voidStops forwarding host text and composition events.
subscribe(handlers: TextInputHandlers): voidSubscribes to state changes and returns an idempotent disposer.
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 leaving glyphs empty.
Call clearCache() after an asynchronously loaded font becomes available.
WebTextShaper(context: WebTextShaperContext): WebTextShaperCreates a Web text shaper over a host-owned Canvas2D context.
class WebTextShaperError extends SearErrorError raised when a Web text-shaping request cannot be represented by Canvas2D.
WebTextShaperError(message: string, details?: SearErrorDetails): WebTextShaperErrorCreates a Web text-shaper error with stable diagnostics.
readonly code: "WEB_TEXT_SHAPER_ERROR"Stable machine-readable identifier for this error category.
class WebUserInteractionService extends UserInteractionServiceBrowser dialog adapter for explicit user confirmations.
WebUserInteractionService(documentRef?: Pick<Document, "body" | "createElement">): WebUserInteractionServiceconfirm(request: UserConfirmationRequest): Promise<boolean>Resolves true only when the user explicitly confirms.
destroy(): voidCancels pending requests and releases host resources.
class WebWebGLRenderContext extends RenderContextNative WebGL implementation of the platform-neutral RenderContext.
Geometry, images, and shaped text quads are submitted directly to GPU buffers. Canvas2D is used only to measure text and rasterize complete runs into texture atlases; it never receives scene or complete-frame drawing.
const context = new WebWebGLRenderContext(canvas, platform);
context.initialize(window.devicePixelRatio);WebWebGLRenderContext(renderTarget: unknown, platform?: Platform): WebWebGLRenderContextaddClickEventListener(callback: (event: EventWithOffset): void): voidAttaches a click listener.
addEventListener(type: string, callback: (event: EventWithOffset): void): (): voidAttaches a normalized event listener and returns an idempotent disposer.
addMouseDownEventListener(callback: (event: EventWithOffset): void): voidAttaches a pointer-press listener.
addMouseMoveEventListener(callback: (event: EventWithOffset): void): voidAttaches a pointer-move listener.
addMouseUpEventListener(callback: (event: EventWithOffset): void): voidAttaches a pointer-release listener.
addResizeListener(callback: (): void): voidAttaches a resize listener for host target size changes.
beginFrame(): voidStarts a new render frame when the target rebuilds its visual state.
beginPath(): voidBegins a new path.
clearRect(x: number, y: number, width: number, height: number): voidClears a rectangle from the target.
clip(): voidClips future drawing to the active path.
Creates a same-kind render context for an auxiliary render layer.
closePath(): voidCloses the active path.
Creates a same-kind render context configured for hit testing.
Draws an image at its natural size.
fill(): voidFills the active path with the current fill style.
fillText(text: string, x: number, y: number, maxWidth?: number): voidDraws text at the given position.
getAttribute(name: string): stringReads a host-visible attribute from the backing target.
getImageData(x: number, y: number, width: number, height: number): RenderImageDataReads raster pixels from the target.
getLineWidth(): numberReturns the current stroke line width.
getMaxLineWidth(): numberReturns the largest stroke width tracked for erase padding.
getRasterScale(): numberRaster units represented by one host-view unit for this context.
getRenderTarget(): HTMLCanvasElementReturns the native backing target owned by this render context.
getRoot(): HTMLCanvasElementReturns the event root associated with this render context.
getViewScale(): numberReturns the current logical view scale.
initialize(scale?: number): voidInitializes target sizing and adapter-specific state.
lineTo(x: number, y: number): voidAdds a line from the current path cursor.
measureText(text: string): {
fontAscent?: number;
fontDescent?: number;
fontLineGap?: number;
height: number;
width: number;
}Measures text using the active font and returns normalized metrics.
moveTo(x: number, y: number): voidMoves the active path cursor.
putImageData(imageData: RenderImageData, x: number, y: number): voidWrites raster pixels to the target.
rect(x: number, y: number, width: number, height: number): voidAdds a rectangle to the active path.
removeClickEventListener(): voidRemoves a click listener.
removeMouseDownEventListener(): voidRemoves a pointer-press listener.
removeMouseMoveEventListener(): voidRemoves a pointer-move listener.
removeMouseUpEventListener(): voidRemoves a pointer-release listener.
removeResizeListener(): voidRemoves the active resize listener, if any.
requiresExplicitNodeClear(): booleanWhether an existing node must erase its prior output before it is redrawn.
requiresFrameRebuild(): booleanWhether the target must rebuild a complete visual frame instead of reusing a pixel cache.
resetTransform(): voidResets the current transform to the identity transform.
resize(width: number, height: number, scale?: number): voidResizes the backing render target to the host view's logical size and raster scale.
restore(): voidRestores the most recently saved drawing state.
save(): voidSaves the current drawing state.
setAttribute(name: string, value: string): voidSets a host-visible attribute on the backing target.
setFillStyle(fillStyle: RenderPaint): voidSets the current fill style.
setFont(font: string): voidSets the active platform-neutral font descriptor.
setLineDash(segments: number[]): voidSets the current line dash pattern.
setLineWidth(width: number): voidSets the current stroke line width.
setStrokeStyle(strokeStyle: RenderPaint): voidSets the current stroke style.
setTransform(a: number, b: number, c: number, d: number, e: number, f: number): voidReplaces the current transform matrix.
setViewScale(scale: number): voidLogical view scale (distinct from device pixel ratio).
stroke(): voidStrokes the active path with the current stroke style.
strokeRect(x: number, y: number, width: number, height: number): voidStrokes a rectangle without requiring a separate path.
supportsDirtyRedraw(): booleanWhether the target can apply a redraw to only its accumulated dirty regions.
translate(x: number, y: number): voidTranslates the current drawing transform.
static readonly symbol: symbolDI token for the primary visible render layer.
class WebXmlDocumentParser extends XmlDocumentParserBrowser XML parser backed by the native DOMParser.
parse(xml: string): Documentstatic readonly symbol: symbolclass WebXmlXPathEngine extends XmlXPathEngineBrowser XPath engine backed by the native XPathEvaluator.
evaluate(document: unknown, xpath: string, options: XmlXPathOptions): XmlXPathEvaluationstatic readonly symbol: symbolclass WebXmlXPathEvaluator extends XmlXPathEvaluatorBrowser-native XML/XPath evaluator for standalone use.
static readonly symbol: symbolDI token for resolving the editor-local XML/XPath adapter.
Native text settings and operations required by the Web adapter.
createWebTextShaperContext(renderContext: RenderContext): WebTextShaperContextAdapts the shared render context to the Web shaper contract.
Node implementations of SearSuite platform timing and web-service contracts.
class NodePlatform extends PlatformPlatform adapter for Node environments without a UI surface.
addEventListener(_target: unknown, _type: string, _listener: (event: unknown): void): (): voidRegisters a host event listener and returns an idempotent disposer.
cancelAnimationFrame(handle: number): voidCancels a previously scheduled host animation frame.
clearInterval(handle: number): voidCancels a repeating host timer.
clearTimeout(handle: number): voidCancels a one-shot host timer.
createId(prefix?: string): stringCreates a deterministic process-local runtime identifier.
currentDateTime(): numberReturns the host wall-clock time as Unix milliseconds.
now(): numberReturns the host's monotonic time in milliseconds.
observeResize(_target: unknown, _callback: (size: {
height: number;
width: number;
}): void): (): voidObserves host-view size changes and returns an idempotent disposer.
queueMicrotask(callback: (): void): voidSchedules a callback in the host microtask queue.
readViewOffset(_target: unknown): PlatformViewOffsetHeadless targets have no host-space offset.
requestAnimationFrame(callback: PlatformFrameRequestCallback): numberSchedules a callback for the next host animation frame.
setInterval(callback: (): void, ms: number): numberUpdates the interval.
setTimeout(callback: (): void, ms: number): numberUpdates the timeout.
warn(message: string, ...details: unknown[]): voidReports a non-fatal diagnostic through the host warning channel.
static readonly symbol: symbolDI token for resolving NodePlatform.
class NodeWebServiceClient extends WebServiceClientNode/headless fetch adapter. Hosts remain responsible for SSRF and network policy.
request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>Performs one request; callers own caching, cancellation, and invalidation.
static readonly symbol: symbolDI token for resolving the editor-local web-service adapter.
Small dependency-free values and contracts shared across SearSuite packages.
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:
root: IQuadTreeNode<T>The root node of the quadtree.
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.
pointThe 2D coordinates where the value should be stored.
valueThe data to associate with this point.
query(range: {
height: number;
width: number;
x: number;
y: number;
}): NodeData<T>[]Queries all values within a rectangular range.
ReturnsArray of all data entries found within the range.
rangeThe query rectangle (x, y, width, height).
remove(point: Point): booleanRemoves a point and its associated value from the quadtree.
Returnstrue if point was found and removed, false if not found.
pointThe exact coordinates of the point to remove.
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:
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).
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.
boundaryThe rectangular area this node covers.
capacityMaximum points before node subdivides (typically 4).
boundary: {
height: number;
width: number;
x: number;
y: number;
}The rectangular boundary of this node in 2D space.
capacity: numberMaximum number of points this node can hold before subdividing.
divided: booleanFlag indicating whether this node has been subdivided into children.
northeast: IQuadTreeNode<T> | nullNortheast child node (upper-right quadrant).
northwest: IQuadTreeNode<T> | nullNorthwest child node (upper-left quadrant).
points: NodeData<T>[]Array of data points stored in this node (before subdivision).
southeast: IQuadTreeNode<T> | nullSoutheast child node (lower-right quadrant).
southwest: IQuadTreeNode<T> | nullSouthwest child node (lower-left quadrant).
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).
boundaryThe rectangle to check against.
pointThe point to test.
insert(data: NodeData<T>): booleanInserts a data entry into the quadtree. The insertion process:
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.
dataThe point and value to insert.
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:
Returnstrue if the rectangles intersect, false otherwise.
aFirst rectangle.
bSecond rectangle.
query(range: {
height: number;
width: number;
x: number;
y: number;
}, found?: NodeData<T>[]): NodeData<T>[]Finds all data entries within a given rectangular range. This is the primary query operation for spatial lookups.
The query process:
This approach provides O(log N) average performance for sparse data.
ReturnsArray of all data entries found within the range.
rangeThe rectangular area to query.
foundAccumulator array (for recursion, default empty array).
remove(point: Point): booleanRemoves a data entry at the specified point coordinates.
The removal process:
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.
pointThe exact coordinates of the point to remove.
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:
SearKey class for generating unique identifiers within the Sear framework.
This class is primarily used for plugin identification and namespace management in the Sear document editing system. Each instance receives a uniquely generated key that prevents naming collisions even when multiple plugins with the same base name are loaded.
Use cases:
const key1 = new SearKey('plugin'); // Returns key='plugin#39;
const key2 = new SearKey('plugin'); // Returns key='plugin$1'
const key3 = new SearKey('plugin'); // Returns key='plugin$2'
const key4 = new SearKey('state'); // Returns key='state#39;key: stringThe unique key string generated for this instance. Format: '{baseName}#39; for the first instance, '{baseName}${count}' for subsequent ones.
interface CommandDefinition<Scope, Input, Result>Immutable command identity carrying its scope, input, and result types.
readonly [commandDefinitionTypes]: {
readonly input: Input;
readonly result: Result;
readonly scope: Scope;
}Compile-time types that distinguish commands even when their ids and payloads match.
readonly id: stringStable command id owned by the feature that defines it.
Common lifecycle event emitted by editor command buses.
readonly error?: unknownOriginal thrown value when command execution fails.
readonly id: stringStable id of the command being executed.
readonly phase: CommandExecutionPhasePhase represented by the event.
Availability of undo and redo actions for an editor.
Enumeration of built-in state names in the Sear framework.
These state names are reserved and used internally by the Sear document editing system to manage the core data structures and visual representations.
State Types:
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.
| Member | Value | Description |
|---|---|---|
COLUMN_SHAPE_STATE |
"COLUMN_SHAPE_STATE" |
State managing column dimensions and visual shape properties |
CORE_STATE |
"CORE_STATE" |
Core state managing the fundamental document structure and content |
ROW_SHAPE_STATE |
"ROW_SHAPE_STATE" |
State managing row dimensions and visual shape properties |
Enumeration of supported document types in the Sear suite.
The Sear suite is a comprehensive document editing and collaboration platform that supports multiple document formats, each with specific features and use cases.
Supported Types:
| Member | Value | Description |
|---|---|---|
SEAR_DOC |
1 |
General document type (text processor) |
SEAR_FLOW |
6 |
Flowchart and diagram document type |
SEAR_MIND |
5 |
Mind map document type for hierarchical visualization |
SEAR_SHEET |
2 |
Spreadsheet document type with cell-based data |
SEAR_SLIDE |
4 |
Slide presentation document type |
SEAR_TABLE |
3 |
Table document type for structured tabular data |
UNKNOWN |
0 |
Unknown or unspecified document type |
createKeyGenerator(): (name: string): stringCreates an independent generator of keys such as name$ and name$1.
defineCommand<Scope, Input, Result>(id: string): CommandDefinition<Scope, Input, Result>Creates an immutable command definition with compile-time types and a runtime id.
printNameAndVersion(name: string, version: string): voidExports the console logging utility for displaying plugin name and version.
import { printNameAndVersion } from '@searsuite/sear-foundation-common';\n *
// Display plugin info on initialization
printNameAndVersion('SearEditor', '1.2.3');
// Console output: \" SearEditor v1.2.3 \" with stylingnameThe name of the plugin or component (e.g., 'sear-editor', 'sear-table')
versionThe version string of the plugin (e.g., '1.0.0', '2.1.5-beta')
Stable lifecycle phases emitted by Sheet, Doc, and Workbook command buses.
readonly Completed: "completed"readonly Failed: "failed"readonly Started: "started"Editor-scoped dependency injection with explicit ownership and borrowed instances.
Editor-scoped registry for constructing and resolving dependencies.
A composition root binds tokens to classes, factories, or existing
instances, then resolves the services required by one editor. Singleton
bindings are cached within this container; prototype bindings create a new
value on each resolution. reset releases owned instances, while borrowed
instances remain the responsibility of their parent owner.
readonly types: Map<any, any>Registered dependency tokens owned by this container.
addDependency(parent: symbol, dependency: string | symbol): voidAdds the dependency.
createLazy<T>(identifier: string): (): TCreates the lazy.
destroy(): voiddispose(): voidgetDependency(): voidReturns the dependency.
getDependencyGraphText(): voidReturns the dependency graph text.
hasBinding(identifier: string | symbol): booleanReturns whether this container has an explicit local binding for an identifier.
hasSingleton(identifier: string | symbol): booleanReturns whether a singleton has already been materialized for an identifier.
Registers the value.
registerBorrowedInstance<T>(identifier: Identifier<T>, instance: T): voidBinds a parent-owned instance without acquiring its teardown responsibility.
registerFactory<T>(identifier: Identifier<T>, factory: FactoryFunction<T>, scope?: Scope): voidRegisters the factory.
registerInstance<T>(identifier: Identifier<T>, instance: T): voidRegisters the instance.
registerTypes(module: symbol, types: { [key: string]: symbol }): voidRegisters the types.
reset(): voidReleases created resources and removes every registration from this container.
resolve<T>(identifier: string | symbol): TResolves a dependency from this container and its parent scope.
Enumerates Scope values.
| Member | Value |
|---|---|
Prototype |
1 |
Singleton |
0 |
Inject(identifier: unknown): ParameterDecoratorRecords the DI token that should satisfy one constructor parameter.
ReturnsParameter decorator used on constructor arguments.
identifierToken registered in the DI container.
Injectable(): ClassDecoratorMarks a class as injectable by the DI container.
ReturnsClass decorator that records injectable metadata.
Metadata key storing constructor parameter injection tokens.
Metadata key that marks a class as resolvable by the DI container.
Structured public errors with stable codes and diagnostic details.
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 override code.
SearError(message: string, details?: SearErrorDetails, options?: ErrorOptions): SearErrorreadonly code: stringStable machine-readable identifier for this error category.
readonly details: SearErrorDetailsreport(): thisReports this error with a compact, styled console header and diagnostics.
Returning the error keeps throw new SearError(...).report() ergonomic.
type SearErrorDetails = Readonly<Record<string, unknown>>Machine-readable context attached to framework errors.
Portable keyboard key values, chords, and binding contracts.
Standard key values used by input adapters.
This is intentionally a platform-neutral package: it maps semantic key names to browser-standard values without handling DOM events itself.
| Member | Value |
|---|---|
ArrowDown |
"ArrowDown" |
ArrowLeft |
"ArrowLeft" |
ArrowRight |
"ArrowRight" |
ArrowUp |
"ArrowUp" |
Backspace |
"Backspace" |
Bold |
"b" |
Delete |
"Delete" |
End |
"End" |
Enter |
"Enter" |
Equal |
"=" |
Escape |
"Escape" |
Home |
"Home" |
Hyphen |
"-" |
Italic |
"i" |
Minus |
"_" |
Plus |
"+" |
Redo |
"y" |
SelectAll |
"a" |
Strikethrough |
"x" |
Tab |
"Tab" |
ToggleReference |
"F4" |
Underline |
"u" |
Undo |
"z" |
Zero |
"0" |
Injectable timing, events, view geometry, identifiers, and host diagnostics.
Platform is the injected contract for timing, events, view offsets, identifiers, and diagnostics. Reusable
packages depend on this contract so the same editor state and command logic can run in different hosts.
Browser and Node packages provide concrete implementations for their respective environments.
Use when: assembling an editor for a host or implementing a new host adapter. Supply one Platform instance to the editor-local composition root. Event listeners and timers acquired through it must be released when the editor is destroyed; a child editor must not dispose services borrowed from its parent.
File downloads, web requests, and XML evaluation are separate capabilities with abstract contracts and concrete Web or headless implementations. A feature receives the capability it needs; it does not read browser globals or choose the application's credentials, transport, and file-saving policy.
FileDownload illustrates the relationship: an export feature prepares data, while the host-provided adapter
decides how a file is saved. A headless host can use an unavailable implementation when saving is intentionally
unsupported. The document state does not change merely because a host performs this effect.
Host services used by editor code without depending on one runtime's globals.
An assembly receives a concrete implementation for frame scheduling, clocks, events, view coordinates, resize observation, and diagnostics. Web and non-Web hosts can provide these operations through the same contract; visual rendering is configured separately.
abstract addEventListener(target: unknown, type: string, listener: (event: unknown): void, options?: PlatformEventListenerOptions): (): voidAdds a platform event listener and returns its disposer.
abstract cancelAnimationFrame(handle: number): voidCancels a previously scheduled host animation frame.
abstract clearInterval(handle: number): voidCancels a repeating host timer.
abstract clearTimeout(handle: number): voidCancels a one-shot host timer.
abstract createId(prefix?: string): stringCreates a process- or session-unique identifier for runtime protocols.
abstract currentDateTime(): numberReturns the host wall-clock time as Unix milliseconds.
abstract now(): numberReturns the host's monotonic time in milliseconds.
abstract observeResize(target: unknown, callback: (size: {
height: number;
width: number;
}): void): (): voidObserves the CSS-pixel size of a platform render target.
abstract queueMicrotask(callback: (): void): voidSchedules a callback in the host microtask queue.
abstract readViewOffset(target: unknown): PlatformViewOffsetReads a render target's offset in host view coordinates.
abstract requestAnimationFrame(callback: PlatformFrameRequestCallback): numberSchedules a callback for the next host animation frame.
abstract setInterval(callback: (): void, ms: number): numberUpdates the interval.
abstract setTimeout(callback: (): void, ms: number): numberUpdates the timeout.
toLowerCase(value: string): stringConverts text to lowercase without consulting the host's locale.
abstract warn(message: string, ...details: unknown[]): voidReports a non-fatal platform warning.
static readonly symbol: symbolDI token for resolving Platform.
Event-routing options supported by host adapters.
readonly capture?: booleanReceives propagated events before target handlers can consume them.
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.
Canonical event names understood by platform event adapters.
readonly Click: "click"readonly MouseDown: "mousedown"readonly MouseMove: "mousemove"readonly MouseUp: "mouseup"Platform-neutral asynchronous HTTP boundary for service-backed formulas.
abstract request(url: string, options?: WebServiceRequestOptions): Promise<WebServiceResponse>Performs one request; callers own caching, cancellation, and invalidation.
static readonly symbol: symbolDI token for resolving the editor-local web-service adapter.
class WebServiceError extends SearErrorPublic error raised by a web-service adapter.
WebServiceError(message: string, details?: Readonly<Record<string, unknown>>): WebServiceErrorreadonly code: "WEB_SERVICE_REQUEST_FAILED"Stable machine-readable identifier for this error category.
Host-neutral request cancellation.
readonly cancelled: booleansubscribe(listener: (): void): (): voidreadonly cancellation?: WebServiceCancellationreadonly headers?: Readonly<Record<string, string>>Fully consumed response; platform-native response objects never escape an adapter.
| Member | Value |
|---|---|
RequestFailed |
"WEB_SERVICE_REQUEST_FAILED" |
isHttpWebServiceUrl(url: string): booleanValidates absolute HTTP(S) URL syntax without enforcing host-owned network access policy.
Parses XML into an opaque document understood by the paired XPath engine.
abstract parse(xml: string): unknownstatic readonly symbol: symbolQueries documents produced by the paired XML parser.
abstract evaluate(document: unknown, xpath: string, options: XmlXPathOptions): XmlXPathEvaluationstatic readonly symbol: symbolclass XmlXPathError extends SearErrorPublic failure raised by XML/XPath adapters.
XmlXPathError(code: XmlXPathErrorCode, message: string, details?: Readonly<Record<string, unknown>>): XmlXPathErrorPlatform-neutral XML/XPath execution boundary used by formula adapters.
XmlXPathEvaluator(parser: XmlDocumentParser, engine: XmlXPathEngine): XmlXPathEvaluatorevaluate(xml: string, xpath: string, options?: XmlXPathOptions): XmlXPathEvaluationEvaluates an XPath expression against one XML document.
static readonly symbol: symbolDI token for resolving the editor-local XML/XPath adapter.
Result values in document order; selected nodes contribute their string values.
readonly values: readonly string[]Explicit prefix bindings used by an XPath expression.
readonly namespaces?: Readonly<Record<string, string>>| Member | Value |
|---|---|
InvalidXml |
"XML_INVALID" |
InvalidXPath |
"XPATH_INVALID" |
UnsupportedResult |
"XPATH_UNSUPPORTED_RESULT" |
FileDownload lets an export feature request a download without owning browser APIs.
Replaceable host capability for saving generated files.
abstract destroy(): voidReleases pending host resources, idempotently.
abstract download(request: FileDownloadRequest): voidInitiates one host file save.
static readonly symbol: typeof symbolToken for host composition roots that register the capability through DI.
Host-neutral request to save an in-memory file.
Range primitives and normalization helpers used by Sheet and Doc domains.
Parses and represents an Excel-style rectangular range.
The public coordinates are one-based because the string format is A1-based, while column conversion delegates to the shared zero-based label utilities.
static columnToNumber(column: string): numberConverts an Excel-style column label to a one-based column number.
ReturnsOne-based column number.
columnColumn label such as A or AA.
static numberToColumn(number: number): stringConverts a one-based column number to an Excel-style label.
ReturnsColumn label such as A or AA.
numberOne-based column number.
Immutable rectangle geometry and intersection utilities.
class PositionRect<T>Represents a rectangle in absolute position space.
Unlike Rect, which models a grid range, this class stores an origin and a
size. It is typically used for layout calculations, collision checks, and
hit-testing in rendered space.
PositionRect<T>(x: number, y: number, width: number, height: number): PositionRect<T>Creates a positioned rectangle from its origin and size.
xHorizontal origin.
yVertical origin.
widthRectangle width.
heightRectangle height.
getBounds(): [number, number, number, number]Returns rectangle bounds as [left, right, top, bottom].
getPosition(): [number, number]Returns the rectangle origin as [x, y].
getSize(): [number, number]Returns the rectangle size as [width, height].
inRect(x: number, y: number): booleanChecks whether a point lies inside the rectangle, including its edges.
xHorizontal coordinate to test.
yVertical coordinate to test.
toJSON(): {
height: number;
key: T | undefined;
width: number;
x: number;
y: number;
}Serializes the rectangle and its optional key to a plain object.
updatePosition(newX: number, newY: number): voidMoves the rectangle without changing its size.
newXNew horizontal origin.
newYNew vertical origin.
static 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.
positionRect1The first rectangle.
positionRect2The second rectangle.
static intersection<U>(positionRect1: PositionRect<U>, positionRect2: PositionRect<U>): booleanReturns true when the two rectangles overlap with a non-zero area.
Edge-touching rectangles are treated as non-intersecting.
positionRect1The first rectangle.
positionRect2The second rectangle.
static merge<U>(rect1: PositionRect<U>, rect2: PositionRect<U>): PositionRect<U>Creates the smallest rectangle that covers both inputs.
rect1The first rectangle.
rect2The second rectangle.
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.
addCol(colIndex: number): thisExtends the range to the right when a column is inserted inside it.
colIndexInserted column index.
addRow(rowIndex: number): thisExtends the range downward when a row is inserted inside the current span.
rowIndexInserted row index.
Creates an independent copy of this value and its mutable data.
forEach(callbackfn: (rowIndex: number, colIndex: number, value: T): void): voidIterates through every covered cell and yields the stored value.
callbackfnCalled once for each covered cell.
getValue(rowIndex: number, colIndex: number): T | nullReturns the stored value when the requested cell lies inside the range.
rowIndexRow index to query.
colIndexColumn index to query.
removeCol(colIndex: number): thisContracts the range when a column is removed from inside it.
colIndexRemoved column index.
removeRow(rowIndex: number): thisContracts the range when a row is removed from inside the current span.
rowIndexRemoved row index.
toJSON(): {
rect: [number, number, number, number];
value: T;
}Serializes the range and its associated value.
Describes a rectangle in sheet coordinates.
The rectangle is stored as two corner points: the top-left point followed by the bottom-right point. The class provides helpers for iteration, structural updates after row or column mutations, and serialization.
addCol(colIndex: number): thisExpands or shifts the rectangle after a column insertion.
colIndexThe inserted column index.
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.
rowIndexThe inserted row index.
Creates an independent copy of this value and its mutable data.
forEach(callbackfn: (rowIndex: number, colIndex: number): void): voidIterates through every cell coordinate covered by the rectangle.
callbackfnCalled once for each (rowIndex, colIndex) pair.
Returns one of the stored corner points.
index0 for the start point, 1 for the end point.
lockMutations(): voidPrevents changes through methods or coordinates retained from a committed state.
removeCol(colIndex: number): thisShrinks or shifts the rectangle after a column removal.
colIndexThe removed column index.
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.
rowIndexThe removed row index.
toJSON(): { rect: [Point, Point] }Serializes the rectangle to a plain object.
Replaces the rectangle with a new set of bounds.
rectThe new rectangle coordinates.
Checks whether rectA fully contains rectB.
rectAThe outer candidate rectangle.
rectBThe inner candidate rectangle.
static findBoundingRectangle(rects: Rect[]): RectComputes the smallest rectangle that encloses all provided rectangles.
rectsThe rectangles to merge into a bounding box.
Plain-object shape of a rectangle in pixel or layout coordinates.
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.
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.
Zero-sized rectangle used as the default empty layout region.
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.
PositionRectManager<PositionRectKeyType>(): PositionRectManager<PositionRectKeyType>length: numberReturns the number of registered rectangles.
addPositionRect(positionRect: PositionRect<PositionRectKeyType>): voidRegisters a rectangle with the manager.
positionRectRectangle instance to track.
updatePosition(newX: number, newY: number): voidMoves every managed rectangle to the same new origin.
newXNew horizontal origin.
newYNew vertical origin.
class RangeRectManager<T>Stores multiple RangeRect instances and resolves a merged value for a cell.
The manager assumes each range contributes part of an object-like value. When a cell belongs to multiple ranges, the returned result is a shallow merge of all matching values in insertion order.
length: numberReturns the number of registered ranges.
Adds a range to the manager.
rangeRange definition to register.
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, null is returned.
rowRow index to query.
colColumn index to query.
toJSON(): {
rect: [number, number, number, number];
value: T;
}[]Serializes all ranges in insertion order.
A dedicated exported JSON type could be extracted later if multiple packages start depending on this exact payload shape.
Abstract key-value storage contracts and in-memory adapters.
class DataStorage<U, T, S>DataStorage public API.
DataStorage<U, T, S>(storage: S): DataStorage<U, T, S>static readonly symbol: symbolDI token for resolving DataStorage.
class DataStorageFactory<T>Factory contract for creating data storage instances.
abstract create(): TCreates the value.
class MapDataStorage<U, T> extends DataStorage<U, T, Map<U, T>>Map-backed DataStorage implementation.
MapDataStorage<U, T>(): MapDataStorage<U, T>class MapDataStorageFactory<U, T> extends DataStorageFactory<MapDataStorage<U, T>>MapDataStorageFactory public API.
create(): MapDataStorage<U, T>Creates the value.
Idempotent subscription ownership and reverse-order disposal utilities.
interface EventObservationDefinition<Value> extends ObservationDefinition<Value>Definition for an event-only observation stream.
readonly kind: "event"Event observations have no current snapshot.
interface ObservationDefinition<Value>Typed identity imported by publishers and consumers of one observation.
readonly id: stringStable globally unique id used for registration diagnostics.
readonly kind: ObservationKindDelivery model that determines whether a current snapshot is available.
readonly valueType?: ValueCompile-time value carrier; never populated at runtime.
interface StateObservationDefinition<Value> extends ObservationDefinition<Value>Definition for an observation stream backed by a current state snapshot.
readonly kind: "state"State observations expose a current snapshot.
Supported observation delivery models.
| Member | Value | Description |
|---|---|---|
Event |
"event" |
Stream with no current snapshot; subscribers receive only future events. |
State |
"state" |
Stream with a readable current snapshot plus future changes. |
defineEventObservation<Value>(id: string): EventObservationDefinition<Value>Creates a typed identity for an event-only observation stream.
defineStateObservation<Value>(id: string): StateObservationDefinition<Value>Creates a typed identity for a snapshot-backed state observation stream.
class ObservationError extends SearErrorPublic error raised when an observation definition or registry lifecycle contract is violated.
ObservationError(code: ObservationErrorCode, message: string, details?: SearErrorDetails): ObservationErrorCreates an observation contract error with structured diagnostic details.
readonly code: ObservationErrorCodeStable observation-specific error code.
Editor-local typed observation registry exposed to plugins and third-party hosts.
ObservationRegistry(platform?: Platform): ObservationRegistryCreates a registry that reports isolated host listener failures through the platform.
destroy(): voidDisposes every active host subscription and removes all registered sources.
enforceWriteBoundary(assertWrite: (): void, runListener?: ObservationListenerScope, detachValue?: (value: unknown, definition: ObservationDefinition<unknown>): unknown): voidRequires editor command dispatch for source registration changes after assembly.
getRegisteredObservations(): readonly ObservationDefinition<unknown>[]Returns a stable snapshot of registered observation definitions sorted by id.
getSnapshot<Value>(definition: StateObservationDefinition<Value>): ValueReturns the current snapshot for a state observation without subscribing.
has(definition: string | ObservationDefinition<unknown>): booleanReturns whether an observation id is registered in this editor instance.
register<Value>(definition: EventObservationDefinition<Value>, source: ObservationSource<Value>): (): void
register<Value>(definition: StateObservationDefinition<Value>, source: StateObservationSource<Value>): (): voidRegisters an event-only source and returns an idempotent registration disposer.
subscribe<Value>(definition: ObservationDefinition<Value>, listener: (value: Value): void): (): voidSubscribes to a typed observation and returns an idempotent disposer.
static readonly symbol: typeof symbolDI token for resolving the registry owned by one editor instance.
Owns cancellable subscriptions for one consumer instance.
It centralizes disposal so viewport, DPR, visibility, network, and other observers do not each need a dedicated cleanup field.
SubscriptionManager(platform: Platform): SubscriptionManagerdestroy(): voidReleases resources owned by SubscriptionManager.
observeResize(target: unknown, callback: (size: {
height: number;
width: number;
}): void): (): voidObserves host-view size changes and returns an idempotent disposer.
track(dispose: (): void): (): voidTracks an arbitrary subscription cleanup function and returns an idempotent disposer.
static readonly symbol: typeof symbolDI token for resolving SubscriptionManager.
interface ObservationSource<Value>Produces future values for an event or state observation.
subscribe(listener: (value: Value): void): (): voidRegisters a listener for future values and returns an idempotent disposer.
interface StateObservationSource<Value> extends ObservationSource<Value>Produces a current snapshot plus future values for a state observation.
getSnapshot(): ValueReturns the current immutable state snapshot.
Machine-readable observation error code.
| Member | Value |
|---|---|
InvalidDefinition |
"SEAR_OBSERVATION_INVALID_DEFINITION" |
AlreadyRegistered |
"SEAR_OBSERVATION_ALREADY_REGISTERED" |
NotRegistered |
"SEAR_OBSERVATION_NOT_REGISTERED" |
DefinitionMismatch |
"SEAR_OBSERVATION_DEFINITION_MISMATCH" |
SnapshotUnavailable |
"SEAR_OBSERVATION_SNAPSHOT_UNAVAILABLE" |
RegistryDestroyed |
"SEAR_OBSERVATION_REGISTRY_DESTROYED" |
Portable interaction-state contracts for host input and editor behavior.
Host-provided, editor-local requests for a user's decision.
abstract confirm(request: UserConfirmationRequest): Promise<boolean>Resolves true only when the user explicitly confirms.
abstract destroy(): voidCancels pending requests and releases host resources.
static readonly symbol: symbolA host-owned confirmation with explicit, localizable presentation text.
readonly cancelLabel: stringreadonly confirmLabel: stringreadonly message: stringreadonly title: stringGeneral-purpose algorithms and guards without editor-domain ownership.
Zero-based coordinates and absolute-axis markers in an A1 reference.
columnIndexToLabel(columnIndex: number): stringConverts a zero-based column index to an Excel-style label (A, Z, AA, ...).
columnIndexToLabel(0) // 'A'
columnIndexToLabel(26) // 'AA'columnLabelToIndex(label: string): numberConverts an Excel-style column label (A, Z, AA, ...) to a zero-based index.
columnLabelToIndex('A') // 0
columnLabelToIndex('AA') // 26parseCellRef(reference: string): ParsedCellRef | nullParses a complete A1 cell reference, returning null for invalid coordinates.
quoteWorkbookSheetName(name: string): stringFormats a sheet name for a formula reference, preserving the original characters.
type SpreadsheetWildcardToken = {
kind: "literal";
value: string;
} | { kind: "one" } | { kind: "many" }A literal or wildcard in an Excel-style text pattern.
escapeRegExp(value: string): stringEscapes text for use as a standalone literal in a regex pattern.
parseSpreadsheetWildcard(pattern: string): SpreadsheetWildcardToken[]Parses wildcards and tilde escapes, keeping regex flags and anchoring with the caller.
spreadsheetWildcardRegExpSource(pattern: string): stringBuilds a regex pattern source that also lets wildcards match line breaks.
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.
releaseColor(color: templateLiteral): booleanRelease a color back to the available pool
Standard opaque colors shared by renderers and host adapters.
readonly Black: "#000000"deepEqual(left: unknown, right: unknown): booleanCompares acyclic values; Map keys and Set members retain identity semantics.
isNonArrayObject(value: unknown): valueReports whether a value is a non-null, non-array object.
erf(value: number): numberEvaluates erf without the error floor of short polynomial approximations.
erfc(value: number): numberEvaluates erfc directly in the positive tail to preserve small probabilities.
gcd(left: number, right: number): numberComputes the non-negative greatest common divisor of two safe integers.
isFormulaError<T>(value: T): valueType guard for formula error-shaped values.
isFormulaText<T>(value: T): valueReturns whether a value carries text-specific formula coercion semantics.
toNumberOrError(value: unknown): number | {
code: "#VALUE!";
kind: "error";
}Converts a value for scalar arithmetic, returning an Excel #VALUE! error when invalid.
toNumberOrZero(value: unknown): numberConverts a formula value for aggregate functions; non-numeric values are 0.