← All packages

@searsuite/sear-assembly-core

Editor runtimes

SearCoreSheet coordinates Sheet plugins, the data registry, input events, and rendering. SearCoreDoc does the corresponding work for a rich document. Host applications normally create these through an editor assembly; a feature plugin meets the core through the plugin and command contracts.

A command produces a Pipeline. Its steps stage document transactions and local interaction changes, then commit them through the owning core. Render work follows the commit, so a failed step does not publish a partial document update.

classSearCoreSheet
class SearCoreSheet extends SearCore<SearCoreSheet, CellProperties, SheetRenderCoordinatorManager>

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

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

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

propertyconfigEngine: ConfigEngine

Configuration registry used by sheet plugins.

propertydataEngine: DataEngine

Data registry for plugin-owned sheet state.

propertyeventEngine: EventEngine<CellProperties>

Event pipeline and hit-testing facade for sheet interactions.

propertyreadonly pluginManager: PluginManager<SearCoreSheet, CellProperties>

Ordered plugin registry for this sheet runtime.

propertyrenderEngine: RenderEngine<CellProperties, SheetRenderCoordinatorManager>

Render pipeline facade for visible sheet scene updates.

methoddestroy(token?: object): void

Releases runtime controllers and their subscriptions owned by this sheet.

methodenforceCommandBoundary(isCommandExecuting: (): boolean): void

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

methodenforceTeardownBoundary(token: object): void

Reserves assembled runtime teardown for the owning editor facade.

methodexecutePipeline(pipeline: Pipeline): void

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

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

methodgetDataEngine(): SheetDataEngine

Returns the sheet data engine with sheet-specific helpers.

methodgetPlugin(pluginKey: PluginKey): unknown

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

methodgetRenderEngine(): RenderEngine<CellProperties, SheetRenderCoordinatorManager>

Returns the render engine bound to this sheet core.

methodgetStage(): SceneGraph<CellProperties>

Returns the scene graph used by render and event strategies.

methodinitialize(): void

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

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

Stages document transactions for a command without publishing their states.

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

Registers and initializes a plugin after core startup.

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

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

methodstart(): void

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

Inherited members 1

Inherited from SearCore.

classSearCoreDoc
class SearCoreDoc extends SearCore<SearCoreDoc, NodeProperties, unknown>

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

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

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

propertyeventEngine: EventEngine<NodeProperties> | null

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

propertyreadonly pluginManager: PluginManager<SearCoreDoc, NodeProperties>

Plugin manager for document runtime service plugins.

propertyrenderEngine: DocRenderEngine | null

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

propertyrenderStage: SceneGraph<NodeProperties> | null

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

propertyreadonly pluginManagerSymbol: symbolstatic

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

propertyreadonly runtimeLayersSymbol: symbolstatic

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

propertyreadonly symbol: symbolstatic

DI token for resolving SearCoreDoc.

methodbindDocRenderRequestHandler(handler: DocRenderRequestHandler): void

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

methodclearDocRenderRequests(): void

Clears diagnostic document render request history.

methoddestroy(ownerToken?: object): void

Releases standalone document runtime ownership held by Core.

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

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

methodenforceTeardownBoundary(ownerToken: object): void

Reserves assembled Doc Core cleanup for its editor facade.

methodexecutePipeline(pipeline: Pipeline): void

Executes document command work through the shared observable Pipeline contract.

methodexportSnapshot(document?: readonly RichDocNode[]): Schema[]

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

methodgetDocRenderLayoutState(): DocRenderLayoutState | null

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

methodgetDocRenderRequests(): readonly DocRenderRequest[]

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

methodgetLayoutSnapshot(): LayoutSnapshot | null

Returns the latest document layout snapshot prepared by Core.

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

Returns the plugin.

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

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

methodinitialize(): void

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

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

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

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

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

methodprepareEditorRenderLayout(input: DocEditorRenderLayoutInput): DocPreparedEditorRenderLayout

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

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

Registers the plugin.

methodrequestDocRender(pluginKey?: PluginKey): void

Requests a document render for plugin-owned render nodes.

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

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

methodsetDocRenderLayoutState(state: DocRenderLayoutState | null): void

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

methodstart(): void

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

methodunregisterPlugin(pluginKey: PluginKey): void

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

classSearCore
class SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>

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

classSearLifecycleError
class SearLifecycleError extends SearError

Error thrown for invalid sheet lifecycle transitions.

Inherited members 9

Inherited from SearError.

classSheetLifecycleCoordinator

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

