← All packages

API reference

@searsuite/sear-assembly-plugin

Plugin lifecycle, runtime capabilities, state contributions, and extension registries.

92 exportsderived from source

Concept 1

Register behavior with its owner

Plugin and PluginSpec describe an optional feature. During assembly, a plugin can register services, state, commands, queries, observations, capabilities, and codecs. Registration establishes who owns a value and which operation may change it. A feature that owns Sheet fill, for example, keeps its fill matrix and commands in its own package while the assembly only connects it to an editor.

Use when: adding optional built-in or third-party behavior. Choose the lowest layer that owns the behavior: portable values in a domain package, feature state and commands in a plugin, platform conversion in a host adapter. A plugin should not reach into another feature's state or duplicate its finite values.

Concept 2

Registration, commit, and teardown

The composition root runs explicit lifecycle phases. A state contribution is available before commands and consumers that need it; successful commands publish committed changes to observers and renderers. Resources acquired during registration must be released in reverse order when setup fails or the editor is destroyed.

PluginManager coordinates registration. Runtime capabilities expose editor-owned services to the host without exposing its dependency-injection container. Session adapters capture transient values across a Workbook Sheet remount; document codecs and versioned OT contributions handle durable export and collaboration separately.

classEditorLifecycleErrorsource ↗
class EditorLifecycleError extends SearError

Public error raised when lifecycle stack ownership is violated.

constructorconstructor
EditorLifecycleError(code: EditorLifecycleErrorCode, message: string, details?: SearErrorDetails): EditorLifecycleError
code: EditorLifecycleErrorCode
message: string
details: SearErrorDetails
propertycode
readonly code: EditorLifecycleErrorCode

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

classEditorLifecycleStacksource ↗
class EditorLifecycleStack

Idempotent reverse-order disposer stack used by editor composition roots.

constructorconstructor
EditorLifecycleStack(): EditorLifecycleStack
methodadd
add(disposer: (): void): void

Adds one owned resource disposer in acquisition order.

disposer: (): void
methoddispose
dispose(): void

Runs every disposer in reverse order and continues cleanup after individual failures.

classHeadlessToolbarsource ↗
class HeadlessToolbar extends SearToolbar

Toolbar implementation for hosts without a UI surface.

constructorconstructor
HeadlessToolbar(): HeadlessToolbar
propertysymbolstatic
readonly symbol: symbol

DI token for resolving HeadlessToolbar.

methoddestroy
destroy(): void

Releases resources owned by SearToolbar.

methodmount
mount(_target: unknown): void

Attaches this adapter to its host surface.

_target: unknown
classPluginsource ↗
class Plugin<SearCoreType, NodeTypeProperties, PluginStateType>

Base contract implemented by sheet and document plugins.

Plugins own their state, declare lifecycle hooks, transform transactions into state, and render scene nodes for their host core. Runtime packages should extend this contract rather than reaching into Core internals.

constructorconstructor
Plugin<SearCoreType, NodeTypeProperties, PluginStateType>(__namedParameters: PluginSpec<PluginStateType>): Plugin<SearCoreType, NodeTypeProperties, PluginStateType>

Creates a plugin with its stable identity and initial state.

__namedParameters: PluginSpec<PluginStateType>
propertydepth
readonly depth: number

Draw and event ordering hint; lower values run earlier.

propertydocumentState
readonly documentState?: PluginDocumentStateContribution<PluginStateType, object> | readonly PluginDocumentStateContribution<PluginStateType, object>[]

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: string[]

