← All packages

@searsuite/sear-assembly-setup

Create an editor

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 capabilities expose services owned by this editor instance.

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.

functioncreateSheetEditor
createSheetEditor(options: SheetEditorConfiguration): SheetEditor

Assembles the default sheet editor runtime from platform adapters and state.

The returned editor owns an isolated dependency container, plugin graph, and render lifecycle. Hosts interact with it through commands, queries, observations, and capabilities, and must call destroy() when the session is no longer mounted.

ReturnsA fully initialized Sheet editor facade.

Example
const editor = createSheetEditor({ adapters, sheetState, plugins });
await editor.commands.run(command, input);
editor.destroy();
options

Platform adapters, initial Sheet state, plugins, and runtime configuration.

interfaceSheetEditor
propertyreadonly capabilities: RuntimeCapabilityReader

Read-only access to typed services owned by this editor's isolated runtime.

propertyreadonly commands: SheetCommandBus

The sole supported entry point for user and program commands.

propertyreadonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

propertyreadonly queries: SheetQueryRegistry

Typed runtime query registry for side-effect-free editor reads.

methoddestroy(): void

Releases runtime services and every active host observation subscription.

functioncreateDocEditor
createDocEditor(options: DocEditorConfiguration): DocEditor

Assembles a standalone rich-document editor from platform-neutral adapters and document content.

The editor owns its DI container, selected document plugins, rendering services, input adapters, and lifecycle. Product chrome remains a host concern and communicates with the editor through its public facade.

ReturnsA fully initialized rich-document editor facade.

Example
const editor = createDocEditor({ adapters, documentState });
editor.focus();
editor.destroy();
options

Platform adapters, initial document state, plugins, and viewport configuration.

interfaceDocEditor

Public standalone document editor API returned by createDocEditor().

propertyreadonly capabilities: RuntimeCapabilityReader

Read-only access to typed services owned by this editor's isolated runtime.

propertyreadonly commands: DocCommandBus

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

propertyreadonly observations: ObservationRegistry

Typed editor-local state and event observations exposed to the host.

methoddestroy(): void

Releases listeners, timers, adapter state, and DI-owned services for this editor instance.

methodfocus(): void

Requests focus for the host text-input adapter, preserving IME placement.

methodgetDocument(): RichDocNode[]

Returns a clone of the current rich-document content.

methodgetText(): string

Returns the current plain-text view using one newline between paragraphs.

methodloadDocument(document: RichDocNode[]): void

Replaces the document content and renders the new state.

methodrender(): void

Renders the current editor state into the configured render context.

interfaceDocDocumentState

Document-owned rich content eligible for future ExportPlugin serialization.

propertyreadonly document: RichDocNode[]

Rich-document tree owned by this editor document.

interfaceDocEditorAdapters

Platform-specific services required to assemble a standalone document editor.

propertyeventRegistrar?: InjectableImplementation<EventRegistrar>

Optional host event registrar; defaults to a headless registrar when omitted.

propertykeyboardRouter: InjectableImplementation<KeyboardRouter>

Keyboard router for action keys such as arrows, backspace, enter, and select-all.

propertyplatform: InjectableImplementation<Platform>

Platform implementation that owns timers, resize observation, and diagnostics.

propertypointerCapture: InjectableImplementation<PointerCapture>

Host-wide pointer capture adapter that emits render-root view coordinates.

propertyscroller?: InjectableImplementation<Scroller & { getPublisher: unknown }>

Optional host scroller adapter for wheel/touch viewport scrolling.

propertytextInput: InjectableImplementation<TextInput>

Text input adapter for printable text, paste/cut, and IME composition.

methodcreateRenderContext(): RenderContext

Creates the visible render context used by the document editor.

methodcreateTextShaper(renderContext: RenderContext): TextShaper

Optional text-shaping adapter; omission uses render-context measurements.

methodregisterEnvironment(container: Container): void

Registers host environment values, such as keyboard and pointer event sources. Runs after base services are registered and before adapters are resolved.

interfaceDocEditorConfiguration

Configuration for assembling a standalone rich-document editor.

propertyadapters: DocEditorAdapters

Platform adapters supplied by the host application.

propertydefaultPlugins?: false | readonly DocPluginImplementation<DocPlugin<unknown>>[]

Default document feature plugins; pass false to assemble only custom plugins.

propertydevicePixelRatio?: number

Raster scale used to initialize and resize the render context.

propertydocumentState: DocDocumentState

Initial document-owned state.

propertyfontFamily?: string

Default font family and fallback list applied to document text.

propertyfontSize?: number

Default font size applied when measuring and rendering document text.

propertyincrementalRenderPolicyLimits?: IncrementalRenderPolicyLimitsConfig

Guardrails used when deciding whether document block raster reuse should run for a frame.

propertylineHeightMultiplier?: number

Default line-height multiplier applied to paragraphs without an explicit override.

propertyparagraphSpacingAfter?: number

Default spacing after non-final paragraphs.

propertyplugins?: DocPluginImplementation<DocPlugin<unknown>>[]

Document plugins installed after the default editing and rendering features.

propertysessionState?: Readonly<Record<string, unknown>>

Optional editor-local state restored during an in-memory remount.

propertyverticalAlign?: DocVerticalAlign

Vertical positioning used by standalone document layout; defaults to top.

propertyviewport?: DocEditorViewport

Initial viewport size; defaults to 800 by 600 when the host cannot know it yet.

methodcontentRect(viewport: DocEditorViewport): DocEditorContentRect

Resolves the editable content rectangle from the current viewport. Hosts use this to add page margins, rulers, or chrome without changing core document layout.

methodonCreated(editor: DocEditor): void

Called once the editor object has been assembled and initial content rendered.

interfaceSheetDocumentState

Document data owned by one sheet and eligible for future ExportPlugin serialization.

propertycellAlignments: AlignmentMatrix
propertycellBorders?: CellBorderMatrix

Sparse custom cell-edge state; absence initializes an empty border owner.

propertycellFills: CellFillMatrix

Sparse cell fill state.

propertycellFormats: CellFormatMatrix

Sparse per-cell number-format state.

propertycellHighlights: CellHighlightMatrix

Sparse conditional highlight rules anchored at their range starts.

propertycellMerges: CellMergeMatrix
propertycellVerticalAlignments: VerticalAlignmentMatrix

Sparse vertical cell alignment state.

propertycolumnHiddenOriginalSizes?: CSRMatrix<number>
propertycolumnSizes: ColumnShapeDimensionsCSRMatrix
propertydataValidations?: DataValidationMatrix

Sparse data validation rules anchored at range starts.

propertyduplicates: DuplicateMatrix

Sparse duplicate-item highlight state.

propertyfilters?: SheetFilterMatrix

Sheet-owned filter range and column rules.

propertyfixedRows?: FixedRowMatrix

Sparse per-row fixed state.

propertyfreeze?: SheetFreezeMatrix

Persistent top and left freeze boundaries.

propertyrowHiddenOriginalSizes?: CSRMatrix<number>
propertyrowSizes: RowShapeDimensionsCSRMatrix
propertysheetData: SheetMatrix
interfaceSheetEditorAdapters

Platform-specific services required to assemble the default sheet editor.

propertyclipboard?: InjectableImplementation<SheetClipboard>
propertycollabTransport: InjectableImplementation<CollabTransport>
propertycursorEngine: InjectableImplementation<CursorEngine>
propertyeventRegistrar: InjectableImplementation<EventRegistrar>
propertyfileDownload?: InjectableImplementation<FileDownload>

Optional host file-save capability; existing environment bindings take precedence. The editor owns newly created adapters.

propertyformulaBar?: InjectableImplementation<SearFormulaBar>

Optional formula input surface supplied by the host.

propertykeyboardRouter: InjectableImplementation<KeyboardRouter>
propertyplatform: InjectableImplementation<Platform>
propertypointerCapture: InjectableImplementation<PointerCapture>
propertyscroller: InjectableImplementation<Scroller & { getPublisher: unknown }>
propertytextInput: InjectableImplementation<TextInput>
propertytoolbar: InjectableImplementation<SearToolbar>
propertyuserInteraction?: InjectableImplementation<UserInteractionService>