constructorSheetLifecycleCoordinator(): SheetLifecycleCoordinator
propertyreadonly symbol: typeof symbolstatic

DI token for resolving SheetLifecycleCoordinator.

methodbeginTeardown(token: object): void

Permits cleanup only for the owning editor.

methoddestroy(): void

Releases resources owned by SheetLifecycleCoordinator.

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

Closes runtime registration after editor assembly.

methodregister(controller: SheetLifecycleController): (): void

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

methodstart(context: SheetLifecycleContext): void

Starts SheetLifecycleCoordinator.

interfaceSearCoreDocRuntimeLayers

Runtime layers owned by one SearCoreDoc instance.

propertyreadonly configEngine?: ConfigEngine<any> | null

Configuration layer used by standalone document hosts.

propertyreadonly eventEngine?: EventEngine<NodeProperties> | null

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

propertyreadonly platform?: Platform | null

Platform diagnostics adapter used by document core guard clauses.

propertyreadonly renderEngine?: DocRenderEngine | null

Render engine used by standalone document hosts.

propertyreadonly renderStage?: SceneGraph<NodeProperties> | null

Scene graph used by standalone document rendering.

interfaceSheetLifecycleContext

Shared context supplied to lifecycle controllers for one sheet instance.

interfaceSheetLifecycleController

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

Pipeline

PipelineStepKind.Transaction stages an OT transaction for the document. Interaction changes editor-local interaction state, while Render and PostRender request painting. 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 core runtime.

classPipeline

An observable, ordered conduit for state changes and renders.

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

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

Usage:

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

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

Creates a named pipeline for diagnostics and command results.

propertyreadonly dirtyRects: PositionRect<templateLiteral>[]

Dirty rectangles accumulated before the render phase.

propertyreadonly name: string
propertyreadonly steps: PipelineStep[]

Ordered steps that will be executed by the pipeline executor.

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

Append a transaction step (shorthand).

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

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

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

Append a local interaction-state transition.

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

Append a command-owned local action step.

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

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

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

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

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

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

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

Append a render-only step for the given plugin.

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

Append a transaction step.

methodemitComplete(rendered: boolean): void

Notify all hooks that the pipeline has completed.

methodemitStart(): void

Notify all hooks that the pipeline is starting.

methodemitStepComplete(step: PipelineStep): void

Notify all hooks that a step has completed.

methodemitStepStart(step: PipelineStep): void

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

methodmarkDirty(rect: PositionRect<templateLiteral>): this

Defers a dirty rectangle until the pipeline executor reaches render.

methoduse(hook: PipelineLifecycle): this

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

methodfromRender(name: string, pluginKey: PluginKey): Pipelinestatic

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

methodfromTransaction(name: string, transaction: Transaction): Pipelinestatic

Creates a pipeline containing one transaction step.

enumPipelineStepKind

Built-in pipeline step kinds understood by SearCoreSheet.

enum memberInteraction: "interaction"

Update local sheet interaction state; never synchronized through OT.

enum memberLocalAction: "local-action"

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

enum memberPostCommit: "post-commit"

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

enum memberPostRender: "post-render"

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

enum memberPreparedAction: "prepared-action"

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

enum memberRender: "render"

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

enum memberTransaction: "transaction"

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

classConsolePipelineLogger
class ConsolePipelineLogger extends PipelineLifecycle

Console logger middleware for Pipeline lifecycle events.

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

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

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

constructorConsolePipelineLogger(): ConsolePipelineLogger
methodonComplete(_pipeline: Pipeline, rendered: boolean): void

Handles the complete lifecycle event.

methodonStart(pipeline: Pipeline): void

Handles the start lifecycle event.

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

Handles the step complete lifecycle event.

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

Handles the step start lifecycle event.

classPipelineStepExecutorRegistry

Per-container registry of Pipeline step executors.

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

classSearContractViolationError
class SearContractViolationError extends SearError

Error thrown when an internal assembly contract is violated.

Inherited members 9

Inherited from SearError.

classSearPipelineStepExecutorNotFoundError
class SearPipelineStepExecutorNotFoundError extends SearError

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

Inherited members 9

Inherited from SearError.

classSearRegistryConflictError
class SearRegistryConflictError extends SearError

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

Inherited members 9

Inherited from SearError.

classSearRegistryEntryNotFoundError
class SearRegistryEntryNotFoundError extends SearError

Error thrown when a required registry entry is missing.

Inherited members 9

Inherited from SearError.

classSheetInteractionReducerRegistry

Extensible dispatch table for local interaction-state transitions.

interfacePipelineLifecycle