Declares which Sheet OT action names this plugin is interested in. The engine will only call apply when a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.

  • [&#39;uc&#39;, &#39;rr&#39;, &#39;rc&#39;] — only called for UpdateCell, ResizeRow, ResizeCol
  • [&#39;*&#39;] — called for any transaction (wildcard)
  • [] — only called for this plugin's own transactions
propertypluginKey
pluginKey: PluginKey

Stable plugin key used by PluginManager and SceneGraph ownership maps.

propertytransactionHistory
readonly transactionHistory?: PluginTransactionHistoryAdapter

Optional history behavior for transactions owned by this plugin.

propertytransactionOT
readonly transactionOT?: PluginTransactionOTContribution<OTOperation>

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: boolean

Whether PluginManager should warn when another ordered plugin shares this depth.

memberkey
key: unknown
methodapply
apply(pluginState: PluginStateType, transaction: Transaction): PluginStateType | null

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

pluginState: PluginStateType
transaction: Transaction
methoddirtyRect
dirtyRect(searCore: SearCoreType, transaction: Transaction): PositionRect<unknown> | null | undefined

Optional. Return the pixel-space dirty rectangle that needs to be redrawn after this plugin processes transaction.

When implemented, SearCoreSheet.dispatch will call markDirty with the returned rect and skip a full-canvas re-render for this plugin. When omitted (or when null/undefined is returned), dispatch falls back to a full render pass.

searCore: SearCoreType
transaction: Transaction
methodenforceRuntimeWriteBoundary
enforceRuntimeWriteBoundary(assertWrite: (): void): void

Installs the editor's command check for plugin-owned runtime sessions.

assertWrite: (): void
methodenforceStateWriteBoundary
enforceStateWriteBoundary(commitToken: object): void

Restricts state replacement to the owning editor's commit phase.

commitToken: object
methodgetPluginConfig
getPluginConfig(searCore: SearCoreType): unknown

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

searCore: SearCoreType
methodgetState
getState(): PluginStateType

Returns the plugin-owned state currently registered with the manager.

methodhasStateWriteBoundary
hasStateWriteBoundary(): boolean

Reports whether the owning runtime has taken control of state replacement.

methodlockCommittedState
lockCommittedState(state: PluginStateType): void

Optionally locks a committed plugin-owned local state value against retained handles.

state: PluginStateType
methodonClick
onClick(earCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Plugin pointer event handlers.

Return value contract:

  • Return false to stop subsequent plugins from handling the same event.
  • Return true / undefined / void to continue dispatching.

This mechanism allows a plugin to explicitly suppress downstream handlers after it has consumed an event, replacing the old coupled approach where one plugin directly modified another plugin's state.

earCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonDblClick
onDblClick(earCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles a double-click pointer event.

earCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonInitialDataCell
onInitialDataCell(searCore: SearCoreType, cell: unknown, row: number, col: number): void

Receives one non-empty cell during SearCoreSheet's shared startup scan. The scan runs once after every plugin state has been registered, so plugins can build derived indexes without independently traversing the whole sheet.

searCore: SearCoreType
cell: unknown
row: number
col: number
methodonInitialDataComplete
onInitialDataComplete(searCore: SearCoreType): void

Called after the final cell of the shared startup scan is delivered.

searCore: SearCoreType
methodonMouseDown
onMouseDown(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles the start of a pointer press sequence.

searCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonMouseMove
onMouseMove(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles pointer movement over the host surface.

searCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonMouseUp
onMouseUp(searCore: SearCoreType, event: EventWithOffsetAndTarget<NodeTypeProperties>): boolean | void

Handles the end of a pointer press sequence.

searCore: SearCoreType
event: EventWithOffsetAndTarget<NodeTypeProperties>
methodonResize
onResize(): void

Optional hook invoked when the host viewport or sheet dimensions change.

methodonScroll
onScroll(scrollManagerState: ScrollManagerState): void

Receives scroll state changes from the active scroll manager.

scrollManagerState: ScrollManagerState
methodonTransactionCommitted
onTransactionCommitted(transaction: Transaction): void

Runs only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.

transaction: Transaction

A committed transaction from the completed pipeline.

methodprojectTransaction
projectTransaction(state: PluginStateType, transaction: Transaction): readonly Transaction<Operation>[]

Purely plans owner-targeted prerequisites before another owner's explicit transaction. Sheet runtimes stage these once, atomically with the original transaction, and retain them in the command pipeline for history and collaboration. Never mutate input state.

state: PluginStateType
transaction: Transaction
methodregisterConfig
registerConfig(): PluginConfigRegistration<Record<string, unknown>>[]

Registers default configuration values owned by this plugin.

methodregisterState
registerState(): PluginStateRegistration<PluginStateType> | PluginStateRegistration<unknown>[]

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

methodrender
render(searCore: SearCoreType, offset?: { x: number; y: number }): Node<NodeTypeProperties> | Node<NodeTypeProperties>[] | null

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

searCore: SearCoreType
offset: { x: number; y: number }
methodsealRuntimeMetadata
sealRuntimeMetadata(): void

Fixes transaction and export metadata after the editor takes ownership.

methodsealRuntimeMethods
sealRuntimeMethods(): void

Pins transaction and render hooks after plugin startup.

methodsealRuntimeWrites
sealRuntimeWrites(): void

Closes runtime-owned extension writes after every plugin has initialized and started.

methodsetState
setState(state: PluginStateType, commitToken?: object): void

Replaces the plugin-owned state after an apply or runtime transition.

state: PluginStateType
commitToken: object
classPluginKeysource ↗
class PluginKey

Stable unique key assigned to one plugin instance.

Plugin managers use this key to store state, render nodes, and diagnostics without requiring plugin classes to be singleton values.

constructorconstructor
PluginKey(key?: string): PluginKey

Constructs a key using the provided base name.

key: string

Human-readable plugin key prefix.

propertykey
readonly key: string

Unique plugin key string.

classPluginManagersource ↗
class PluginManager<SearCoreType, NodeTypeProperties>

Ordered registry that owns plugin instances for one core/editor runtime.

constructorconstructor
PluginManager<SearCoreType, NodeTypeProperties>(platform?: Platform): PluginManager<SearCoreType, NodeTypeProperties>

Creates a PluginManager bound to the host diagnostics channel when available.

platform: Platform
propertysymbolstatic
readonly symbol: symbol

DI token for resolving the runtime plugin manager.

methodclearPlugins
clearPlugins(token?: object): void

Removes all registered plugins during host teardown.

token: object
methodenforceWriteBoundary
enforceWriteBoundary(token: object): void

Gives the owning runtime exclusive registry write access after assembly.

token: object
methodforEach
forEach(callbackfn: (plugin: Plugin<SearCoreType, NodeTypeProperties, any>): void): void

Visits plugins in depth order so event, apply and render flows stay deterministic.

callbackfn: (plugin: Plugin<SearCoreType, NodeTypeProperties, any>): void
methodgetAllPlugins
getAllPlugins(): Plugin<SearCoreType, NodeTypeProperties, any>[]

Returns all registered plugins in insertion order.

methodgetCollaborativeTransactionPlugin
getCollaborativeTransactionPlugin(ownerId: string): Plugin<SearCoreType, NodeTypeProperties, any> | undefined

Resolves a stable collaboration owner to its editor-local plugin instance.

ownerId: string
methodgetCollaborativeTransactionPlugins
getCollaborativeTransactionPlugins(): readonly Plugin<SearCoreType, NodeTypeProperties, any>[]

Lists collaborative transaction owners registered in this runtime.

methodgetDocumentStateContributions
getDocumentStateContributions(): readonly RegisteredPluginDocumentStateContribution[]

Lists document-state export contributions registered by plugin state owners.

methodgetPluginState
getPluginState<T>(key: PluginKey): T | undefined

Returns the state owned by a registered plugin key, if present.

key: PluginKey
methodgetTransactionHistoryAdapter
getTransactionHistoryAdapter(transaction: Transaction): PluginTransactionHistoryAdapter | undefined

Returns the history adapter contributed by a transaction's state owner.

transaction: Transaction
methodgetTransactionOTContribution
getTransactionOTContribution(transaction: Transaction): PluginTransactionOTContribution<OTOperation> | undefined

Returns the shared transaction OT contribution for one local transaction owner.

transaction: Transaction
methodinvertTransaction
invertTransaction(transaction: Transaction): Transaction<Operation> | null

Inverts a transaction through its owner's registered OT definition.

transaction: Transaction
methodregisterPlugin
registerPlugin<T>(plugin: Plugin<SearCoreType, NodeTypeProperties, T>, token?: object): void

Registers a plugin under its key and rejects duplicate ownership.

plugin: Plugin<SearCoreType, NodeTypeProperties, T>
token: object
methodtransformTransaction
transformTransaction(transaction: Transaction, other: Transaction): Transaction<Operation> | null

Rebases a retained transaction over another committed transaction through the shared registry.

transaction: Transaction
other: Transaction
methodunregisterPlugin
unregisterPlugin(pluginOrKey: string | PluginKey | Plugin<SearCoreType, NodeTypeProperties, any>, token?: object): void

Unregisters a plugin and clears the manager-owned state reference.

pluginOrKey: string | PluginKey | Plugin<SearCoreType, NodeTypeProperties, any>
token: object
classRuntimeCapabilityErrorsource ↗
class RuntimeCapabilityError extends SearError

Public error raised when a runtime capability contract is violated.

constructorconstructor
RuntimeCapabilityError(code: RuntimeCapabilityErrorCode, message: string, details?: SearErrorDetails): RuntimeCapabilityError
code: RuntimeCapabilityErrorCode
message: string
details: SearErrorDetails
propertycode
readonly code: RuntimeCapabilityErrorCode

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

classRuntimeCapabilityRegistrysource ↗
class RuntimeCapabilityRegistry extends RuntimeCapabilityReader

Editor-local registry shared by Sheet, Doc and Workbook assemblies.

constructorconstructor
RuntimeCapabilityRegistry(owner?: string): RuntimeCapabilityRegistry
owner: string
methoddestroy
destroy(): void

Permanently closes the registry and releases all published values.

methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for capability changes after assembly.

assertWrite: (): void
methodget
get<T>(capability: RuntimeCapability<T>): T | undefined
capability: RuntimeCapability<T>
methodgetRegisteredCapabilityIds
getRegisteredCapabilityIds(): readonly string[]
methodhas
has(capability: RuntimeCapability<unknown>): boolean
capability: RuntimeCapability<unknown>
methodregister
register<T>(capability: RuntimeCapability<T>, value: T): (): void

Registers one value and returns an idempotent disposer for that registration.

capability: RuntimeCapability<T>
value: T
methodrequire
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
classSearFormulaBarsource ↗
class SearFormulaBar

Platform-neutral lifecycle for a Sheet formula input surface.

constructorconstructor
SearFormulaBar(): SearFormulaBar
propertysymbolstatic
readonly symbol: symbol
methoddestroy
destroy(): void
methodmount
mount(target: unknown): void
target: unknown
classSearToolbarsource ↗
class SearToolbar

Platform-neutral toolbar lifecycle contract.

constructorconstructor
SearToolbar(): SearToolbar
propertysymbolstatic
readonly symbol: symbol

DI token for resolving SearToolbar.

methoddestroy
destroy(): void

Releases resources owned by SearToolbar.

methodmount
mount(target: unknown): void

Attaches this adapter to its host surface.

target: unknown
classSessionStateErrorsource ↗
class SessionStateError extends SearError

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

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

Creates a session-state contract error.

code: SessionStateErrorCode
message: string
details: SearErrorDetails
propertycode
readonly code: SessionStateErrorCode

Stable machine-readable error code.

Inherited members 9

Inherited from SearError.

classSessionStateRegistrysource ↗
class SessionStateRegistry

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

constructorconstructor
SessionStateRegistry(): SessionStateRegistry
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the editor-local registry.

methodassertRestorationOpen
assertRestorationOpen(): void

Rejects a retained contributor restore callback after editor initialization.

methodcapture
capture(): SessionStateSnapshot

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

methodclear
clear(lifecycleToken?: object): void

Clears contributors and retained state owned by this registry instance.

lifecycleToken: object
methodgetCompletedRestorePhases
getCompletedRestorePhases(): readonly SessionStateRestorePhase[]

Returns restore phases already completed by this editor lifecycle.

methodgetRegisteredStateIds
getRegisteredStateIds(): readonly string[]

Returns sorted ids for currently registered contributors.

methodloadSnapshot
loadSnapshot(snapshot: SessionStateSnapshot): void

Loads a complete snapshot before lifecycle restoration begins.

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

Registers one state owner and returns an idempotent disposer.

definition: SessionStateDefinition<State>
adapter: SessionStateAdapter<State>
methodrestorePhase
restorePhase(phase: SessionStateRestorePhase): void

Restores every registered contributor assigned to one ordered lifecycle phase.

phase: SessionStateRestorePhase
methodsealRestoration
sealRestoration(lifecycleToken: object): void

Closes initialization-only restore operations for an assembled editor.

lifecycleToken: object
classSheetFormatTransferRegistrysource ↗
class SheetFormatTransferRegistry

Editor-local composition of state-owner format transfers.

constructorconstructor
SheetFormatTransferRegistry(): SheetFormatTransferRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodcapturePortable
capturePortable(source: SheetMoveRange): readonly SheetPortableFormatTransfer[]
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans all format owners against the same unchanged pre-clear state.

range: SheetMoveRange
methoddestroy
destroy(): void
methodplanPortable
planPortable(captured: readonly SheetPortableFormatTransfer[], destination: SheetMoveRange): readonly SheetFormatTransferPlan[]
captured: readonly SheetPortableFormatTransfer[]
destination: SheetMoveRange
methodregister
register(owner: SheetFormatTransferContribution): (): void
owner: SheetFormatTransferContribution
classSheetRangeMoveRegistrysource ↗
class SheetRangeMoveRegistry

Editor-local range-move planning extension point shared by state owners.

constructorconstructor
SheetRangeMoveRegistry(): SheetRangeMoveRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodanalyze
analyze(context: SheetRangeMoveContext): SheetRangeMoveAnalysis

Assesses all owner constraints without planning or publishing any mutation.

context: SheetRangeMoveContext
methoddestroy
destroy(): void

Releases all editor-owned registrations.

methodhasConflict
hasConflict(context: SheetRangeMoveContext): boolean

Validates all owners before testing destination conflicts.

context: SheetRangeMoveContext
methodplan
plan(context: SheetRangeMoveContext): readonly SheetRangeMovePlan[]

Plans all owners against the same pre-move state.

context: SheetRangeMoveContext
methodregister
register(contribution: SheetRangeMoveContribution): (): void

Registers one owner and returns an idempotent disposer.

contribution: SheetRangeMoveContribution
classSheetRangeMoveRejectedErrorsource ↗
class SheetRangeMoveRejectedError extends SearError

A rejected assessment retains the state owner's stable diagnostic code.

constructorconstructor
SheetRangeMoveRejectedError(analysis: { context: SheetRangeMoveContext; issue: { code: string; details: SearErrorDetails; message: string; ownerId: string }; status: "blocked" }): SheetRangeMoveRejectedError

Creates the command failure from the same assessment consumed by preview.

analysis: { context: SheetRangeMoveContext; issue: { code: string; details: SearErrorDetails; message: string; ownerId: string }; status: "blocked" }
propertycode
readonly code: string

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

classSheetRangeReorderRegistrysource ↗
class SheetRangeReorderRegistry
constructorconstructor
SheetRangeReorderRegistry(): SheetRangeReorderRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void
methodplan
plan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]
context: SheetRangeReorderContext
methodregister
register(contribution: SheetRangeReorderContribution): (): void
contribution: SheetRangeReorderContribution
classSheetStructureMoveRegistrysource ↗
class SheetStructureMoveRegistry

Editor-local preflight and operation planning for complete-axis moves.

constructorconstructor
SheetStructureMoveRegistry(): SheetStructureMoveRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void

Releases editor-owned contributions.

methodplan
plan(context: SheetStructureMoveContext): readonly Operation[]

Validates the original intent before compiling dependent operation updates.

context: SheetStructureMoveContext
methodregister
register(contribution: SheetStructureMoveContribution): (): void

Registers one contribution with order-independent, idempotent disposal.

contribution: SheetStructureMoveContribution
interfacePluginCommandExtensionsource ↗
interface PluginCommandExtension<CommandBus>

Plugin capability for registering typed commands against one host command bus.

methodregisterCommands
registerCommands(commands: CommandBus): void

Registers every stable command id owned by this plugin.

commands: CommandBus
interfacePluginCommandRegistrarsource ↗
interface PluginCommandRegistrar<CommandBus>

Required-method view used by host assemblies when invoking command registration.

methodregisterCommands
registerCommands(commands: CommandBus): void

Registers every stable command id owned by this plugin.

commands: CommandBus
interfacePluginConfigRegistrationsource ↗
interface PluginConfigRegistration<ConfigType>

Default configuration contributed by one plugin during editor setup.

propertyconfig
readonly config: ConfigType

Plain configuration values consumed and wrapped by ConfigEngine.

propertykey
readonly key: PluginKey

Plugin key that owns this configuration unit.

interfacePluginDataEngineRegistrationOptionssource ↗
interface PluginDataEngineRegistrationOptions<PluginStateType>

Controls whether a plugin state registration is exposed through DataEngine and data views.

propertydataView
readonly dataView?: readonly PluginDataViewFieldRegistration<PluginStateType>[]

Field selectors contributed by this state to named read-only data views.

propertyenabled
readonly enabled?: boolean

When false, Core keeps the plugin private to PluginManager and skips DataEngine registration.

interfacePluginDataViewFieldRegistrationsource ↗
interface PluginDataViewFieldRegistration<PluginStateType>

Describes one plugin-owned field exposed to a named DataEngine read-only view.

propertyfieldKey
readonly fieldKey: string

Field name written into the named view. Duplicate names in one view are rejected by DataEngine.

propertyrequired
readonly required?: boolean

When false, a missing state or void field does not make the containing view unavailable.

propertyselect
readonly select: (state: PluginStateType): unknown

Reads the field value from the current plugin-owned state whenever the view is requested.

propertyviewKey
readonly viewKey: string

Named data view that receives this field, such as a sheet-level read model.

interfacePluginDocumentStateCodecsource ↗
interface PluginDocumentStateCodec<TDocumentState>

JSON-export codec shape supplied by a plugin-owned document-state module.

propertykey
readonly key: string
methoddeserialize
deserialize(payload: unknown, path: string): Partial<TDocumentState>
payload: unknown
path: string
methodserialize
serialize(state: TDocumentState): unknown
state: TDocumentState
interfacePluginDocumentStateContributionsource ↗
interface PluginDocumentStateContribution<TOwnerState, TDocumentState>

Document-state export contribution owned by one plugin state owner.

propertycodec
readonly codec: PluginDocumentStateCodec<TDocumentState>
propertykey
readonly key: string
methodcapture
capture(ownerState: TOwnerState): Partial<TDocumentState> | undefined
ownerState: TOwnerState
interfacePluginObservationExtensionsource ↗
interface PluginObservationExtension<ObservationRegistry>

Plugin capability for registering typed observations against one host observation registry.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers every typed state and event observation source owned by this plugin.

observations: ObservationRegistry
interfacePluginObservationRegistrarsource ↗
interface PluginObservationRegistrar<ObservationRegistry>

Required-method view used by host assemblies when invoking observation registration.

methodregisterObservations
registerObservations(observations: ObservationRegistry): void

Registers every typed state and event observation source owned by this plugin.

observations: ObservationRegistry
interfacePluginQueryRegistrarsource ↗
interface PluginQueryRegistrar<QueryRegistry>
methodregisterQueries
registerQueries(queries: QueryRegistry): void
queries: QueryRegistry
interfacePluginRuntimeCapabilityExtensionsource ↗
interface PluginRuntimeCapabilityExtension<RuntimeCapabilityRegistry>

Plugin capability for publishing typed editor-owned services to plugins and hosts.

methodregisterCapabilities
registerCapabilities(registry: RuntimeCapabilityRegistry): void

Registers every runtime capability owned by this plugin.

registry: RuntimeCapabilityRegistry
interfacePluginRuntimeCapabilityRegistrarsource ↗
interface PluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>

Required-method view used by host assemblies when invoking capability registration.

methodregisterCapabilities
registerCapabilities(registry: RuntimeCapabilityRegistry): void
registry: RuntimeCapabilityRegistry
interfacePluginSessionStateExtensionsource ↗
interface PluginSessionStateExtension<SessionStateRegistry>

Plugin capability for registering editor-local session capture and restore behavior.

methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
interfacePluginSessionStateRegistrarsource ↗
interface PluginSessionStateRegistrar<SessionStateRegistry>

Required-method view used by host assemblies when invoking session-state registration.

methodregisterSessionState
registerSessionState(registry: SessionStateRegistry): void

Registers every local session value owned by this plugin.

registry: SessionStateRegistry
interfacePluginSpecsource ↗
interface PluginSpec<T>

Immutable identity and initial state used to construct a plugin instance.

propertykey
key: PluginKey

Stable key under which the plugin registers state, config and scene nodes.

propertystate
state: T

Initial state owned by the plugin.

interfacePluginStateRegistrationsource ↗
interface PluginStateRegistration<PluginStateType>

State registration returned by plugins during editor initialization.

propertydataEngine
readonly dataEngine?: PluginDataEngineRegistrationOptions<PluginStateType>

DataEngine exposure metadata for this state registration.

propertykey
readonly key: PluginKey

Plugin key that owns the registered state.

propertystate
readonly state: PluginStateType

State value to register for that plugin key.

interfacePluginTransactionHistoryAdaptersource ↗
interface PluginTransactionHistoryAdapter

Converts one plugin-owned transaction into history operations and rebases retained history over transactions that committed later.

methodinvert
invert(transaction: Transaction): Transaction<Operation> | null

Creates the transaction that reverses the supplied committed transaction.

transaction: Transaction
methodtransform
transform(transaction: Transaction, other: Transaction): Transaction<Operation> | null

Rebases a retained transaction over a transaction that committed later.

transaction: Transaction
other: Transaction
interfacePluginTransactionHistoryOperationssource ↗
interface PluginTransactionHistoryOperations

Operation-level functions used to build one plugin-owned history adapter.

methodinvert
invert(operations: Operation[]): Operation[]

Reverses an operation list in rollback order.

operations: Operation[]
methodtransform
transform(operations: Operation[], other: Operation[]): Operation[]

Rebases an operation list over operations that committed later.

operations: Operation[]
other: Operation[]
interfacePluginTransactionOTContributionsource ↗
interface PluginTransactionOTContribution<OperationType>

Transaction algebra and collaboration metadata contributed by one state owner.

propertycollaborative
readonly collaborative?: boolean

Whether committed transactions owned by this plugin may cross a collaboration transport.

propertydefinition
readonly definition: TransactionOTDefinition<OperationType>

Versioned operation family used by history and collaboration.

propertyownerId
readonly ownerId: string

Stable wire identity independent from process-local PluginKey suffixes.

propertyrelations
readonly relations?: readonly OTTransformRelation<OTOperation, OTOperation>[]

Explicit relations needed by third-party operation families.

interfaceRegisteredPluginDocumentStateContributionsource ↗
interface RegisteredPluginDocumentStateContribution

Document-state export contribution bound to the plugin instance that owns the source state.

propertycontribution
readonly contribution: PluginDocumentStateContribution<unknown>
propertyplugin
readonly plugin: Plugin<unknown, NodeProperties, unknown>
interfaceRuntimeCapabilitysource ↗
interface RuntimeCapability<T>

Typed token used to publish an editor-owned runtime service to plugins and hosts.

propertyid
readonly id: string
propertysymbol
readonly symbol: symbol
propertytype
readonly type?: T

Phantom member preserving the capability value type.

interfaceRuntimeCapabilityReadersource ↗
interface RuntimeCapabilityReader

Read-only capability view exposed by an editor facade.

methodget
get<T>(capability: RuntimeCapability<T>): T | undefined
capability: RuntimeCapability<T>
methodgetRegisteredCapabilityIds
getRegisteredCapabilityIds(): readonly string[]
methodhas
has(capability: RuntimeCapability<unknown>): boolean
capability: RuntimeCapability<unknown>
methodrequire
require<T>(capability: RuntimeCapability<T>): T
capability: RuntimeCapability<T>
interfaceSessionStateAdaptersource ↗
interface SessionStateAdapter<State>

Captures and restores one detached local session value.

propertyrestoreAfter
readonly restoreAfter?: readonly SessionStateDefinition<unknown>[]

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

propertyrestorePhase
readonly restorePhase: SessionStateRestorePhase

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

methodcapture
capture(): State | undefined

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

methodrestore
restore(state: State): void

Restores local state during the declared lifecycle phase.

state: State
interfaceSessionStateDefinitionsource ↗
interface SessionStateDefinition<State>

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

propertyid
readonly id: string

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

propertystateType
readonly stateType?: State

Compile-time state carrier; never populated at runtime.

interfaceSheetFormatMatrixsource ↗
interface SheetFormatMatrix<Value>

Sparse read contract implemented by feature-owned matrices.

methodforEachStoredInRange
forEachStoredInRange(startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: Value, row: number, column: number): void): void
startRow: number
startColumn: number
endRow: number
endColumn: number
visit: (value: Value, row: number, column: number): void
methodgetDefaultValue
getDefaultValue(): Value | null | undefined
methodgetItem
getItem(row: number, column: number): Value | null | undefined
row: number
column: number
interfaceSheetFormatTransferContributionsource ↗
interface SheetFormatTransferContribution

Optional state-owner contribution to format painting.

propertyid
readonly id: string
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans removal of this owner's explicit formats without changing cell content.

range: SheetMoveRange
methodplanCaptured
planCaptured(portable: unknown, destination: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans a captured source pattern using this owner's current target state.

portable: unknown
destination: SheetMoveRange
interfaceSheetFormatTransferPlansource ↗
interface SheetFormatTransferPlan

One owner's isolated plan; only the owner interprets its operations.

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetFormatTransferRegistrarsource ↗
interface SheetFormatTransferRegistrar

Optional plugin lifecycle extension for format-transfer registration.

methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void
registry: SheetFormatTransferRegistry
interfaceSheetFormatTransferSnapshotsource ↗
interface SheetFormatTransferSnapshot

Captured format data, independent of subsequent source changes.

propertyportable
readonly portable?: unknown

Captured owner data that can be planned against another Sheet instance.

methodplan
plan(destination: SheetMoveRange, targetRegistry?: SheetFormatTransferRegistry): readonly SheetFormatTransferPlan[]
destination: SheetMoveRange
targetRegistry: SheetFormatTransferRegistry
interfaceSheetMoveRangesource ↗
interface SheetMoveRange

Zero-based inclusive bounds of a cell range.

propertyend
readonly end: readonly [number, number]
propertystart
readonly start: readonly [number, number]
interfaceSheetPortableFormatTransfersource ↗
interface SheetPortableFormatTransfer

Serializable owner snapshot for a transient clipboard payload.

propertyid
readonly id: string
propertyportable
readonly portable: unknown
interfaceSheetRangeMoveContextsource ↗
interface SheetRangeMoveContext

Normalized source and destination of a same-sheet cell move.

propertydestination
readonly destination: SheetMoveRange
propertysource
readonly source: SheetMoveRange
interfaceSheetRangeMoveContributionsource ↗
interface SheetRangeMoveContribution

A state owner's participation in range moves, independent of storage representation.

propertyid
readonly id: string

Unique registration identity, conventionally &lt;owner&gt;.rangeMove; not a document field or operation target.

methodhasConflict
hasConflict(context: SheetRangeMoveContext): boolean

Reports whether destination data outside the source would be replaced.

context: SheetRangeMoveContext
methodplan
plan(context: SheetRangeMoveContext): readonly SheetRangeMovePlan[]

Reads current state and produces an isolated operation plan.

context: SheetRangeMoveContext
methodtransformPlans
transformPlans(context: SheetRangeMoveContext, plans: readonly SheetRangeMovePlan[]): readonly SheetRangeMovePlan[]

Rewrites plans after every state owner has contributed, for derived references.

context: SheetRangeMoveContext
plans: readonly SheetRangeMovePlan[]
methodvalidate
validate(context: SheetRangeMoveContext): void

Reads owner-specific invariants without mutation; rejected constraints throw a SearError.

context: SheetRangeMoveContext
interfaceSheetRangeMovePlansource ↗
interface SheetRangeMovePlan

Operations produced by one state owner without mutating its live state.

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetRangeReorderContextsource ↗
interface SheetRangeReorderContext

One stable row permutation within an inclusive cell range.

propertydestinationOf
readonly destinationOf: (row: number): number

Maps a source row to its final row; columns never change.

propertyrange
readonly range: SheetMoveRange
interfaceSheetRangeReorderContributionsource ↗
interface SheetRangeReorderContribution

State owners contribute atomic updates without exposing their matrices to the sorter.

propertyid
readonly id: string
methodplan
plan(context: SheetRangeReorderContext): readonly SheetRangeReorderPlan[]
context: SheetRangeReorderContext
methodtransformPlans
transformPlans(context: SheetRangeReorderContext, plans: readonly SheetRangeReorderPlan[]): readonly SheetRangeReorderPlan[]
context: SheetRangeReorderContext
plans: readonly SheetRangeReorderPlan[]
methodvalidate
validate(context: SheetRangeReorderContext): void
context: SheetRangeReorderContext
interfaceSheetRangeReorderPlansource ↗
interface SheetRangeReorderPlan
propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetRangeRuleEntrysource ↗
interface SheetRangeRuleEntry<Rule>

A feature-owned rule and the rectangle it covers.

propertyrange
readonly range: SheetMoveRange
propertyrule
readonly rule: Rule
interfaceSheetRangeRuleFragmentsource ↗
interface SheetRangeRuleFragment<Rule>

One retained or relocated piece of an original rule.

propertyoriginal
readonly original: SheetRangeRuleEntry<Rule>
propertyplacement
readonly placement: "retained" | "moved"
propertyrange
readonly range: SheetMoveRange
interfaceSheetRangeRuleMoveAdaptersource ↗
interface SheetRangeRuleMoveAdapter<Rule>

Feature-specific storage and operation mapping for splittable range rules.

propertyid
readonly id: string
methodplan
plan(context: SheetRangeMoveContext, affected: readonly SheetRangeRuleEntry<Rule>[], fragments: readonly SheetRangeRuleFragment<Rule>[]): readonly SheetRangeMovePlan[]
context: SheetRangeMoveContext
affected: readonly SheetRangeRuleEntry<Rule>[]
fragments: readonly SheetRangeRuleFragment<Rule>[]
methodreadRules
readRules(): readonly SheetRangeRuleEntry<Rule>[]
methodvalidate
validate(context: SheetRangeMoveContext): void
context: SheetRangeMoveContext
interfaceSheetStructureMoveContextsource ↗
interface SheetStructureMoveContext

One original-state structure permutation owned by a matrix plugin.

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetStructureMoveContributionsource ↗
interface SheetStructureMoveContribution

Owner-local validation and dependent edits compiled before a structure move is staged.

propertyid
readonly id: string
methodtransformOperations
transformOperations(context: SheetStructureMoveContext): readonly Operation[]
context: SheetStructureMoveContext
methodvalidate
validate(context: SheetStructureMoveContext): void
context: SheetStructureMoveContext
typeEditorLifecycleErrorCodesource ↗
type EditorLifecycleErrorCode = typeof EditorLifecycleErrorCode[keyof typeof EditorLifecycleErrorCode]

Stable machine-readable errors raised by editor lifecycle stacks.

typePluginDataViewFieldSelectorsource ↗
type PluginDataViewFieldSelector = { select: unknown }["select"]

Controls whether a plugin state registration is exposed through DataEngine and collaboration.

typePluginExtensionsource ↗
type PluginExtension = PluginCommandExtension<CommandBus> & conditional & conditional & conditional & conditional

Minimal host-extension contract shared by Sheet, Doc, and Workbook plugin types.

typeRuntimeCapabilityErrorCodesource ↗
type RuntimeCapabilityErrorCode = typeof RuntimeCapabilityErrorCode[keyof typeof RuntimeCapabilityErrorCode]

Supported runtime capability error codes.

typeSessionStateErrorCodesource ↗
type SessionStateErrorCode = typeof SessionStateErrorCode[keyof typeof SessionStateErrorCode]

Supported session-state error codes.

typeSessionStateRestorePhasesource ↗
type SessionStateRestorePhase = typeof SessionStateRestorePhase[keyof typeof SessionStateRestorePhase]

A supported local-state restoration phase.

typeSessionStateSnapshotsource ↗
type SessionStateSnapshot = Readonly<Record<string, unknown>>

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

typeSheetFormatRangesource ↗
type SheetFormatRange = SheetMoveRange

Inclusive range shared by format-transfer owners and hosts.

typeSheetRangeMoveAnalysissource ↗
type SheetRangeMoveAnalysis = { context: SheetRangeMoveContext; status: typeof SheetRangeMoveStatus.Allowed | typeof SheetRangeMoveStatus.RequiresConfirmation } | { context: SheetRangeMoveContext; issue: { code: string; details: SearErrorDetails; message: string; ownerId: string }; status: typeof SheetRangeMoveStatus.Blocked }

A move assessment contains no operations and never mutates document state.

variableEditorLifecycleErrorCodesource ↗
EditorLifecycleErrorCode: { MultipleDisposalFailures: "SEAR_EDITOR_LIFECYCLE_MULTIPLE_DISPOSAL_FAILURES"; StackDisposed: "SEAR_EDITOR_LIFECYCLE_STACK_DISPOSED" }

Stable machine-readable errors raised by editor lifecycle stacks.

variableRuntimeCapabilityErrorCodesource ↗
RuntimeCapabilityErrorCode: { InvalidDefinition: "SEAR_RUNTIME_CAPABILITY_INVALID_DEFINITION"; NotRegistered: "SEAR_RUNTIME_CAPABILITY_NOT_REGISTERED"; RegistrationConflict: "SEAR_RUNTIME_CAPABILITY_REGISTRATION_CONFLICT"; RegistryDestroyed: "SEAR_RUNTIME_CAPABILITY_REGISTRY_DESTROYED" }

Stable machine-readable errors raised by runtime capability registries.

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

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

variableSessionStateRestorePhasesource ↗
SessionStateRestorePhase: { AfterInitialize: "afterInitialize"; BeforeInitialize: "beforeInitialize" }

Ordered lifecycle phases in which local state may be restored.

variableSheetRangeMoveStatussource ↗
SheetRangeMoveStatus: { Allowed: "allowed"; Blocked: "blocked"; RequiresConfirmation: "requiresConfirmation" }

Canonical outcomes shared by move preview and execution.

functionassertSheetContributionWritesource ↗
assertSheetContributionWrite(owner: object): void

Checks registration changes without adding work to query or planning paths.

owner: object
functioncloneSessionStateValuesource ↗
cloneSessionStateValue<T>(value: T): T

Copies a session snapshot without trusting extension-provided clone hooks.

value: T
functioncreateMatrixFormatTransfersource ↗
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<SheetFormatTransferContribution>

Captures sparse persisted formats and tiles them over an inclusive target.

id: string
target: PluginKey
readMatrix: (): SheetFormatMatrix<Value>
functioncreatePluginTransactionHistoryAdaptersource ↗
createPluginTransactionHistoryAdapter(operations: PluginTransactionHistoryOperations): PluginTransactionHistoryAdapter

Creates a transaction history adapter while preserving owner identity and metadata.

operations: PluginTransactionHistoryOperations
functioncreateRuntimeCapabilityReadersource ↗
createRuntimeCapabilityReader(registry: RuntimeCapabilityRegistry, hidden?: readonly RuntimeCapability<unknown>[]): RuntimeCapabilityReader

Exposes selected capabilities without handing hosts the mutable registry itself.

registry: RuntimeCapabilityRegistry
hidden: readonly RuntimeCapability<unknown>[]
functioncreateSheetRangeRuleMoveContributionsource ↗
createSheetRangeRuleMoveContribution<Rule>(adapter: SheetRangeRuleMoveAdapter<Rule>): SheetRangeMoveContribution

Creates a range-move contribution for rules that can be split at cell boundaries.

adapter: SheetRangeRuleMoveAdapter<Rule>
functiondefineRuntimeCapabilitysource ↗
defineRuntimeCapability<T>(id: string): RuntimeCapability<T>

Creates an immutable runtime capability definition with a stable process-wide identity.

id: string
functiondefineSessionStatesource ↗
defineSessionState<State>(id: string): SessionStateDefinition<State>

Creates an immutable typed identity for one local session value.

id: string
functionhasPluginCommandRegistrarsource ↗
hasPluginCommandRegistrar<CommandBus>(plugin: unknown): plugin

Returns whether a plugin contributes command registration for the current host.

plugin: unknown
functionhasPluginObservationRegistrarsource ↗
hasPluginObservationRegistrar<ObservationRegistry>(plugin: unknown): plugin

Returns whether a plugin contributes observation registration for the current host.

plugin: unknown
functionhasPluginQueryRegistrarsource ↗
hasPluginQueryRegistrar<QueryRegistry>(plugin: unknown): plugin
plugin: unknown
functionhasPluginRuntimeCapabilityRegistrarsource ↗
hasPluginRuntimeCapabilityRegistrar<RuntimeCapabilityRegistry>(plugin: unknown): plugin

Returns whether a plugin publishes runtime capabilities for the current editor.

plugin: unknown
functionhasPluginSessionStateRegistrarsource ↗
hasPluginSessionStateRegistrar<SessionStateRegistry>(plugin: unknown): plugin

Returns whether a plugin contributes local session-state registration for the current host.

plugin: unknown
functionintersectSheetMoveRangessource ↗
intersectSheetMoveRanges(left: SheetMoveRange, right: SheetMoveRange): SheetMoveRange | null

Returns the shared inclusive area of two ranges, if any.

left: SheetMoveRange
right: SheetMoveRange
functionisPointInSheetMoveRangesource ↗
isPointInSheetMoveRange(range: SheetMoveRange, row: number, column: number): boolean

Tests inclusive range membership.

range: SheetMoveRange
row: number
column: number
functionreadSessionStatesource ↗
readSessionState<State>(snapshot: SessionStateSnapshot, definition: SessionStateDefinition<State>): State | undefined

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

snapshot: SessionStateSnapshot
definition: SessionStateDefinition<State>
functionsealSheetContributionWritessource ↗
sealSheetContributionWrites(owner: object, assertWrite: (): void): void

Seals setup-time Sheet contribution registries after editor startup.

owner: object
assertWrite: (): void
functionsubtractSheetMoveRangesource ↗
subtractSheetMoveRange(original: SheetMoveRange, cut: SheetMoveRange): SheetMoveRange[]

Removes one inclusive rectangle, retaining at most four disjoint pieces.

original: SheetMoveRange
cut: SheetMoveRange
functiontranslateSheetMoveRangesource ↗
translateSheetMoveRange(range: SheetMoveRange, source: SheetMoveRange, destination: SheetMoveRange): SheetMoveRange

Translates a rule fragment by the source-to-destination displacement.

range: SheetMoveRange
source: SheetMoveRange
destination: SheetMoveRange