@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.
constructor SearCoreSheet(stage: SceneGraph<CellProperties>, pluginManager: PluginManager<SearCoreSheet, CellProperties>, dataEngine: SheetDataEngine, renderEngine: RenderEngine<CellProperties, SheetRenderCoordinatorManager>, eventEngine: EventEngine<CellProperties>, configEngine: ConfigEngine, lifecycleCoordinator: SheetLifecycleCoordinator, interactionStore: SheetInteractionStore, stepExecutorRegistry: PipelineStepExecutorRegistry, platform?: Platform): SearCoreSheetCreates a sheet core from the DI-provided runtime services.
property configEngine: ConfigEngineConfiguration registry used by sheet plugins.
property dataEngine: DataEngineData registry for plugin-owned sheet state.
property eventEngine: EventEngine<CellProperties>Event pipeline and hit-testing facade for sheet interactions.
property readonly pluginManager: PluginManager<SearCoreSheet, CellProperties>Ordered plugin registry for this sheet runtime.
property renderEngine: RenderEngine<CellProperties, SheetRenderCoordinatorManager>Render pipeline facade for visible sheet scene updates.
method destroy(token?: object): voidReleases runtime controllers and their subscriptions owned by this sheet.
method enforceCommandBoundary(isCommandExecuting: (): boolean): voidPermanently require command dispatch for state-changing pipelines in an assembled editor.
method enforceTeardownBoundary(token: object): voidReserves assembled runtime teardown for the owning editor facade.
method executePipeline(pipeline: Pipeline): voidExecute a Pipeline — the single monitoring conduit for all state changes and render triggers.
Lifecycle hooks on the Pipeline emit observability events. Callers that construct a Pipeline can attach ConsolePipelineLogger explicitly when console diagnostics are desired.
method getDataEngine(): SheetDataEngineReturns the sheet data engine with sheet-specific helpers.
method getPlugin(pluginKey: PluginKey): unknownReturns state owned by the plugin identified by the given key.
method getRenderEngine(): RenderEngine<CellProperties, SheetRenderCoordinatorManager>Returns the render engine bound to this sheet core.
method getStage(): SceneGraph<CellProperties>Returns the scene graph used by render and event strategies.
method initialize(): voidBuilds plugin state and initial scene nodes without starting runtime effects.
method previewTransactionStates(transactions: readonly Transaction<Operation>[]): ReadonlyMap<PluginKey, unknown>Stages document transactions for a command without publishing their states.
method registerPlugin<T>(plugin: Plugin<SearCoreSheet, CellProperties, T>): voidRegisters and initializes a plugin after core startup.
method requestRender<T>(plugin: Plugin<SearCoreSheet, CellProperties, T>): voidConvenience: wrap a render-only refresh in a Pipeline and execute it.
method start(): voidStarts rendering, events, and lifecycle-owned runtime controllers.
- classSearCoreDoc
-
class SearCoreDoc extends SearCore<SearCoreDoc, NodeProperties, unknown>Stages and commits rich-document transactions for one editor runtime.
constructor SearCoreDoc(blockManager: BlockManager, docCursorManager: DocCursorManager, docCompositionManager: DocCompositionManager, docLayoutEngine: DocLayoutEngine, pluginManager: PluginManager<SearCoreDoc, NodeProperties>, stepExecutorRegistry?: PipelineStepExecutorRegistry, runtimeLayers?: SearCoreDocRuntimeLayers): SearCoreDocproperty blockManager: BlockManagerproperty configEngine: ConfigEngine<any> | nullConfiguration layer used by standalone document hosts when configured by assembly.
property eventEngine: EventEngine<NodeProperties> | nullEvent pipeline and hit-testing facade used by standalone document hosts.
property readonly pluginManager: PluginManager<SearCoreDoc, NodeProperties>Plugin manager for document runtime service plugins.
property renderEngine: DocRenderEngine | nullRender engine used by standalone document hosts when configured by assembly.
property renderStage: SceneGraph<NodeProperties> | nullScene graph used by standalone document rendering when configured by assembly.
property readonly pluginManagerSymbol: symbolstaticDI token for resolving the Doc-owned PluginManager without colliding with Sheet managers.
property readonly runtimeLayersSymbol: symbolstaticDI token for resolving the Doc runtime layers owned by this Core instance.
property readonly symbol: symbolstaticDI token for resolving SearCoreDoc.
method bindDocRenderRequestHandler(handler: DocRenderRequestHandler): voidBinds the document render scheduler used by hosts that execute document commands.
method clearDocRenderRequests(): voidClears diagnostic document render request history.
method destroy(ownerToken?: object): voidReleases standalone document runtime ownership held by Core.
method enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidPermanently require command dispatch for state-changing pipelines in an assembled editor.
method enforceTeardownBoundary(ownerToken: object): voidReserves assembled Doc Core cleanup for its editor facade.
method executePipeline(pipeline: Pipeline): voidExecutes document command work through the shared observable Pipeline contract.
method exportSnapshot(document?: readonly RichDocNode[]): Schema[]Exports a runtime document as the shared rich-document schema snapshot.
method getDocRenderLayoutState(): DocRenderLayoutState | nullReturns the layout state consumed by DocPlugin.render().
method getDocRenderRequests(): readonly DocRenderRequest[]Returns a diagnostic snapshot of document render requests seen by this core.
method getLayoutSnapshot(): LayoutSnapshot | nullReturns the latest document layout snapshot prepared by Core.
method getPlugin<T>(pluginKey: PluginKey): T | undefinedReturns the plugin.
method getPluginInstance(pluginKey: PluginKey): Plugin<SearCoreDoc, NodeProperties, any> | undefinedGet a plugin instance by key (for calling plugin-specific methods).
method initialize(): voidInitializes core-owned state, scene nodes, and runtime services.
method loadSnapshot(snapshot: readonly Schema[]): RichDocNode[]Loads one shared rich-document schema snapshot into this Core runtime.
method materializeSnapshot(snapshot: readonly Schema[]): RichDocNode[]Converts a shared snapshot into detached runtime nodes without changing Core state.
method prepareEditorRenderLayout(input: DocEditorRenderLayoutInput): DocPreparedEditorRenderLayoutPrepares the current editable document frame through the Doc-owned layout path used by standalone document hosts and embedded editors.
method registerPlugin<T>(plugin: Plugin<SearCoreDoc, NodeProperties, T>): (): voidRegisters the plugin.
method requestDocRender(pluginKey?: PluginKey): voidRequests a document render for plugin-owned render nodes.
method resolveCursorFromPoint(x: number, y: number, snapshot: LayoutSnapshot): DocCursorPosResolves a point inside the editable document frame to the closest document cursor position.
method setDocRenderLayoutState(state: DocRenderLayoutState | null): voidSets the layout state consumed by DocPlugin.render().
method start(): voidStarts standalone document runtime layers after initial plugin-node construction.
method unregisterPlugin(pluginKey: PluginKey): voidUnregisters 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.
constructor SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>(): SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>property readonly symbol: symbolstaticDI token for resolving the active core implementation.
method getPlugin(pluginKey: PluginKey): unknownRetrieves a plugin instance by plugin key.
method registerPlugin<T>(plugin: Plugin<SearCore<ChildType, NodeTypeProperties, RenderCoordinatorManagerType>, NodeTypeProperties, T>): voidRegisters a plugin with the core's plugin manager.
- classSearLifecycleError
-
class SearLifecycleError extends SearErrorError thrown for invalid sheet lifecycle transitions.
constructor SearLifecycleError(operation: string, state: string, message?: string): SearLifecycleErrorproperty readonly code: "SEAR_LIFECYCLE_INVALID_STATE"Stable machine-readable error code.
Inherited members 9
Inherited from SearError.
- classSheetLifecycleCoordinator
-
Starts and disposes the runtime controllers owned by one sheet instance.
constructor SheetLifecycleCoordinator(): SheetLifecycleCoordinatorproperty readonly symbol: typeof symbolstaticDI token for resolving SheetLifecycleCoordinator.
method beginTeardown(token: object): voidPermits cleanup only for the owning editor.
method destroy(): voidReleases resources owned by SheetLifecycleCoordinator.
method enforceCommandBoundary(assertCommandWrite: (): void, teardownToken: object): voidCloses runtime registration after editor assembly.
method register(controller: SheetLifecycleController): (): voidAdds a controller. Controllers registered after startup begin immediately, so applications can add lifecycle behavior without changing SearCoreSheet.
method start(context: SheetLifecycleContext): voidStarts SheetLifecycleCoordinator.
- interfaceSearCoreDocRuntimeLayers
-
Runtime layers owned by one SearCoreDoc instance.
property readonly configEngine?: ConfigEngine<any> | nullConfiguration layer used by standalone document hosts.
property readonly eventEngine?: EventEngine<NodeProperties> | nullEvent pipeline and hit-testing facade used by standalone document hosts.
property readonly platform?: Platform | nullPlatform diagnostics adapter used by document core guard clauses.
property readonly renderEngine?: DocRenderEngine | nullRender engine used by standalone document hosts.
property readonly renderStage?: SceneGraph<NodeProperties> | nullScene graph used by standalone document rendering.
- interfaceSheetEditSession
-
property editor: stringproperty target: readonly [number, number] - interfaceSheetLifecycleContext
-
Shared context supplied to lifecycle controllers for one sheet instance.
property readonly core: SearCoreSheetmethod refreshSheetBoundaries(): void - 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('select-cell', tx); searCore.executePipeline(p); // A multi-step operation (edit-exit-and-select) const p = new Pipeline(featurePipelineName); p.add(featureCommitStepName, cellValueTx); p.add(featureCleanupStepName, cleanupTx); p.addRender(featureRefreshStepName, selectionPluginKey); p.markDirty(editorRect); searCore.executePipeline(p);constructor Pipeline(name: string): PipelineCreates a named pipeline for diagnostics and command results.
property readonly dirtyRects: PositionRect<templateLiteral>[]Dirty rectangles accumulated before the render phase.
property readonly name: stringproperty readonly steps: PipelineStep[]Ordered steps that will be executed by the pipeline executor.
method add(stepName: string, transaction: Transaction): thisAppend a transaction step (shorthand).
method addCustom(stepName: string, kind: string, data?: unknown): thisAdd a step handled by an executor registered by the host or an extension.
method addInteraction(stepName: string, interaction: SheetInteractionSignal): thisAppend a local interaction-state transition.
method addLocalAction(stepName: string, localAction: (): void): thisAppend a command-owned local action step.
method addPostCommit(stepName: string, postCommit: (): void): thisAppend a local state publication deferred until all steps have staged successfully.
method addPostRender(stepName: string, pluginKey: PluginKey): thisSchedule a visual refresh after this pipeline's normal frame has completed. Use this when a second scene update must not consume dirty regions produced by transaction-driven plugins in the same frame.
method addPreparedAction(stepName: string, prepare: (): (): void): thisPrepare an editor-local resource that is released if later staging fails.
method addRender(stepName: string, pluginKey: PluginKey): thisAppend a render-only step for the given plugin.
method addTransaction(stepName: string, transaction: Transaction): thisAppend a transaction step.
method emitComplete(rendered: boolean): voidNotify all hooks that the pipeline has completed.
method emitStart(): voidNotify all hooks that the pipeline is starting.
method emitStepComplete(step: PipelineStep): voidNotify all hooks that a step has completed.
method emitStepStart(step: PipelineStep): voidNotify all hooks that a step is starting. Provides auto-derived detail.
method markDirty(rect: PositionRect<templateLiteral>): thisDefers a dirty rectangle until the pipeline executor reaches render.
method use(hook: PipelineLifecycle): thisRegister a lifecycle hook (middleware). Hooks fire in registration order.
method fromRender(name: string, pluginKey: PluginKey): PipelinestaticCreates a pipeline containing one render step for a plugin key.
method fromTransaction(name: string, transaction: Transaction): PipelinestaticCreates a pipeline containing one transaction step.
- enumPipelineStepKind
-
Built-in pipeline step kinds understood by SearCoreSheet.
enum member Interaction: "interaction"Update local sheet interaction state; never synchronized through OT.
enum member LocalAction: "local-action"Run a command-owned local action; never synchronized through OT.
enum member PostCommit: "post-commit"Publish a command-owned local state change only after staging succeeds.
enum member PostRender: "post-render"Re-render after the current frame's dirty regions have been flushed.
enum member PreparedAction: "prepared-action"Prepare a local resource and return its rollback for failed staging.
enum member Render: "render"Re-render a single plugin (no state change).
enum member Transaction: "transaction"Stage a Transaction for atomic commit after every pipeline step succeeds.
- classConsolePipelineLogger
-
class ConsolePipelineLogger extends PipelineLifecycleConsole logger middleware for Pipeline lifecycle events.
Registers as a PipelineLifecycle hook and emits styled console output at each stage:
🚀 Pipeline: edit-exit-and-select (3 steps, 1 dirty) 📝 commit-cell-value → set R0C0 = {richtext} ✅ commit-cell-value 📝 exit-edit-mode → clear editor ✅ exit-edit-mode 🏁 Pipeline done — renderedThis is the only place that touches console — the execution engine and caller code are fully decoupled from logging.
constructor ConsolePipelineLogger(): ConsolePipelineLoggermethod onComplete(_pipeline: Pipeline, rendered: boolean): voidHandles the complete lifecycle event.
method onStart(pipeline: Pipeline): voidHandles the start lifecycle event.
method onStepComplete(step: PipelineStep, _pipeline: Pipeline): voidHandles the step complete lifecycle event.
method onStepStart(step: PipelineStep, _pipeline: Pipeline, detail: string): voidHandles 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.
constructor PipelineStepExecutorRegistry(): PipelineStepExecutorRegistryproperty readonly symbol: typeof symbolstaticDI token for resolving PipelineStepExecutorRegistry.
method get(kind: string): PipelineStepExecutor | undefinedmethod register(executor: PipelineStepExecutor): (): voidRegisters the value.
- classSearContractViolationError
-
class SearContractViolationError extends SearErrorError thrown when an internal assembly contract is violated.
constructor SearContractViolationError(message: string, details?: SearErrorDetails): SearContractViolationErrorproperty readonly code: "SEAR_CONTRACT_VIOLATION"Stable machine-readable error code.
Inherited members 9
Inherited from SearError.
- classSearPipelineStepExecutorNotFoundError
-
class SearPipelineStepExecutorNotFoundError extends SearErrorError thrown when a pipeline step kind has no registered executor.
constructor SearPipelineStepExecutorNotFoundError(kind: string): SearPipelineStepExecutorNotFoundErrorproperty readonly code: "SEAR_PIPELINE_STEP_EXECUTOR_NOT_FOUND"Stable machine-readable error code.
Inherited members 9
Inherited from SearError.
- classSearRegistryConflictError
-
class SearRegistryConflictError extends SearErrorError thrown when a registry key is registered more than once.
constructor SearRegistryConflictError(registry: string, key: string, message?: string): SearRegistryConflictErrorproperty readonly code: "SEAR_REGISTRY_CONFLICT"Stable machine-readable error code.
Inherited members 9
Inherited from SearError.
- classSearRegistryEntryNotFoundError
-
class SearRegistryEntryNotFoundError extends SearErrorError thrown when a required registry entry is missing.
constructor SearRegistryEntryNotFoundError(registry: string, key: string, message?: string): SearRegistryEntryNotFoundErrorproperty readonly code: "SEAR_REGISTRY_ENTRY_NOT_FOUND"Stable machine-readable error code.
Inherited members 9
Inherited from SearError.
- classSheetInteractionReducerRegistry
-
Extensible dispatch table for local interaction-state transitions.
constructor SheetInteractionReducerRegistry(): SheetInteractionReducerRegistryproperty readonly symbol: typeof symbolstaticDI token for resolving SheetInteractionReducerRegistry.
method get(type: string): SheetInteractionReducer | undefinedmethod register(reducer: SheetInteractionReducer): (): voidRegisters the value.
- interfacePipelineLifecycle
-
Observer hooks emitted while a pipeline executes.
method onComplete(pipeline: Pipeline, rendered: boolean): voidPipeline finished (all steps + render).
method onStart(pipeline: Pipeline): voidPipeline begins execution.
method onStepComplete(step: PipelineStep, pipeline: Pipeline): voidA single step has finished executing.
method onStepStart(step: PipelineStep, pipeline: Pipeline, detail: string): voidA single step is about to execute. Receives auto-derived detail.
- interfacePipelineStep
-
One ordered unit of work inside a pipeline.
property data?: unknownExtension-owned payload for a custom step executor.
property interaction?: SheetInteractionSignalLocal interaction transition for interaction steps.
property kind: stringBuilt-in or extension-provided executor key.
property localAction?: (): voidCommand-owned action for local-action steps.
property name: stringHuman-readable step name used by diagnostics.
property postCommit?: (): voidDeferred local state publication after document and interaction commits.
property prepare?: (): (): voidLocal preparation that returns its rollback action.
property renderPluginKey?: PluginKeyPlugin key to re-render for render steps.
property transaction?: Transaction<Operation>Transaction payload for transaction steps.
- interfacePipelineStepExecutionContext
-
Effects an executor may request without taking ownership of frame flushing.
method applyInteraction(step: PipelineStep): voidmethod executeTransaction(step: PipelineStep): voidmethod markDirty(rect: PositionRect<templateLiteral>): voidmethod prepareLocalAction(step: PipelineStep): voidmethod renderPlugin(step: PipelineStep): voidmethod runLocalAction(step: PipelineStep): voidmethod schedulePostCommit(step: PipelineStep): voidmethod schedulePostRender(step: PipelineStep): void - interfacePipelineStepExecutor
-
Handles one extensible Pipeline step kind.
- 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(): numberIdentifies the active observer scope so an older command cannot lend it write authority.
- functionisInsideCommandExecution
-
isInsideCommandExecution(): boolean - functionlockCommittedSheetState
-
lockCommittedSheetState(state: unknown): voidLocks 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>): TRuns 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 DocCompositionProviderOwns optional IME composition state independently from cursor and selection state.
constructor DocCompositionManager(textShaper: TextShaper): DocCompositionManagerproperty readonly symbol: symbolstaticDI token for resolving DocCompositionManager.
method clear(teardownToken?: object): voidClears all composing state.
method enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken?: object): voidCloses direct composition writes after editor assembly.
method getCaretOffset(): numberReturns the logical caret offset inside the composing text.
method getCaretPixelOffset(): numberReturns the latest measured caret pixel offset.
method getText(): stringReturns the current composing text.
method measure(font?: string): DocCompositionLayoutMeasures current composing text and records the caret pixel offset for rendering.
method setText(text: string, caretOffset?: number): voidUpdates 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.
constructor DocCursorManager(): DocCursorManagerproperty readonly symbol: symbolstaticDI token for resolving DocCursorManager.
method clearCursor(teardownToken?: object): voidClear cursor and selection state (call on edit-session end).
method enforceCommandBoundary(isCommandExecuting: (): boolean, teardownToken: object): voidSeals assembled cursor writes while preserving command-owned rendering.
method getCursor(): CursorRenderInfo | nullRead the cursor render info. Returns null when no edit session is active.
method getSelectionRects(): SelectionRect[]Read the selection highlight rectangles.
method setCursor(info: CursorRenderInfo): voidSet (or update) the cursor render info for the upcoming draw call.
method setSelectionRects(rects: SelectionRect[]): voidSet selection highlight rectangles for the upcoming draw call.
- The plugin computes pixel cursor coordinates (via DocLayoutEngine) and
calls
- classDocImmediateRenderPainter
-
Shared painter for embedded rich-document content and transient viewport output.
constructor DocImmediateRenderPainter(cursorManager: DocCursorManager, scrollManager: ScrollManager, lineRenderer: RichTextLineRenderer, compositionManager?: DocCompositionManager | null): DocImmediateRenderPainterCreates a painter over the document cursor and scroll services.
method drawContent(context: RenderContext, input: DocImmediateRenderPainterContentInput): voidDraws text lines from a layout snapshot in the caller's current transform.
method drawSelectionRectsInViewport(context: RenderContext): voidDraws selection rectangles in viewport coordinates under an identity transform.
method drawSelectionRectsInWorld(context: RenderContext): voidDraws selection rectangles using the caller's current world transform.
method drawTextCursorOverlayInViewport(context: RenderContext): voidDraws 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.
constructor DocInputPlugin(docLayoutEngine: DocLayoutEngine, platform?: Platform): DocInputPluginConstructs the document input plugin with editor-session state only.
property readonly transactionOT: { definition: TransactionOTDefinition<RichDocOTOperation>; ownerId: "doc.input"; relations: readonly [OTTransformRelation<RichDocOTOperation, RichDocOTOperation>] }All document data mutations use the shared RichDoc OT operation family.
property readonly pluginKey: PluginKeystaticStable plugin key for document input state.
property readonly symbol: symbolstaticDI token for resolving the document input plugin.
membersession session: unknownmethod apply(state: DocInputState, transaction: Transaction): DocInputState | nullApplies rich-document OT transactions owned by the document input plugin.
method clearSession(): voidClears the current edit session state.
method createArrowTransaction(direction: DocCursorDirection, shiftKey: boolean): TransactionBuilds a transaction for arrow-key cursor navigation.
method createDeleteTransaction(): TransactionBuilds a transaction for Backspace deletion.
method createInputTransaction(text: string): TransactionBuilds a transaction for committed text input.
method createReplaceDocumentTransaction(document: RichDocNode[], selection?: DocSelection): TransactionBuilds a RichDoc OT transaction that replaces the active document session.
method createSelectAllTransaction(): TransactionBuilds a transaction that selects all content in the current document session.
method createSoftEnterTransaction(): TransactionBuilds a transaction for soft-enter paragraph splitting.
method createTransaction(command: DocCommand, docTransaction?: DocTransaction): TransactionBuilds a workspace transaction from a rich-document domain command.
method enforceSessionWriteBoundary(isCommandExecuting: (): boolean, commitToken: object, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidBinds the owning editor's command and commit boundary after initial state registration.
method getLastSnapshot(): LayoutSnapshot | nullReturns the derived layout snapshot used for vertical cursor movement.
method getPluginConfig(_searCore: SearCoreDoc): nullDocument input has no plugin configuration.
method handleArrow(direction: DocCursorDirection, shiftKey: boolean): DocInputDispatchResultHandles arrow-key cursor navigation.
method handleDelete(): DocInputDispatchResultHandles Backspace deletion.
method handleInput(text: string): DocInputDispatchResultHandles committed text input.
method handleSelectAll(): DocInputDispatchResultSelects all content in the current document session.
method handleSoftEnter(): DocInputDispatchResultHandles soft-enter paragraph splitting.
method onTransactionCommitted(transaction: Transaction): voidPublishes committed document and selection projections after Core commits this plugin's transaction.
method registerState(): { key: PluginKey; state: DocInputState }Registers document input state under the plugin key.
method render(_searCore: SearCoreDoc): Node<NodeProperties>[] | nullDocument input does not render scene nodes directly.
method resetSession(doc: RichDocNode[], selection?: DocSelection): voidReplaces the current edit session document and selection.
method restoreSelection(selection: DocSelection): voidReplaces local selection during session restoration without changing document content.
method sealSessionRestoration(): voidCloses the document initialization and session restoration phase.
method setLastSnapshot(snapshot: LayoutSnapshot | null): voidStores the last layout snapshot for cursor navigation.
method subscribeDocument(listener: (): void): (): voidSubscribes to committed document projection changes.
method subscribeSelection(listener: (): void): (): voidSubscribes to committed selection projection changes.
Inherited members 27
Inherited from Plugin.
- depth
- documentState
- interestedIn
- transactionHistory
- warnOnDuplicateDepth
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- 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.
constructor DocRenderEngine(scrollManager: ScrollManager, renderContext: RenderContext, configEngine: ConfigEngine, renderCoordinatorManager: RenderCoordinatorManager, stage: SceneGraph<NodeProperties>, renderStrategyManager: RenderStrategyManager<NodeProperties>, screenRenderStrategy: ScreenRenderStrategy<NodeProperties>, dirtyRenderStrategy: DirtyRenderStrategy<NodeProperties>, stickyRenderStrategy: StickyRenderStrategy<NodeProperties>, overlayRenderStrategy: OverlayRenderStrategy<NodeProperties>): DocRenderEngineproperty readonly symbol: symbolstaticDI token for resolving DocRenderEngine.
method getLastScreenRenderMode(): ScreenRenderFrameMode | nullReturns the screen strategy mode used by the last render pass, if it painted.
method initialize(): voidInitializes DocRenderEngine.
method invalidateScreenCache(): voidInvalidates the off-screen body cache used by the screen strategy.
method markDirty(rect: PositionRect<templateLiteral>): voidMarks one document-world rectangle dirty for the next dirty pass.
method render(node: Node<NodeProperties>): voidRuns the configured document render strategies over the current scene graph.
method resize(width: number, height: number, scale: number): voidResizes all Doc render layers and invalidates screen-cache reuse.
method setBlockRasterCopyPlan(plan: BlockRasterCopyPlan | null): voidSupplies one layout-shift raster-copy plan for the next screen render pass.
method setViewport(viewport: DocRenderViewport): voidUpdates the viewport model used by subsequent render frames.
method setViewScale(scale: number): voidUpdates the view scale on every render strategy context.
Inherited members 5
Inherited from RenderEngine.
- classNoopDocCompositionProvider
-
class NoopDocCompositionProvider extends DocCompositionProviderNull provider used when no composition plugin is installed.
constructor NoopDocCompositionProvider(): NoopDocCompositionProvidermethod measure(_font: string): DocCompositionLayoutMeasures no composing text.
- classSearDocParseError
-
class SearDocParseError extends SearErrorError thrown when document input cannot be parsed.
constructor SearDocParseError(message: string, details?: SearErrorDetails): SearDocParseErrorproperty readonly code: "SEAR_DOC_PARSE"Stable machine-readable error code.
Inherited members 9
Inherited from SearError.
- interfaceCursorRenderInfo
-
Pre-computed pixel cursor state set by document layout before each render.
property height: numberLine height in pixels (used to size the cursor bar).
property visible: booleanWhether the cursor bar is currently visible (blink phase).
property x: numberAbsolute canvas X for the committed text caret.
property y: numberAbsolute canvas Y for the laid-out line that owns the cursor.
- interfaceDocCompositionLayout
-
Layout contribution from an in-flight IME composition.
property readonly active: booleanWhether there is active composing text to render.
property readonly caretPixelOffset: numberPixel offset from the composing-text start to the IME caret.
property readonly text: stringCurrent in-flight composing text.
property readonly textWidth: numberFull composing text width in pixels.
- interfaceDocCompositionProvider
-
Provider used by layout code to account for optional IME composition.
method measure(font: string): DocCompositionLayoutMeasures the active composing text against the current render font.
- interfaceDocEditorRenderLayoutInput
-
Input used by SearCoreDoc to initialize one editable document frame.
property readonly compositionProvider?: DocCompositionProviderOptional IME composition provider installed by a feature plugin or embedded host.
property readonly cursorVisible?: booleanWhether the transient text cursor should be visible in this frame.
property readonly document: RichDocNode[]Rich-document content to lay out and render.
property readonly fitContentWidth?: booleanWhether the editable frame may grow horizontally to fit unwrapped content.
property readonly font?: stringFont descriptor used by the text shaper for this layout.
property readonly minContentWidth?: numberOptional minimum width needed to preserve pre-edit overflow sizing.
property readonly minHeight: numberMinimum editor height supplied by the host surface.
property readonly minWidth: numberMinimum editor width supplied by the host surface.
property readonly origin: Pick<PositionRectProps, "x" | "y">Editor origin in world coordinates.
property readonly padding?: numberPadding inside the editable frame.
property readonly selection: DocSelectionCurrent document selection.
property readonly verticalAlign?: DocVerticalAlignVertical positioning inside the editable frame. Defaults to center for embedded cell editors.
- interfaceDocImmediateRenderPainterContentInput
-
Input for immediate rendering of laid-out document content lines.
property readonly blockIndexes?: readonly number[]Optional block indexes to draw; omitted means all blocks.
property readonly clipRect?: PositionRect<templateLiteral>Optional world-coordinate clipping rectangle.
property readonly font?: stringBase font selected by the host for this document frame.
property readonly origin: Pick<PositionRectProps, "x" | "y">Content origin in world coordinates.
property readonly snapshot: LayoutSnapshotLayout snapshot whose lines are relative to the content origin.
- interfaceDocInputDispatchResult
-
Result of applying one domain input command to the active document input session.
property readonly contentChanged: booleanWhether the command produced document OT operations.
property readonly selection: DocSelectionSelection after all command steps have been applied and mapped.
property readonly selectionOnly: booleanWhether the command only changed selection/caret state.
- interfaceDocInputState
-
State for an active rich-document input session.
property docSelection: DocSelectionCurrent rich-document selection.
property pendingDoc: RichDocNode[]Pending document content owned by the current edit session.
property preferredX: number | nullPreferred x-position for repeated vertical cursor movement.
- interfaceDocPreparedEditorRenderLayout
-
Doc-owned layout result consumed by host render surfaces.
property readonly composingCaretPixelOffset: numberPixel offset from composing-text start to the IME caret.
property readonly contentWidth: numberWidth available to document content after padding.
property readonly cursorRelative: { height: number; x: number; y: number }Cursor point relative to the editor frame.
property readonly positionRect: PositionRectPropsFinal editor frame in world coordinates.
property readonly snapshot: LayoutSnapshotLayout snapshot owned by the Doc input/render session.
- interfaceDocRenderLayoutState
-
Layout and viewport state exposed to document plugins during render().
property readonly blockLayoutDiff: DocBlockLayoutDiffBlock-level diff between the previous and current layout caches.
property readonly blockRender?: DocBlockRenderDebugSnapshotDebug and performance stats for the most recent block-render frame.
property readonly contentRect: PositionRectPropsEditable content rectangle in viewport coordinates.
property readonly documentRect: PositionRectPropsCurrent document layout rectangle in world coordinates.
property readonly font: stringFont selected by the host for this document render layout.
property readonly layoutCache: DocLayoutCacheLatest full-document layout cache.
property readonly scroll: { x: number; y: number }Current viewport scroll offset.
property readonly viewport: { height: number; width: number }Visible viewport dimensions.
property readonly 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.
property readonly renderOperations?: DocRenderOperationsRender-facing operations derived from committed RichDoc OT, or null when they cannot be converted safely.
property readonly renderPluginKey?: PluginKeyPlugin whose render nodes should be refreshed. Omitted means every document plugin may refresh.
- interfaceDocRenderViewport
-
Snapshot of the current document viewport used by render strategies.
property readonly contentRect: PositionRectPropsEditable content rectangle inside the viewport.
property readonly height: numberVisible viewport height in host-view units.
property readonly width: numberVisible viewport width in host-view units.
- typeDocRenderDirtyBlockIds
-
type DocRenderDirtyBlockIds = ReadonlySet<DocNodeId> | nullDirty block ids extracted from document render operations, or null when reflow cannot be localized safely.
- typeDocRenderOperations
-
type DocRenderOperations = readonly DocRenderOperation[] | nullRender operations derived from document transactions, or null when they cannot be converted safely.
- typeDocRenderRequestHandler
-
type DocRenderRequestHandler = (requests: readonly DocRenderRequest[]): voidFunction 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[]): DocRenderDirtyBlockIdsCollects blocks whose layout cache must be refreshed for reflow operations.
- functioncollectDocRenderOperations
-
collectDocRenderOperations(transactions: readonly Transaction<Operation>[]): DocRenderOperationsCollects 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.
constructor SheetInteractionStore(reducers: SheetInteractionReducerRegistry, platform?: Platform): SheetInteractionStoreproperty readonly symbol: typeof symbolstaticDI token for resolving SheetInteractionStore.
method apply(signal: SheetInteractionSignal): voidApplies a transaction to SheetInteractionStore state.
method 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.
method enforceCommandBoundary(isCommandExecuting: (): boolean, runWithoutMutationAuthority?: <Value>(callback: (): Value): Value): voidRequires an editor command for every assembled interaction-state commit.
method getState(): Readonly<SheetInteractionState>Returns the state.
method 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.
method subscribe(listener: (state: Readonly<SheetInteractionState>, signal: SheetInteractionSignal): void): (): voidSubscribes to state changes and returns an idempotent disposer.
- classSheetMatrix
-
class SheetMatrix extends CSRMatrix<CellMatrixElement>SheetMatrix public API.
constructor 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].
method clone(): thisCopies stored cell payloads as well as sparse indexes.
Inherited members 34
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addItem
- addListener
- addRow
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getItem
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- classSheetViewportResizeController
-
class SheetViewportResizeController extends SheetLifecycleControllerKeeps rendering, scrolling, and viewport-culled plugin nodes in sync with viewport size.
constructor SheetViewportResizeController(subscriptionManager: SubscriptionManager): SheetViewportResizeControllerproperty readonly symbol: typeof symbolstaticDI token for resolving SheetViewportResizeController.
method applyViewportResize(width: number, height: number): voidApplies a resize inside the command dispatched by the owning editor.
method destroy(): voidReleases resources owned by SheetViewportResizeController.
method setResizeExecutor(executor: (size: { height: number; width: number }): void): voidRoutes platform resize notifications through the owning editor's command bus.
method start(context: SheetLifecycleContext): voidStarts SheetViewportResizeController.
- interfaceCellMatrixElement
-
Persisted cell payload stored in the sheet matrix.
property formula?: stringFormula source text for formula cells; calculated results live in formula plugin state.
property formulaEvaluationMode?: "dynamic" | "legacy"Array evaluation mode used when the formula was entered.
property type: stringCell type identifier owned by the cell type catalog.
property value?: unknownRaw value whose shape is owned by the cell type.
- interfaceSelectionRect
-
A single selection highlight rectangle in canvas coordinates.
- 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.
property type: string - interfaceSheetInteractionState
-
property editSession: SheetEditSession | nullproperty selection: { anchor: readonly [number, number]; focus: readonly [number, number]; source: string } | nullproperty selectionRevision: numberIncrements for every explicit selection transition.
property suppressedSelectionRevision: number | nullThe selection revision consumed when the current/last edit session began.
No matching API entries.