Observer hooks emitted while a pipeline executes.

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

Pipeline finished (all steps + render).

methodonStart(pipeline: Pipeline): void

Pipeline begins execution.

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

A single step has finished executing.

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

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

interfacePipelineStep

One ordered unit of work inside a pipeline.

propertydata?: unknown

Extension-owned payload for a custom step executor.

propertyinteraction?: SheetInteractionSignal

Local interaction transition for interaction steps.

propertykind: string

Built-in or extension-provided executor key.

propertylocalAction?: (): void

Command-owned action for local-action steps.

propertyname: string

Human-readable step name used by diagnostics.

propertypostCommit?: (): void

Deferred local state publication after document and interaction commits.

propertyprepare?: (): (): void

Local preparation that returns its rollback action.

propertyrenderPluginKey?: PluginKey

Plugin key to re-render for render steps.

propertytransaction?: Transaction<Operation>

Transaction payload for transaction steps.

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

Stable machine-readable error codes owned by assembly packages.

functiongetActiveCommandId
getActiveCommandId(): string | null
functiongetCommandObserverEpoch
getCommandObserverEpoch(): number

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

functionisInsideCommandExecution
isInsideCommandExecution(): boolean
functionlockCommittedSheetState
lockCommittedSheetState(state: unknown): void

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

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

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

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

Document input and layout

classDocCompositionManager
class DocCompositionManager extends DocCompositionProvider

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

constructorDocCompositionManager(textShaper: TextShaper): DocCompositionManager
propertyreadonly symbol: symbolstatic

DI token for resolving DocCompositionManager.

methodclear(teardownToken?: object): void

Clears all composing state.

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

Closes direct composition writes after editor assembly.

methodgetCaretOffset(): number

Returns the logical caret offset inside the composing text.

methodgetCaretPixelOffset(): number

Returns the latest measured caret pixel offset.

methodgetText(): string

Returns the current composing text.

methodmeasure(font?: string): DocCompositionLayout

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

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

Updates the active composing text and logical caret offset.

classDocCursorManager

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

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

DI token for resolving DocCursorManager.

methodclearCursor(teardownToken?: object): void

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

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

Seals assembled cursor writes while preserving command-owned rendering.

methodgetCursor(): CursorRenderInfo | null

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

methodgetSelectionRects(): SelectionRect[]

Read the selection highlight rectangles.

methodsetCursor(info: CursorRenderInfo): void

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

methodsetSelectionRects(rects: SelectionRect[]): void

Set selection highlight rectangles for the upcoming draw call.

classDocImmediateRenderPainter

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

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

Creates a painter over the document cursor and scroll services.

methoddrawContent(context: RenderContext, input: DocImmediateRenderPainterContentInput): void

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

methoddrawSelectionRectsInViewport(context: RenderContext): void

Draws selection rectangles in viewport coordinates under an identity transform.

methoddrawSelectionRectsInWorld(context: RenderContext): void

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

methoddrawTextCursorOverlayInViewport(context: RenderContext): void

Draws IME composing text and caret in viewport coordinates.

classDocInputPlugin
class DocInputPlugin extends Plugin<SearCoreDoc, NodeProperties, DocInputState>

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

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

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

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

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

propertyreadonly pluginKey: PluginKeystatic

Stable plugin key for document input state.

propertyreadonly symbol: symbolstatic

DI token for resolving the document input plugin.

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

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

methodclearSession(): void

Clears the current edit session state.

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

Builds a transaction for arrow-key cursor navigation.

methodcreateDeleteTransaction(): Transaction

Builds a transaction for Backspace deletion.

methodcreateInputTransaction(text: string): Transaction

Builds a transaction for committed text input.

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

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

methodcreateSelectAllTransaction(): Transaction

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

methodcreateSoftEnterTransaction(): Transaction

Builds a transaction for soft-enter paragraph splitting.

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

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

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

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

methodgetLastSnapshot(): LayoutSnapshot | null

Returns the derived layout snapshot used for vertical cursor movement.

methodgetPluginConfig(_searCore: SearCoreDoc): null

Document input has no plugin configuration.

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

Handles arrow-key cursor navigation.

methodhandleDelete(): DocInputDispatchResult

Handles Backspace deletion.

methodhandleInput(text: string): DocInputDispatchResult

Handles committed text input.

methodhandleSelectAll(): DocInputDispatchResult

Selects all content in the current document session.

methodhandleSoftEnter(): DocInputDispatchResult

Handles soft-enter paragraph splitting.

methodonTransactionCommitted(transaction: Transaction): void

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

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