Host-owned service for decisions that require a user response.

propertywebServiceClient?: InjectableImplementation<WebServiceClient>

Asynchronous web-service transport used by host-managed formula caches.

propertyxmlXPathEvaluator?: InjectableImplementation<XmlXPathEvaluator>

XML/XPath evaluator used by XML-backed formula plugins.

methodcreateFunctionRegistry(): IFunctionRegistry

Creates the function catalog owned by this editor or its parent workbook.

methodcreateRenderContexts(): { hitRenderContext: RenderContext; offScreenRenderContext: RenderContext; renderContext: RenderContext }
methodcreateTextShaper(renderContext: RenderContext): TextShaper

Creates an editor-local text shaper; omission uses render-context measurements.

methodregisterEnvironment(container: Container): void
interfaceSheetEditorConfiguration
propertyadapters: SheetEditorAdapters
propertycellFontFamily?: string

Default font family and fallback list used by ordinary Sheet cells.

propertycellFontSize?: number

Default font size used by ordinary Sheet cells.

propertyembeddedEditor?: SheetEmbeddedEditor

Optional editor used to render and edit rich text embedded in Sheet cells.

propertyplugins?: SheetEditorPluginImplementation[]
propertysessionState?: Readonly<Record<string, unknown>>

Optional editor-local state restored when remounting a workbook sheet.

propertysheetState: SheetDocumentState
propertyviewport?: { height: number; width: number }
methodonCreated(editor: SheetEditor): void

Document editing commands

variableRedoDocCommand
RedoDocCommand: DocCommandDefinition<void, DocCommandResult>

Re-applies the most recently undone document mutation.

variableUndoDocCommand
UndoDocCommand: DocCommandDefinition<void, DocCommandResult>

Reverts the most recent committed document mutation.

variableClearDocCompositionCommand
ClearDocCompositionCommand: DocCommandDefinition<void, DocCommandResult>

Clears the active IME composition preview text.

variableDeleteDocBackwardCommand
DeleteDocBackwardCommand: DocCommandDefinition<void, DocCommandResult>

Deletes content before the current document selection.

variableFocusDocCommand
FocusDocCommand: DocCommandDefinition<void, DocCommandResult>

Focuses the host text-input adapter for the document editor.

variableInsertDocTableCommand
InsertDocTableCommand: DocCommandDefinition<InsertDocTableInput, DocCommandResult>

Inserts a table block at the current document position.

interfaceInsertDocTableInput

Input accepted by InsertDocTableCommand.

propertyreadonly columns: number

Number of columns in the inserted table.

propertyreadonly rows: number

Number of rows in the inserted table.

variableInsertDocTextCommand
InsertDocTextCommand: DocCommandDefinition<InsertDocTextInput, DocCommandResult>

Inserts text at the current document selection.

interfaceInsertDocTextInput

Input accepted by InsertDocTextCommand.

propertyreadonly text: string

Text to insert at the current document selection.

variableLoadDocumentCommand
LoadDocumentCommand: DocCommandDefinition<LoadDocumentInput, DocCommandResult>

Replaces the active document content.

interfaceLoadDocumentInput

Input accepted by LoadDocumentCommand.

propertyreadonly document: RichDocNode[]

Rich-document content to load into the document editor.

variableMoveDocCursorCommand
MoveDocCursorCommand: DocCommandDefinition<MoveDocCursorInput, DocCommandResult>

Moves the current document cursor.

interfaceMoveDocCursorInput

Input accepted by MoveDocCursorCommand.

propertyreadonly direction: DocCursorDirection

Direction for cursor movement.

propertyreadonly shiftKey?: boolean

Whether the movement should extend the current selection.

variableSelectAllDocCommand
SelectAllDocCommand: DocCommandDefinition<void, DocCommandResult>

Selects all document content.

variableSetDocBoldCommand
SetDocBoldCommand: DocCommandDefinition<SetDocBoldInput, DocCommandResult>

Sets whether the selected document text is bold.

interfaceSetDocBoldInput

Input accepted by SetDocBoldCommand. A null or false value clears bold.

variableSetDocCompositionCommand
SetDocCompositionCommand: DocCommandDefinition<SetDocCompositionInput, DocCommandResult>

Sets the active IME composition preview text.

interfaceSetDocCompositionInput

Input accepted by SetDocCompositionCommand.

propertyreadonly caretOffset: number

Caret offset inside the composing text.

propertyreadonly text: string

Current composing text emitted by the host input method.

variableSetDocFontFamilyCommand
SetDocFontFamilyCommand: DocCommandDefinition<SetDocFontFamilyInput, DocCommandResult>

Sets the font family on the selected document text.

interfaceSetDocFontFamilyInput

Input accepted by SetDocFontFamilyCommand. A null or empty value clears the font family.

variableSetDocFontSizeCommand
SetDocFontSizeCommand: DocCommandDefinition<SetDocFontSizeInput, DocCommandResult>

Sets the font size in pixels on the selected document text.

interfaceSetDocFontSizeInput

Input accepted by SetDocFontSizeCommand. A null or empty value clears the font size.

variableSetDocItalicCommand
SetDocItalicCommand: DocCommandDefinition<SetDocItalicInput, DocCommandResult>
variableSetDocSelectionCommand
SetDocSelectionCommand: DocCommandDefinition<SetDocSelectionInput, DocCommandResult>

Sets the active document selection without changing content.

interfaceSetDocSelectionInput

Input accepted by SetDocSelectionCommand.

propertyreadonly selection: DocSelection

Selection to make active in the document editor.

variableSetDocStrikethroughCommand
SetDocStrikethroughCommand: DocCommandDefinition<SetDocStrikethroughInput, DocCommandResult>
variableSetDocTextColorCommand
SetDocTextColorCommand: DocCommandDefinition<SetDocTextColorInput, DocCommandResult>

Sets the text color on the selected document text.

interfaceSetDocTextColorInput

Input accepted by SetDocTextColorCommand. A null or empty value clears the text color.

variableSetDocUnderlineCommand
SetDocUnderlineCommand: DocCommandDefinition<SetDocUnderlineInput, DocCommandResult>
variableSplitDocParagraphCommand
SplitDocParagraphCommand: DocCommandDefinition<void, DocCommandResult>

Splits the current paragraph at the current document selection.

variableToggleDocBoldCommand
ToggleDocBoldCommand: DocCommandDefinition<void, DocCommandResult>

Toggles bold on the selected document text.

variableToggleDocItalicCommand
ToggleDocItalicCommand: DocCommandDefinition<void, DocCommandResult>
variableToggleDocStrikethroughCommand
ToggleDocStrikethroughCommand: DocCommandDefinition<void, DocCommandResult>
variableToggleDocUnderlineCommand
ToggleDocUnderlineCommand: DocCommandDefinition<void, DocCommandResult>

Document lifecycle commands

classDocInputBindingRegistry

Registry that lets multiple document plugins contribute handlers to single-subscription input adapters.

constructorDocInputBindingRegistry(): DocInputBindingRegistry
propertyreadonly symbol: typeof symbolstatic

DI token for resolving the input binding registry.

methodclear(): void

Removes every registered handler.

methodcreateKeyboardHandlers(): KeyboardRouterHandlers

Creates the composed keyboard handlers passed to the host keyboard adapter.

methodcreateTextHandlers(): TextInputHandlers

Creates the composed text handlers passed to the host text adapter.

methodenforceCommandBoundary(isCommandExecuting: (): boolean, isTearingDown: (): boolean): void

Closes registration changes after editor startup.

methodregisterKeyboardHandlers(handlers: KeyboardRouterHandlers): (): void

Adds keyboard-action handlers and returns a disposer.

methodregisterTextHandlers(handlers: TextInputHandlers): (): void

Adds text-input handlers and returns a disposer.