Registers document input state under the plugin key.

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

Document input does not render scene nodes directly.

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

Replaces the current edit session document and selection.

methodrestoreSelection(selection: DocSelection): void

Replaces local selection during session restoration without changing document content.

methodsealSessionRestoration(): void

Closes the document initialization and session restoration phase.

methodsetLastSnapshot(snapshot: LayoutSnapshot | null): void

Stores the last layout snapshot for cursor navigation.

methodsubscribeDocument(listener: (): void): (): void

Subscribes to committed document projection changes.

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

Subscribes to committed selection projection changes.

Inherited members 27

Inherited from Plugin.

classDocRenderEngine
class DocRenderEngine extends RenderEngine<NodeProperties, RenderCoordinatorManager>

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

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

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

DI token for resolving DocRenderEngine.

methodgetLastScreenRenderMode(): ScreenRenderFrameMode | null

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

methodinitialize(): void

Initializes DocRenderEngine.

methodinvalidateScreenCache(): void

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

methodmarkDirty(rect: PositionRect<templateLiteral>): void

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

methodrender(node: Node<NodeProperties>): void

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

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

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

methodsetBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): void

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

methodsetViewport(viewport: DocRenderViewport): void

Updates the viewport model used by subsequent render frames.

methodsetViewScale(scale: number): void

Updates the view scale on every render strategy context.

Inherited members 5

Inherited from RenderEngine.

classNoopDocCompositionProvider
class NoopDocCompositionProvider extends DocCompositionProvider

Null provider used when no composition plugin is installed.

classSearDocParseError
class SearDocParseError extends SearError

Error thrown when document input cannot be parsed.

Inherited members 9

Inherited from SearError.

interfaceCursorRenderInfo

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

propertyheight: number

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

propertyvisible: boolean

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

propertyx: number

Absolute canvas X for the committed text caret.

propertyy: number

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

interfaceDocCompositionLayout

Layout contribution from an in-flight IME composition.

propertyreadonly active: boolean

Whether there is active composing text to render.

propertyreadonly caretPixelOffset: number

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

propertyreadonly text: string

Current in-flight composing text.

propertyreadonly textWidth: number

Full composing text width in pixels.

interfaceDocCompositionProvider

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

methodmeasure(font: string): DocCompositionLayout

Measures the active composing text against the current render font.

interfaceDocEditorRenderLayoutInput

Input used by SearCoreDoc to initialize one editable document frame.

propertyreadonly compositionProvider?: DocCompositionProvider

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

propertyreadonly cursorVisible?: boolean

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

propertyreadonly document: RichDocNode[]

Rich-document content to lay out and render.

propertyreadonly fitContentWidth?: boolean

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

propertyreadonly font?: string

Font descriptor used by the text shaper for this layout.

propertyreadonly minContentWidth?: number

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

propertyreadonly minHeight: number

Minimum editor height supplied by the host surface.

propertyreadonly minWidth: number

Minimum editor width supplied by the host surface.

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

Editor origin in world coordinates.

propertyreadonly padding?: number

Padding inside the editable frame.

propertyreadonly selection: DocSelection

Current document selection.

propertyreadonly verticalAlign?: DocVerticalAlign

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

interfaceDocImmediateRenderPainterContentInput

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

propertyreadonly blockIndexes?: readonly number[]

Optional block indexes to draw; omitted means all blocks.

propertyreadonly clipRect?: PositionRect<templateLiteral>

Optional world-coordinate clipping rectangle.

propertyreadonly font?: string

Base font selected by the host for this document frame.

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

Content origin in world coordinates.

propertyreadonly snapshot: LayoutSnapshot

Layout snapshot whose lines are relative to the content origin.

interfaceDocInputDispatchResult

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

propertyreadonly contentChanged: boolean

Whether the command produced document OT operations.

propertyreadonly selection: DocSelection

Selection after all command steps have been applied and mapped.

propertyreadonly selectionOnly: boolean

Whether the command only changed selection/caret state.

interfaceDocInputState

State for an active rich-document input session.

propertydocSelection: DocSelection

Current rich-document selection.

propertypendingDoc: RichDocNode[]

Pending document content owned by the current edit session.

propertypreferredX: number | null

Preferred x-position for repeated vertical cursor movement.

interfaceDocPreparedEditorRenderLayout

Doc-owned layout result consumed by host render surfaces.

propertyreadonly composingCaretPixelOffset: number

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

propertyreadonly contentWidth: number

Width available to document content after padding.

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

Cursor point relative to the editor frame.

propertyreadonly positionRect: PositionRectProps

Final editor frame in world coordinates.

propertyreadonly snapshot: LayoutSnapshot

Layout snapshot owned by the Doc input/render session.

interfaceDocRenderLayoutState

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

propertyreadonly blockLayoutDiff: DocBlockLayoutDiff

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

propertyreadonly blockRender?: DocBlockRenderDebugSnapshot

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

propertyreadonly contentRect: PositionRectProps

Editable content rectangle in viewport coordinates.

propertyreadonly documentRect: PositionRectProps

Current document layout rectangle in world coordinates.

propertyreadonly font: string

Font selected by the host for this document render layout.

propertyreadonly layoutCache: DocLayoutCache

Latest full-document layout cache.

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

Current viewport scroll offset.

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

Visible viewport dimensions.

propertyreadonly visibleBlocks: readonly DocBlockLayout[]

Laid-out blocks selected for the current viewport.

interfaceDocRenderOperation

Render-facing operation derived from a RichDoc OT operation.

interfaceDocRenderRequest

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

propertyreadonly renderOperations?: DocRenderOperations

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

propertyreadonly renderPluginKey?: PluginKey

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

interfaceDocRenderViewport

Snapshot of the current document viewport used by render strategies.

propertyreadonly contentRect: PositionRectProps

Editable content rectangle inside the viewport.

propertyreadonly height: number

Visible viewport height in host-view units.

propertyreadonly width: number

Visible viewport width in host-view units.

typeDocRenderDirtyBlockIds
type DocRenderDirtyBlockIds = ReadonlySet<DocNodeId> | null

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

typeDocRenderOperations
type DocRenderOperations = readonly DocRenderOperation[] | null

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

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

Function that handles committed document render requests.

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

Transaction metadata key containing selection mapping for DocInputPlugin.

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

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

functioncollectDocRenderOperations
collectDocRenderOperations(transactions: readonly Transaction<Operation>[]): DocRenderOperations

Collects render operations derived from committed RichDoc OT transactions.

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

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

Sheet interaction

classSheetInteractionStore

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

constructorSheetInteractionStore(reducers: SheetInteractionReducerRegistry, platform?: Platform): SheetInteractionStore
propertyreadonly symbol: typeof symbolstatic

DI token for resolving SheetInteractionStore.

methodapply(signal: SheetInteractionSignal): void

Applies a transaction to SheetInteractionStore state.

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

Publishes a previously staged interaction state after pipeline commit.

state

Final interaction state to make visible.

signals

Ordered signals to deliver to subscribers.

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

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

methodgetState(): Readonly<SheetInteractionState>

Returns the state.

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

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

ReturnsThe prospective interaction state.

state

Interaction state visible before the signal.

signal

Local interaction transition to reduce.

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

Subscribes to state changes and returns an idempotent disposer.

classSheetMatrix
class SheetMatrix extends CSRMatrix<CellMatrixElement>

SheetMatrix public API.

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

Constructs a CSRMatrix instance.

data

The data for the matrix.

shape

The shape of the matrix as [numRows, numCols].

methodclone(): this

Copies stored cell payloads as well as sparse indexes.

Inherited members 34

Inherited from CSRMatrix.

classSheetViewportResizeController
class SheetViewportResizeController extends SheetLifecycleController

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

constructorSheetViewportResizeController(subscriptionManager: SubscriptionManager): SheetViewportResizeController
propertyreadonly symbol: typeof symbolstatic

DI token for resolving SheetViewportResizeController.

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

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

methoddestroy(): void

Releases resources owned by SheetViewportResizeController.

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

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

methodstart(context: SheetLifecycleContext): void

Starts SheetViewportResizeController.

interfaceCellMatrixElement

Persisted cell payload stored in the sheet matrix.

propertyformula?: string

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

propertyformulaEvaluationMode?: "dynamic" | "legacy"

Array evaluation mode used when the formula was entered.

propertytype: string

Cell type identifier owned by the cell type catalog.

propertyvalue?: unknown

Raw value whose shape is owned by the cell type.

interfaceSelectionRect

A single selection highlight rectangle in canvas coordinates.

propertyheight: number
propertywidth: number
propertyx: number
propertyy: number
interfaceSheetInteractionReducer

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

interfaceSheetInteractionSignal

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

propertytype: string
interfaceSheetInteractionState
propertyeditSession: SheetEditSession | null
propertyselection: { anchor: readonly [number, number]; focus: readonly [number, number]; source: string } | null
propertyselectionRevision: number

Increments for every explicit selection transition.

propertysuppressedSelectionRevision: number | null

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