interfaceCaptureDocSessionStateCommandResult
interface CaptureDocSessionStateCommandResult extends DocCommandResult

Result of capturing editor-local state for an in-memory document remount.

Inherited members 2

Inherited from DocCommandResult.

interfaceExportDocStateCommandResult
interface ExportDocStateCommandResult extends DocCommandResult

Result of exporting detached document-owned state for an in-memory remount.

Inherited members 2

Inherited from DocCommandResult.

typeDocViewportScrollInput
type DocViewportScrollInput = ScrollManagerState

Internal adapter input for one platform-originated document scroll state update.

variableApplyDocViewportScrollCommand
ApplyDocViewportScrollCommand: DocCommandDefinition<ScrollManagerState, DocCommandResult>

Applies one platform-originated document scroll update.

variableCaptureDocSessionStateCommand
CaptureDocSessionStateCommand: DocCommandDefinition<void, CaptureDocSessionStateCommandResult>

Captures every registered local document session contributor.

variableExportDocStateCommand
ExportDocStateCommand: DocCommandDefinition<void, ExportDocStateCommandResult>

Exports the current document-owned state without local session values.

variableRenderDocViewportCommand
RenderDocViewportCommand: DocCommandDefinition<void, DocCommandResult>

Renders the document viewport after the committed scroll state changes.

variableResizeDocViewportCommand
ResizeDocViewportCommand: DocCommandDefinition<DocEditorViewport, DocCommandResult>

Resizes the standalone document viewport.

variableScrollDocViewportToCommand
ScrollDocViewportToCommand: DocCommandDefinition<DocViewportSessionState, DocCommandResult>

Scrolls the standalone document viewport to an absolute world position.

variableUpdateDocDefaultConfigCommand
UpdateDocDefaultConfigCommand: DocCommandDefinition<EditorDefaultConfigOverrides<DocConfig>, DocCommandResult>

Updates editor-local Doc defaults without changing document state.

variableRenderDocCommand
RenderDocCommand: DocCommandDefinition<void, DocCommandResult>

Requests a document render without changing content.

Document plugins and styles

classCaretPlugin
class CaretPlugin extends DocPlugin<null>

Owns caret movement, focus, blink state, and caret overlay rendering.

constructorCaretPlugin(caretState: DocCaretState): CaretPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving CaretPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodgetPluginConfig(): null

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

methodonEditorDestroy(): void

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

methodregisterCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

methodregisterKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

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

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

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

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

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

methodregisterServices(context: DocPluginServiceContext): voidstatic

Registers caret-owned state before the plugin is resolved.

Inherited members 39

Inherited from DocPlugin.

classDocContentRenderPlugin
class DocContentRenderPlugin extends DocPlugin<null>

Default content renderer for text nodes laid out by the document layout engine.

constructorDocContentRenderPlugin(): DocContentRenderPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving DocContentRenderPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodgetPluginConfig(): null

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

methodonEditorDestroy(): void

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

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

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

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

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

Inherited members 42

Inherited from DocPlugin.

classDocDebugOverlayPlugin
class DocDebugOverlayPlugin extends DocPlugin<null>

Debug overlay for document block-level render bounds.

constructorDocDebugOverlayPlugin(): DocDebugOverlayPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving DocDebugOverlayPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodgetPluginConfig(): null

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

methodonEditorDestroy(): void

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

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

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

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

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

methodstart(): void

Starts runtime behavior after the first document frame.

Inherited members 41

Inherited from DocPlugin.

classHistoryPlugin
class HistoryPlugin extends DocPlugin<null>

Tracks committed document snapshots and contributes transaction-safe undo/redo commands.

constructorHistoryPlugin(input: DocInputPlugin, platform?: Platform): HistoryPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving HistoryPlugin.

methodapply(_state: null, _transaction: Transaction): null

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

methodconfigure(context: DocPluginSetupContext): void

Registers document undo and redo shortcuts with the composed keyboard adapter.

methodgetPluginConfig(): null

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

methodgetStatus(): DocHistoryStatus
methodinitialize(): void

Aligns the history baseline with state restored before Core initialization.

methodonEditorDestroy(): void

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

methodonTransactionCommitted(transaction: Transaction): void

Updates history only after Core has committed the owning document transaction.

methodregisterCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

methodregisterKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

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

methodregisterObservations(observations: ObservationRegistry): void

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

methodregisterSessionState(registry: SessionStateRegistry): void

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

methodregisterState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

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

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

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

methodsubscribe(listener: (status: DocHistoryStatus): void): (): void
Inherited members 36

Inherited from DocPlugin.

classSelectionPlugin
class SelectionPlugin extends DocPlugin<null>

Owns document selection commands, select-all shortcut, and pointer drag selection.

constructorSelectionPlugin(input: DocInputPlugin): SelectionPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving SelectionPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodgetPluginConfig(): null

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

methodonEditorDestroy(): void

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

methodregisterCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

methodregisterKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

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

methodregisterObservations(observations: ObservationRegistry): void

Registers the host-facing selection observation.

methodregisterSessionState(registry: SessionStateRegistry): void

Registers selection-owned local remount state.

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

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

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

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

methodstart(): void

Starts runtime behavior after the first document frame.

Inherited members 37

Inherited from DocPlugin.

classTextInputPlugin
class TextInputPlugin extends DocPlugin<null>

Owns printable text input and delete bindings.

constructorTextInputPlugin(): TextInputPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving TextInputPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodgetPluginConfig(): null

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

methodonEditorDestroy(): void

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

methodregisterCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

methodregisterKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

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

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

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

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

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

methodregisterServices(context: DocPluginServiceContext): voidstatic

Registers text node model support owned by this plugin.

Inherited members 39

Inherited from DocPlugin.

variableDefaultDocFeaturePlugins
DefaultDocFeaturePlugins: readonly [typeof ParagraphPlugin, typeof CompositionPlugin, typeof TextInputPlugin, typeof SelectionPlugin, typeof CaretPlugin, typeof DocContentRenderPlugin, typeof RichTextLineBoxPlugin, typeof FontFamilyTextStylePlugin, typeof FontSizeTextStylePlugin, typeof BoldTextStylePlugin, typeof ItalicTextStylePlugin, typeof UnderlineTextStylePlugin, typeof StrikethroughTextStylePlugin, typeof TextColorStylePlugin, typeof TablePlugin, typeof HistoryPlugin]

Default feature plugins installed by createDocEditor unless overridden.

functionregisterDefaultDocFeatures
registerDefaultDocFeatures(container: Container, manager: PluginManager<SearCoreDoc, NodeProperties>, implementations: false | readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]

Registers the default document feature plugins selected for one editor instance.

functionregisterDocFeaturePlugins
registerDocFeaturePlugins(container: Container, manager: PluginManager<SearCoreDoc, NodeProperties>, implementations: readonly DocPluginImplementation<DocPlugin<unknown>>[] | undefined): DocPlugin<unknown>[]

Registers document feature plugin instances with the Core-owned PluginManager.

enumBoldTextStyleKey

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

enum memberBold: "bold"
variableDocCaretPluginKey
DocCaretPluginKey: PluginKey
variableDocCompositionPluginKey
DocCompositionPluginKey: PluginKey
variableDocContentRenderPluginKey
DocContentRenderPluginKey: PluginKey

Default document feature plugin keys used by command pipelines.

classDocPlugin
class DocPlugin<StateType> extends Plugin<SearCoreDoc, NodeProperties, StateType>, PluginExtension<DocCommandBus, ObservationRegistry, SessionStateRegistry, DocRuntimeExtensionRegistry>

Convenience base class for a Plugin targeting createDocEditor().

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

Creates a plugin with its stable identity and initial state.

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodinitialize(context: DocPluginRuntimeContext): void

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

methodonEditorDestroy(context: DocPluginRuntimeContext): void

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

methodregisterBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

methodregisterCapabilities(registry: DocRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this document plugin.

methodregisterCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

methodregisterInlineStyleRenderers(registry: RichTextRunRenderRegistry): void

Registers plugin-owned render behavior for styled text runs.

methodregisterInlineStyles(registry: RichTextInlineStyleRegistry): void

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

methodregisterKeyboardHandlers(context: DocKeyboardHandlerRegistrationContext): void

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

methodregisterLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

methodregisterObservations(observations: ObservationRegistry): void

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

methodregisterSessionState(registry: SessionStateRegistry): void

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

methodstart(context: DocPluginRuntimeContext): void

Starts runtime behavior after the first document frame.

methodregisterServices(context: DocPluginServiceContext): voidstatic

Registers bindings required before this Doc plugin is instantiated.

Inherited members 34

Inherited from Plugin.

interfaceDocPluginImplementation
interface DocPluginImplementation<TPlugin>

Injectable DocPlugin class accepted by createDocEditor().

interfaceDocPluginRuntime

Stable host capabilities supplied to a DocPlugin after editor assembly.

propertyreadonly commands: DocCommandBus

Command bus exposed by the document editor instance.

propertyreadonly document: { blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }

Rich-document domain services.

propertyreadonly events: { engine: EventEngine<NodeProperties>; registrar: EventRegistrar }

Event and hit-test services used by document interactions.

propertyreadonly extensions: DocRuntimeExtensionRegistry

Extension capability registry for third-party document plugins.

propertyreadonly input: { keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }

Host input adapters used by document editing commands.

propertyreadonly observations: ObservationRegistry

Typed state and event observations owned by this editor instance.

propertyreadonly platform: Platform

Platform adapter for timers, resize observation, and diagnostics.

propertyreadonly plugins: PluginManager<SearCoreDoc, NodeProperties>

Ordered document plugin registry for this editor.

propertyreadonly render: { context: RenderContext; engine: DocRenderEngineCapability }

Document render services and visible context.

propertyreadonly scroll: { manager: ScrollManager }

Scroll state shared by document layout and rendering.

propertyreadonly session: SessionStateRegistry

Local remount state contributed by built-in and third-party plugins.

propertyreadonly textShaper: TextShaper

Text shaper used by document layout and rendering.

variableDocPluginRuntimeCapability
DocPluginRuntimeCapability: { CaretState: DocRuntimeCapability<DocCaretStateCapability>; Composition: DocRuntimeCapability<DocCompositionManager>; InputBindings: DocRuntimeCapability<DocInputBindingRegistryCapability>; Interaction: DocRuntimeCapability<DocInteractionRuntime> }

Runtime extension tokens owned by document plugins assembled by editor composition roots.

interfaceDocPluginRuntimeContext
interface DocPluginRuntimeContext extends DocPluginSetupContext

Document setup capabilities plus the Core created by createDocEditor().

propertyreadonly core: SearCoreDoc

Core document runtime.

Inherited members 2

Inherited from DocPluginSetupContext.

interfaceDocPluginServiceContext

Services available while createDocEditor() registers document plugins.

propertyreadonly container: Container

DI container used by the document assembly root.

interfaceDocPluginSetupContext

Typed public services available before createDocEditor() starts Core.

propertyreadonly container: Container

DI container used by the document assembly root.

propertyreadonly runtime: DocPluginRuntime

Runtime services available to document plugins.

enumFontFamilyTextStyleKey

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

enumFontSizeTextStyleKey

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

classParagraphPlugin
class ParagraphPlugin extends DocPlugin<null>

Registers paragraph and text node model support plus block-level commands.

constructorParagraphPlugin(): ParagraphPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving ParagraphPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodgetPluginConfig(): null

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

methodonEditorDestroy(): void

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

methodregisterBlockFlows(registry: RichTextBlockFlowRegistry): void

Registers plugin-owned top-level block flow resolvers.

methodregisterCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

methodregisterKeyboardHandlers(__namedParameters: DocKeyboardHandlerRegistrationContext): void

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

methodregisterLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

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

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

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

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

methodregisterServices(context: DocPluginServiceContext): voidstatic

Registers paragraph node model support owned by this plugin.

Inherited members 37

Inherited from DocPlugin.

functionregisterDocPluginCapabilities
registerDocPluginCapabilities(plugins: readonly unknown[], registry: DocRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by document plugins.

functionregisterDocPluginCommands
registerDocPluginCommands(plugins: readonly unknown[], commands: DocCommandBus): (): void
functionregisterDocPluginInlineStyles
registerDocPluginInlineStyles(plugins: readonly unknown[], registry: RichTextInlineStyleRegistry): (): void

Registers every inline text-style contribution owned by document plugins.

functionregisterDocPluginLineBoxes
registerDocPluginLineBoxes(plugins: readonly unknown[], registry: RichTextLineBoxRegistry): (): void

Registers every rich-text line box contribution owned by document plugins.

functionregisterDocPluginObservations
registerDocPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void

Registers every typed observation source contributed by document plugins.

functionregisterDocPluginSessionStates
registerDocPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): void

Registers every local session-state adapter contributed by document plugins.

typeRichTextInlineStyle
type RichTextInlineStyle = Readonly<Record<string, unknown>>

Domain-neutral inline style bag carried by measured rich-text chars.

classRichTextLineBoxPlugin
class RichTextLineBoxPlugin extends DocPlugin<null>

Registers rich-text line box resolution for document layout.

constructorRichTextLineBoxPlugin(): RichTextLineBoxPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving RichTextLineBoxPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodgetPluginConfig(): null

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

methodregisterLineBoxes(registry: RichTextLineBoxRegistry): void

Registers plugin-owned rich-text line box resolvers.

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

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

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

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

Inherited members 43

Inherited from DocPlugin.

classTablePlugin
class TablePlugin extends DocPlugin<null>

Contributes table model and insertion command without adding table knowledge to Core.

constructorTablePlugin(): TablePlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving TablePlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodconfigure(context: DocPluginSetupContext): void

Configures the document editor before runtime start.

methodgetPluginConfig(): null

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

methodonEditorDestroy(): void

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

methodregisterCommands(commands: DocCommandBus): void

Registers every stable command id owned by this document plugin.

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

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

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

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

methodregisterServices(context: DocPluginServiceContext): voidstatic

Registers table node model support owned by this plugin.

Inherited members 40

Inherited from DocPlugin.

enumTextColorStyleKey

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

enum memberColor: "color"

Document rendering and viewport

classDocCaretState

Shared caret blink state used by document feature plugins and render layout.

constructorDocCaretState(): DocCaretState
propertyreadonly symbol: typeof symbolstatic

DI token for resolving caret state owned by CaretPlugin.

methodenforceCommandBoundary(isCommandExecuting: (): boolean): void

Closes direct caret writes after editor assembly.

methodisVisible(): boolean

Returns whether the caret should be painted in the current frame.

methodreset(): void

Restarts the blink cycle with the caret visible.

methodsetVisible(visible: boolean): void

Sets the current caret visibility.

methodtoggle(): boolean

Toggles the caret visibility for a blink tick.

classDocRenderLayoutService

Owns Doc layout cache, page map, and viewport range derivation.

constructorDocRenderLayoutService(inputPlugin: DocInputPlugin, extensions: DocRuntimeExtensionRegistry, renderContext: RenderContext, scrollManager: ScrollManager, sceneTree: Tree<PositionRect<templateLiteral>>, configuration: DocEditorRuntimeConfiguration, configEngine: ConfigEngine, cursorManager: DocCursorManager, compositionProvider: DocCompositionProvider, layoutEngine: DocLayoutEngine, virtualLayouts: DocVirtualLayoutStore, commands: DocCommandBus): DocRenderLayoutService

Creates a render-layout service for one standalone document editor.

propertyreadonly symbol: typeof symbolstatic

DI token for resolving the render-layout service.

methodgetLatestVirtualLayoutSummary(): DocVirtualLayoutSummary | null
methodprepareRenderLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport, renderOperations?: DocRenderOperations): DocRenderLayout

Builds the current render layout before plugins produce render nodes.

methodprepareViewportLayout(contentRect: DocEditorContentRect, viewport: DocEditorViewport): DocRenderLayout

Reuses the previous full-document layout and updates only viewport-derived fields.

methodrecordBlockRenderDebugSnapshot(snapshot: DocBlockRenderDebugSnapshot): void

Records block-render reuse/debug stats for the latest render frame.

methodrecordRenderPrepareTiming(mode: DocRenderPrepareMode, durationMs: number): void
methodrefreshInteractionLayout(contentRect: DocEditorContentRect, _viewport: DocEditorViewport): DocRenderLayout | null

Reuses the latest layout snapshot and refreshes selection/caret geometry only.

methodreset(): void

Clears cached layout and page state.

methodsubscribeVirtualLayoutSummary(listener: DocVirtualLayoutSummaryListener): (): void
interfaceDocEditorContentRect
interface DocEditorContentRect extends DocEditorViewport

Rectangle used for document text layout and rendering.

propertyx: number

Left edge in host-view coordinates.

propertyy: number

Top edge in host-view coordinates.

Inherited members 2

Inherited from DocEditorViewport.

interfaceDocEditorViewport

Viewport dimensions in host-view coordinates.

propertyheight: number

Viewport height in host-view units.

propertywidth: number

Viewport width in host-view units.

interfaceDocRenderLayout

Layout/cache/page-map result exposed to document plugins for one render pass.

propertyreadonly blockLayoutDiff: DocBlockLayoutDiff

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

propertyreadonly composingCaretPixelOffset: number

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

propertyreadonly cursorX: number

Cursor x in world coordinates.

propertyreadonly cursorY: number

Cursor y in world coordinates.

propertyreadonly documentRect: { height: number; width: number; x: number; y: number }

Current document layout rectangle in world coordinates.

propertyreadonly layoutCache: DocLayoutCache

Latest full-document layout cache.

propertyreadonly pageMap: DocPageMap

Latest page map derived from the layout cache.

propertyreadonly visibleBlocks: readonly DocBlockLayout[]

Laid-out blocks selected for plugin-owned render nodes.

interfaceDocViewportSessionState

Local viewport position retained while remounting one document editor.

interfaceRichTextRenderNodeProperties
interface RichTextRenderNodeProperties extends NodeProperties

Render-node properties used by rich-text scene graphs.

propertyreadonly blockId?: string

Stable top-level rich-text block id.

propertyreadonly blockIndex?: number

Top-level rich-text block index.

propertyreadonly lineIndex?: number

Layout line index inside the full rich-text snapshot.

propertyreadonly renderRole?: "block" | "line" | "page" | "text-run" | "selection" | "caret" | "composition"

Semantic role for rich-text render nodes.

Inherited members 25

Inherited from NodeProperties.

typeDocVirtualLayoutSummaryListener
type DocVirtualLayoutSummaryListener = (summary: DocVirtualLayoutSummary): void
variableDocViewportObservation
DocViewportObservation: StateObservationDefinition<DocViewportSessionState>

Current document viewport position exposed to hosts and plugins.

variableDocViewportSessionStateDefinition
DocViewportSessionStateDefinition: SessionStateDefinition<DocViewportSessionState>

Stable session-state identity owned by the document viewport assembly.

functioncreateRichTextRunRect
createRichTextRunRect(x: number, baselineY: number, width: number, height: number, fontAscent: number): PositionRect<templateLiteral>

Creates a world-space rectangle for one rich-text line/run.

functionregisterDocViewportCommands
registerDocViewportCommands(input: { commands: DocCommandBus; renderCoordinator: DocRenderCoordinator; scrollManager: ScrollManager; viewportEnvironment: DocViewportEnvironment }): void

Registers viewport-owned document commands on the editor command bus.

functionregisterDocViewportState
registerDocViewportState(session: SessionStateRegistry, observations: ObservationRegistry, scrollManager: ScrollManager): void

Registers viewport remount state and its host-facing observation.

Document state and observations

interfaceDocBaseServices

Base service instances created before runtime adapters and plugins are wired.

propertyreadonly configEngine: ConfigEngine

Configuration engine registered in the DI container.

propertyreadonly stage: SceneGraph<RichTextRenderNodeProperties>

Scene graph that owns standalone document content render nodes.

interfaceDocEditorChange

Snapshot delivered when the document content changes.

propertyreadonly document: RichDocNode[]

Cloned rich-document content after the change.

propertyreadonly text: string

Plain-text view using one newline between paragraphs.

interfaceDocHistoryEntry

Detached before/after snapshots for one committed document mutation.

interfaceDocHistorySessionState

Document-local undo and redo stacks retained during editor remounts.

interfaceDocHistoryStatus

Current document undo/redo availability.

interfaceDocInlineStyleStatus

Whether one inline style can be applied, is active, and has a common selected value.

propertyreadonly active: boolean
propertyreadonly enabled: boolean
propertyreadonly value: unknown

The common selected value, or null when unset or mixed.

interfaceDocRuntime

Runtime services assembled after Doc base services and host environment values are available.

propertyreadonly eventEngine: EventEngine<NodeProperties>

Event pipeline and hit-testing facade for document interactions.

propertyreadonly eventRegistrar: EventRegistrar

Event registrar selected by the host or the headless fallback.

propertyreadonly pluginManager: PluginManager<SearCoreDoc, NodeProperties>

Document plugin manager populated by feature registration.

propertyreadonly renderContexts: { hit: RenderContext; main: RenderContext; offScreen: RenderContext }

Render contexts for visible, off-screen, and hit-test layers.

propertyreadonly renderEngine: DocRenderEngine

Document render engine populated with the shared Sheet-like strategy chain.

propertyreadonly scrollManager: ScrollManager

Scroll manager coordinating document viewport state.

typeDocInlineStyleState
type DocInlineStyleState = Readonly<Record<string, DocInlineStyleStatus>>

Inline style state consumed by document toolbars and other host controls.

typeDocSessionState
type DocSessionState = SessionStateSnapshot

Opaque in-memory contributor snapshot retained while remounting a document editor.

variableDocDocumentObservation
DocDocumentObservation: StateObservationDefinition<DocEditorChange>

Committed document content exposed as an editor-local typed state observation.

variableDocHistorySessionStateDefinition
DocHistorySessionStateDefinition: SessionStateDefinition<DocHistorySessionState>

Stable session-state identity owned by document history.

variableDocHistoryStatusObservation
DocHistoryStatusObservation: StateObservationDefinition<DocHistoryStatus>

Undo/redo availability exposed as an editor-local state observation.

variableDocInlineStyleObservation
DocInlineStyleObservation: StateObservationDefinition<Readonly<Record<string, DocInlineStyleStatus>>>

Current inline-style availability and activation for the document selection.

variableDocSelectionObservation
DocSelectionObservation: StateObservationDefinition<DocSelection>

Current document selection exposed as an editor-local typed observation.

variableDocSelectionSessionStateDefinition
DocSelectionSessionStateDefinition: SessionStateDefinition<DocSelection>

Stable identity for local document selection retained during remounts.

functionregisterDocBaseServices
registerDocBaseServices(container: Container, adapters: DocEditorAdapters, _viewport: DocEditorViewport, defaultConfigOverrides?: EditorDefaultConfigOverrides<DocConfig>): DocBaseServices

Registers document editor base services into the DI container.

functionregisterDocConfigCommands
registerDocConfigCommands(commands: DocCommandBus, config: ConfigEngine<DocConfig>): void

Registers Doc configuration changes on the owning command bus.

functionregisterDocDocumentObservation
registerDocDocumentObservation(observations: ObservationRegistry, document: DocDocumentSessionCoordinator): void

Registers the document-owned read projection with the editor observation registry.

functionregisterDocInlineStyleObservation
registerDocInlineStyleObservation(observations: ObservationRegistry, input: DocInputPlugin, inlineStyles: RichTextInlineStyleRegistry): void

Registers the selection-derived inline-style state with the editor observation registry.

functionregisterDocRuntime
registerDocRuntime(container: Container, adapters: DocEditorAdapters, viewport: DocEditorViewport): DocRuntime

Registers render, input, scroll, command, and plugin runtime services for Doc.

functionregisterDocSessionStateCommands
registerDocSessionStateCommands(commands: DocCommandBus, session: SessionStateRegistry): void

Registers the in-memory document session capture command.

functionregisterDocStateSnapshotCommands
registerDocStateSnapshotCommands(commands: DocCommandBus, document: DocDocumentSessionCoordinator): void

Registers the document-owned state snapshot command.

variableDocRuntimeCapability
DocRuntimeCapability: { BlockFlows: DocRuntimeCapability<RichTextBlockFlowRegistry>; Commands: DocRuntimeCapability<DocCommandBus>; Config: DocRuntimeCapability<ConfigEngine<any>>; Document: DocRuntimeCapability<{ blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }>; Events: DocRuntimeCapability<{ engine: EventEngine<NodeProperties>; registrar: EventRegistrar }>; InlineStyles: DocRuntimeCapability<RichTextInlineStyleRegistry>; Input: DocRuntimeCapability<{ keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }>; LayoutService: DocRuntimeCapability<DocRenderLayoutServiceCapability>; … }

Document runtime capabilities registered by the default assembly root.

typeDocRuntimeCapabilityReader
type DocRuntimeCapabilityReader = RuntimeCapabilityReader

Read-only view of editor-local document runtime capabilities exposed to hosts.

variableDocRuntimeCapabilityToken
DocRuntimeCapabilityToken: { BlockFlows: DocRuntimeCapability<RichTextBlockFlowRegistry>; Commands: DocRuntimeCapability<DocCommandBus>; Config: DocRuntimeCapability<ConfigEngine<any>>; Document: DocRuntimeCapability<{ blockFlows: RichTextBlockFlowRegistry; core: SearCoreDoc; cursor: DocCursorManager; inlineStyles: RichTextInlineStyleRegistry; input: DocInputPlugin; layout: DocLayoutEngine; lineBoxes: RichTextLineBoxRegistry; nodes: DocNodeRegistry }>; Events: DocRuntimeCapability<{ engine: EventEngine<NodeProperties>; registrar: EventRegistrar }>; InlineStyles: DocRuntimeCapability<RichTextInlineStyleRegistry>; Input: DocRuntimeCapability<{ keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }>; LayoutService: DocRuntimeCapability<DocRenderLayoutServiceCapability>; … }

Document runtime capabilities registered by the default assembly root.

classDocRuntimeExtensionRegistry
class DocRuntimeExtensionRegistry extends RuntimeCapabilityRegistry

Registry of extension capabilities available to document plugins.

constructorDocRuntimeExtensionRegistry(): DocRuntimeExtensionRegistry
propertyreadonly symbol: typeof symbolstatic

DI token for resolving the document runtime extension registry.

Inherited members 7

Inherited from RuntimeCapabilityRegistry.

Sheet commands and snapshots

interfaceCaptureSheetSessionStateCommandResult
interface CaptureSheetSessionStateCommandResult extends SheetCommandResult

Result of capturing editor-local state for an in-memory workbook remount.

Inherited members 4

Inherited from SheetCommandResult.

interfaceExportSheetStateCommandResult
interface ExportSheetStateCommandResult extends SheetCommandResult

Command result for exporting the current sheet state snapshot.

The pipeline is intentionally empty: exporting state must not mutate OT state, request rendering, or produce local effects.

propertyreadonly sheetState: SheetDocumentState

Cloned state payload suitable for workbook persistence or sheet remounting.

Inherited members 4

Inherited from SheetCommandResult.

interfaceSheetScrollToInput

Public programmatic input for an absolute world-space viewport position.

typeSheetScrollInput
type SheetScrollInput = ScrollManagerState

Internal adapter input for one platform-originated scroll state update.

variableApplyViewportScrollCommand
ApplyViewportScrollCommand: SheetCommandDefinition<ScrollManagerState, SheetCommandResult>
variableCaptureSheetSessionStateCommand
CaptureSheetSessionStateCommand: SheetCommandDefinition<void, CaptureSheetSessionStateCommandResult>

Captures local state that must survive switching away from one workbook sheet.

variableExportSheetStateCommand
ExportSheetStateCommand: SheetCommandDefinition<void, ExportSheetStateCommandResult>

Host command that exports a cloned state snapshot for the active SheetEditor.

variableResizeSheetViewportCommand
ResizeSheetViewportCommand: SheetCommandDefinition<{ height: number; width: number }, SheetCommandResult>
variableScrollViewportToCommand
ScrollViewportToCommand: SheetCommandDefinition<SheetScrollToInput, SheetCommandResult>
variableUnregisterSheetInputValidatorCommand
UnregisterSheetInputValidatorCommand: SheetCommandDefinition<number, SheetCommandResult>

Removes one editor-local input validator through the Sheet command bus.

variableUpdateSheetDefaultConfigCommand
UpdateSheetDefaultConfigCommand: SheetCommandDefinition<EditorDefaultConfigOverrides<SheetConfig>, SheetCommandResult>

Updates editor-local Sheet defaults without changing document state.

functioncloneSheetDocumentState
cloneSheetDocumentState(state: SheetDocumentState): SheetDocumentState

Takes ownership of an input Sheet snapshot without retaining caller-owned mutable values.

functioncreateDefaultSheetDocumentStateExportRegistry
createDefaultSheetDocumentStateExportRegistry(): DocumentStateCodecRegistry<SheetDocumentState>

Creates the default registry for built-in Sheet document-state modules.

functioncreateEmptySheetDocumentState
createEmptySheetDocumentState(rowCount: number, columnCount: number): SheetDocumentState

Creates an empty Sheet document with matching dimensions for import adapters.

functiondeserializeSheetDocumentState
deserializeSheetDocumentState<TSheetState>(payload: unknown, registry?: DocumentStateCodecRegistry<TSheetState>, path?: string): TSheetState

Deserializes one Sheet document state through registered state-owner codecs.

functionregisterSheetStateSnapshotCommands
registerSheetStateSnapshotCommands(commands: SheetCommandBus, pluginManager: PluginManager<SearCoreSheet, CellProperties>): void

Registers sheet state snapshot commands for the default sheet assembly.

functionserializeSheetDocumentState
serializeSheetDocumentState<TSheetState>(sheetState: TSheetState, registry?: DocumentStateCodecRegistry<TSheetState>): SearSheetDocumentFile

Serializes one Sheet document state through registered state-owner codecs.

Sheet plugins and capabilities

classDefaultSheetClipboardDataSource
class DefaultSheetClipboardDataSource extends SheetClipboardDataSource

Default data source bridging clipboard commands to the active Sheet data view.

constructorDefaultSheetClipboardDataSource(dataEngine: DataEngine, queries: SheetQueryRegistry, ownerFormats: SheetFormatTransferRegistry, platform: Platform, rangeMoves: SheetRangeMoveRegistry, cutSession: SheetClipboardCutSession, identity: SheetClipboardSheetIdentity, inputValidation: SheetCellInputValidationRegistry): DefaultSheetClipboardDataSource
propertyreadonly cutSession: SheetClipboardCutSession
propertyreadonly cutSourceId: string
propertyreadonly formatTarget: PluginKey
propertyreadonly target: PluginKey
methodbindPreviewRuntime(core: SearCoreSheet, plugins: PluginManager<SearCoreSheet, CellProperties>, bridge: SheetClipboardWorkbookBridge | null): void
methodcaptureMergedRanges(range: SheetRangeBounds): readonly SheetClipboardMergedRange[]
methodcaptureOwnerFormats(range: SheetRangeBounds): readonly SheetPortableFormatTransfer[]
methodclearOwnerFormats(range: SheetRangeBounds): readonly SheetFormatTransferPlan[]
methodcreateClipboardCutId(): string
methodgetColumnCount(): number
methodgetMergedRange(row: number, column: number): SheetRangeBounds | null

Optional host projection for rejecting writes hidden by merged cells.

methodgetRowCount(): number
methodgetSelection(): SheetRangeBounds | null
methodisRowVisible(row: number): boolean
methodplanClearMergedRanges(range: SheetRangeBounds): { operations: UpdateCellOTOperation<SheetCellMerge>[]; target: PluginKey }
methodplanOwnerFormats(captured: readonly SheetPortableFormatTransfer[], target: SheetRangeBounds): readonly SheetFormatTransferPlan[]
methodplanPasteMergedRanges(merges: readonly SheetClipboardMergedRange[], target: SheetClipboardCellPoint): { operations: UpdateCellOTOperation<SheetCellMerge>[]; target: PluginKey }
methodplanRangeMove(source: SheetClipboardRangeInput, destination: SheetClipboardRangeInput): readonly SheetRangeMovePlan[]
methodprepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): void
methodreadCell(row: number, column: number): CellMatrixElement | null
methodreadCellFormat(row: number, column: number): CellFormat | null
methodscheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>
methodvalidatePasteCell(row: number, column: number, cell: CellMatrixElement | null): SheetCellInputValidationResult

Optional editor-local validation applied before any pasted value is written.

classSheetDebugOverlayPlugin
class SheetDebugOverlayPlugin extends SheetPlugin<null>

Empty Sheet debug overlay placeholder used by hosts that enable ?debug.

constructorSheetDebugOverlayPlugin(): SheetDebugOverlayPlugin
propertyreadonly symbol: typeof symbolstatic

DI token for resolving SheetDebugOverlayPlugin.

methodapply(_state: null, _transaction: unknown): null

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

methodgetPluginConfig(): null

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

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

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

methodrender(): Node<CellProperties>[] | null

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

Inherited members 44

Inherited from SheetPlugin.

classSheetPlugin
class SheetPlugin<StateType> extends Plugin<SearCoreSheet, CellProperties, StateType>, PluginExtension<SheetCommandBus, ObservationRegistry, SessionStateRegistry, SheetRuntimeExtensionRegistry, SheetQueryRegistry>

Convenience base class for a Plugin targeting createSheetEditor().

constructorSheetPlugin<StateType>(__namedParameters: PluginSpec<StateType>): SheetPlugin<StateType>

Creates a plugin with its stable identity and initial state.

methodconfigure(context: SheetPluginSetupContext): void

Configures the Sheet editor before its Core is created.

methodinitialize(context: SheetPluginRuntimeContext): void

Prepares behavior that requires initialized Core state but must run before the first frame and other runtime effects.

methodonEditorDestroy(context: SheetPluginRuntimeContext): void

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

This deliberately does not use the name destroy: DI containers may treat a no-argument destroy() method as an owned-instance disposer.

methodregisterCapabilities(registry: SheetRuntimeExtensionRegistry): void

Publishes typed runtime services owned by this plugin.

methodregisterCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): void

Registers plugin-owned properties used to compose rendered Sheet cells.

methodregisterCommands(commands: SheetCommandBus): void

Registers every stable command id owned by this plugin.

methodregisterFormatTransfers(registry: SheetFormatTransferRegistry): void

Contributes owner-defined format capture and transfer plans.

methodregisterObservations(observations: ObservationRegistry): void

Registers typed state and event observations owned by this plugin.

methodregisterQueries(queries: SheetQueryRegistry): void
methodregisterRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes state-owner planning for same-sheet cell moves.

methodregisterSessionState(registry: SessionStateRegistry): void

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

methodregisterStructureMoves(registry: SheetStructureMoveRegistry): void

Contributes preflight and dependent operation planning for whole-axis reordering.

methodstart(context: SheetPluginRuntimeContext): void

Starts runtime behavior after the Core has rendered its first frame.

methodregisterServices(context: SheetPluginServiceContext): voidstatic

Registers bindings required before this Sheet plugin is instantiated.

Inherited members 34

Inherited from Plugin.

classSheetRuntimeExtensionRegistry
class SheetRuntimeExtensionRegistry extends RuntimeCapabilityRegistry

Registry for typed sheet runtime extension values.

Third-party plugins use this registry to publish and consume capabilities without mutating the runtime facade shape directly.

Inherited members 7

Inherited from RuntimeCapabilityRegistry.

interfaceSheetPluginImplementation
interface SheetPluginImplementation<TPlugin>

Injectable SheetPlugin class accepted by createSheetEditor().

interfaceSheetPluginRuntime
interface SheetPluginRuntime extends SheetPluginSetupRuntime

Runtime capabilities available after the command bus is bound and Core exists.

Inherited members 19

Inherited from SheetPluginSetupRuntime.

interfaceSheetPluginRuntimeContext
interface SheetPluginRuntimeContext extends SheetPluginSetupContext

Sheet setup capabilities plus the Core created by createSheetEditor().

Inherited members 2

Inherited from SheetPluginSetupContext.

interfaceSheetPluginServiceContext

Services available while createSheetEditor() registers Sheet plugins.

interfaceSheetPluginSetupRuntime

Stable host capabilities available before the command bus and Core are ready. Services are grouped by responsibility so plugins need not rely on untyped container lookups for normal extension work.

propertyreadonly cells: { catalog: CellTypeCatalog }
propertyreadonly collaboration: { session: Pick<CollaborationSession, "getStatus"> }
propertyreadonly config: ConfigEngine
propertyreadonly data: SheetDataEngine
propertyreadonly embeddedEditor?: { editor: SheetEmbeddedEditor }

Optional Sheet-facing rich-text editor supplied by the host.

propertyreadonly events: { engine: EventEngine<CellProperties>; registrar: EventRegistrar }
propertyreadonly extensions: SheetRuntimeExtensionRegistry
propertyreadonly formula: { externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; results: FormulaResultProviderRegistry; richResults: FormulaRichResultProviderRegistry; sources: FormulaSourceProviderRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }
propertyreadonly input: { cursor: CursorEngine; cursorRules: CursorRegistry; keyboard: KeyboardRouter; pointer: PointerCapture; text: TextInput }
propertyreadonly interaction: { pipelineSteps: PipelineStepExecutorRegistry; reducers: SheetInteractionReducerRegistry; store: SheetInteractionStore }
propertyreadonly lifecycle: SheetLifecycleCoordinator
propertyreadonly observations: ObservationRegistry
propertyreadonly platform: Platform
propertyreadonly plugins: PluginManager<SearCoreSheet, CellProperties>
propertyreadonly queries: SheetQueryRegistry
propertyreadonly render: { cellVisualReaders: SheetCellVisualReaderRegistry; contexts: { hit: RenderContext; main: RenderContext; offScreen: RenderContext }; coordinator: SheetRenderCoordinatorManager; dirtyTracker: GenerationalDirtyTracker; dirtyTree: Tree<PositionRect<templateLiteral>>; engine: SheetRenderEngine; rendererRegistry: SheetRendererRegistry<CellProperties>; stage: SceneGraph<CellProperties>; … }
propertyreadonly scroll: { coordinates: CoordinateEngine; manager: ScrollManager; scroller: Scroller; transformer: CoordinateTransformer }
propertyreadonly session: SessionStateRegistry

Editor-local capture and restore registry shared by every session-state owner.

propertyreadonly textShaper: TextShaper
typeSheetRuntimeCapabilityReader
type SheetRuntimeCapabilityReader = RuntimeCapabilityReader

Read-only view of editor-local runtime capabilities exposed to hosts.

typeSheetRuntimeCapabilityToken
type SheetRuntimeCapabilityToken = RuntimeCapability<T>

Typed extension capability exposed through the sheet runtime facade.

variableSheetRuntimeCapability
SheetRuntimeCapability: { Cells: SheetRuntimeCapability<{ catalog: CellTypeCatalog }>; Collaboration: SheetRuntimeCapability<{ session: Pick<CollaborationSession, "getStatus"> }>; Commands: SheetRuntimeCapability<SheetCommandBus>; Config: SheetRuntimeCapability<ConfigEngine<any>>; Data: SheetRuntimeCapability<SheetDataEngine>; EmbeddedEditor: SheetRuntimeCapability<{ editor: SheetEmbeddedEditor }>; Events: SheetRuntimeCapability<{ engine: EventEngine<CellProperties>; registrar: EventRegistrar }>; Formula: SheetRuntimeCapability<{ externalServices: IFormulaExternalServiceProvider; functions: IFunctionRegistry; results: FormulaResultProviderRegistry; richResults: FormulaRichResultProviderRegistry; sources: FormulaSourceProviderRegistry; textServices: IFormulaTextServiceProvider; webService: WebServiceClient; xmlXPath: XmlXPathEvaluator }>; … }
functiondefineSheetRuntimeCapability
defineSheetRuntimeCapability<T>(id: string): SheetRuntimeCapability<T>

Defines a typed runtime capability token.

ReturnsImmutable capability descriptor.

id

Stable capability id.

functionregisterSheetConfigCommands
registerSheetConfigCommands(commands: SheetCommandBus, config: ConfigEngine<SheetConfig>): void

Registers Sheet configuration changes on the owning command bus.

functionregisterSheetPluginCapabilities
registerSheetPluginCapabilities(plugins: readonly unknown[], registry: SheetRuntimeExtensionRegistry): void

Publishes every typed runtime capability contributed by Sheet plugins.

functionregisterSheetPluginCellVisualReaders
registerSheetPluginCellVisualReaders(plugins: readonly unknown[], registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): void

Registers every plugin-owned Sheet cell visual reader.

functionregisterSheetPluginCommands
registerSheetPluginCommands(plugins: readonly unknown[], commands: SheetCommandBus): void
functionregisterSheetPluginObservations
registerSheetPluginObservations(plugins: readonly unknown[], observations: ObservationRegistry): void

Registers every typed observation source contributed by Sheet plugins.

functionregisterSheetPluginQueries
registerSheetPluginQueries(plugins: readonly unknown[], queries: SheetQueryRegistry): void
functionregisterSheetPluginSessionStates
registerSheetPluginSessionStates(plugins: readonly unknown[], registry: SessionStateRegistry): void

Registers every local session-state adapter contributed by Sheet plugins.

Sheet viewport and session

interfaceSheetViewportSessionState

Local viewport position retained while remounting one workbook sheet.

typeSheetSessionState
type SheetSessionState = SessionStateSnapshot

Opaque, in-memory contributor snapshot retained per sheet while a workbook editor is open.

variableSheetClipboardWorkbookBridgeSymbol
SheetClipboardWorkbookBridgeSymbol: typeof SheetClipboardWorkbookBridgeSymbol
variableSheetViewportSessionStateDefinition
SheetViewportSessionStateDefinition: SessionStateDefinition<SheetViewportSessionState>

Stable session-state identity owned by the Sheet viewport assembly.

functionregisterSheetSessionStateCommands
registerSheetSessionStateCommands(commands: SheetCommandBus, session: SessionStateRegistry): void

Registers the in-memory Sheet session capture command.

functionregisterSheetViewportCommands
registerSheetViewportCommands(commands: SheetCommandBus, scrollManager: ScrollManager, resizeController: SheetViewportResizeController): void

Registers viewport-owned commands on the editor command bus.

functionregisterSheetViewportSessionState
registerSheetViewportSessionState(registry: SessionStateRegistry, scrollManager: ScrollManager): void

Registers viewport-owned local remount state with the editor-local registry.

Plugin and session setup

A session snapshot holds local editor state for remounting. Durable Sheet and Doc content stays in the document state.

functionregisterDefaultDependencies
registerDefaultDependencies(container: Container): void

Registers the small common runtime set into an explicit host container.

functiondefineDocRuntimeCapability
defineDocRuntimeCapability<T>(id: string): DocRuntimeCapability<T>

Creates a typed document runtime capability token.

functiondefineSessionState
defineSessionState<State>(id: string): SessionStateDefinition<State>

Creates an immutable typed identity for one local session value.

functionreadSessionState
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefined

Reads one contributor value from an opaque snapshot through its typed definition.

interfaceSessionStateAdapter
interface SessionStateAdapter<State>

Captures and restores one detached local session value.

propertyreadonly restoreAfter?: readonly SessionStateDefinition<unknown>[]

Contributors in the same phase that must restore before this one when they are registered.

propertyreadonly restorePhase: SessionStateRestorePhase

Lifecycle phase in which restore() may safely update the owning feature.

methodcapture(): State | undefined

Returns plain data or a supported built-in value; custom class instances are not session snapshots.

methodrestore(state: State): void

Restores local state during the declared lifecycle phase.

interfaceSessionStateDefinition
interface SessionStateDefinition<State>

Typed identity owned and exported by one local-state contributor.

propertyreadonly id: string

Stable, globally unique id used in the in-memory session snapshot.

propertyreadonly stateType?: State

Compile-time state carrier; never populated at runtime.

classSessionStateError
class SessionStateError extends SearError

Error raised when a session-state contributor violates its registry contract.

constructorSessionStateError(code: SessionStateErrorCode, message: string, details?: SearErrorDetails): SessionStateError

Creates a session-state contract error.

propertyreadonly code: SessionStateErrorCode

Stable machine-readable error code.

Inherited members 9

Inherited from SearError.

variableSessionStateErrorCode
SessionStateErrorCode: { invalidDefinition: "SEAR_SESSION_STATE_INVALID_DEFINITION"; invalidRestoreDependency: "SEAR_SESSION_STATE_INVALID_RESTORE_DEPENDENCY"; invalidRestoreOrder: "SEAR_SESSION_STATE_INVALID_RESTORE_ORDER"; invalidRestorePhase: "SEAR_SESSION_STATE_INVALID_RESTORE_PHASE"; registrationConflict: "SEAR_SESSION_STATE_REGISTRATION_CONFLICT"; restoreDependencyCycle: "SEAR_SESSION_STATE_RESTORE_DEPENDENCY_CYCLE"; restoreInProgress: "SEAR_SESSION_STATE_RESTORE_IN_PROGRESS"; restorePhaseClosed: "SEAR_SESSION_STATE_RESTORE_PHASE_CLOSED"; … }

Stable machine-readable errors raised by session-state contracts.

classSessionStateRegistry

Editor-local coordinator for all built-in and plugin-contributed session state.

constructorSessionStateRegistry(): SessionStateRegistry
propertyreadonly symbol: typeof symbolstatic

DI token for resolving the editor-local registry.

methodassertRestorationOpen(): void

Rejects a retained contributor restore callback after editor initialization.

methodcapture(): SessionStateSnapshot

Captures every registered contributor while preserving state whose owner is not loaded.

methodclear(lifecycleToken?: object): void

Clears contributors and retained state owned by this registry instance.

methodgetCompletedRestorePhases(): readonly SessionStateRestorePhase[]

Returns restore phases already completed by this editor lifecycle.

methodgetRegisteredStateIds(): readonly string[]

Returns sorted ids for currently registered contributors.

methodloadSnapshot(snapshot: SessionStateSnapshot): void

Loads a complete snapshot before lifecycle restoration begins.

methodregister<State>(definition: SessionStateDefinition<State>, adapter: SessionStateAdapter<State>): (): void

Registers one state owner and returns an idempotent disposer.

methodrestorePhase(phase: SessionStateRestorePhase): void

Restores every registered contributor assigned to one ordered lifecycle phase.

methodsealRestoration(lifecycleToken: object): void

Closes initialization-only restore operations for an assembled editor.

variableSessionStateRestorePhase
SessionStateRestorePhase: { AfterInitialize: "afterInitialize"; BeforeInitialize: "beforeInitialize" }

Ordered lifecycle phases in which local state may be restored.

typeSessionStateSnapshot
type SessionStateSnapshot = Readonly<Record<string, unknown>>

Opaque in-memory snapshot keyed by contributor-owned definition ids.