← All packages

API reference

@searsuite/sear-assembly-commands

Typed command definitions and transaction factories shared by editor composition roots.

79 exportsderived from source

Concept 1

Commands are the mutation boundary

A host or input handler requests a change by running a feature-owned command. The command definition identifies the operation; the registered handler builds the state owner's operations. The Sheet core stages those operations and commits them as one change. Rendering and observers then see the committed result rather than a partial step.

SheetCommandDispatcher and DocCommandBus are dispatch contracts, not alternate state stores. Use the typed command exported by the feature that owns the behavior. For selection, SelectRangeCommand changes the selected range and GetSelection reads it afterward.

Use when: changing editor state from application code or wiring a host event. Read-only questions belong to a query; ongoing notifications belong to observations. Neither should mutate committed state.

Concept 2

What happens after a command runs

A command can stage several owner-specific operations in one pipeline. If preparation or staging fails, the transaction does not publish a partial document. Successful commits advance history and collaboration through the owning feature's adapters; local interaction and render updates follow the commit boundary.

Command definitions, transaction factories, and handlers work together: definitions provide typed inputs and results, handlers decide which operations to make, and state owners define how those operations change their own data. This is why an optional plugin can add a command without expanding a central command switch.

classDocCommandBussource ↗
class DocCommandBus

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

constructorconstructor
DocCommandBus(platform?: Platform): DocCommandBus

Creates a command bus that reports boundary diagnostics through the host platform.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the command bus bound to one document editor instance.

methodbind
bind(context: DocCommandContext): void

Binds the command bus to the runtime services for one editor instance.

context: DocCommandContext
methoddestroy
destroy(): void

Clears editor binding, listeners, and command registrations during teardown.

methodenforceRegistrationBoundary
enforceRegistrationBoundary(assertWrite: (): void): void

Closes setup-time command registration after the editor is assembled.

assertWrite: (): void
methodgetRegisteredCommandIds
getRegisteredCommandIds(): readonly string[]

Returns a stable snapshot of all document commands exposed by this editor instance.

methodgetRegisteredCommands
getRegisteredCommands(): readonly DocCommandDefinition<unknown, DocCommandResult>[]

Returns the typed definitions registered on this editor instance.

methodhas
has(definition: string | DocCommandDefinition<unknown, DocCommandResult>): boolean

Returns whether this editor instance currently exposes a document command id.

definition: string | DocCommandDefinition<unknown, DocCommandResult>
methodisExecuting
isExecuting(): boolean

Whether this editor's command bus is currently dispatching a command.

methodregister
register<Definition>(definition: Definition, factory: DocCommandFactory<Definition>): (): void

Registers one feature-owned command factory. The returned function must be called by lifecycle cleanup when a feature registers dynamically.

definition: Definition
factory: DocCommandFactory<Definition>
methodrun
run<Definition>(definition: Definition, input: DocCommandInput<Definition>): DocCommandDefinitionResult<Definition>

Executes a registered command through its feature-owned typed definition.

definition: Definition
input: DocCommandInput<Definition>
methodrunWithoutMutationAuthority
runWithoutMutationAuthority<Value>(callback: (): Value): Value

Invokes external observers without inheriting this editor's command write authority.

callback: (): Value
methodsubscribe
subscribe(listener: DocCommandListener): (): void

Subscribes to document command lifecycle events and returns an unsubscribe function.

listener: DocCommandListener
classDocCommandDispatchersource ↗
class DocCommandDispatcher

Executes document command objects against one command context.

constructorconstructor
DocCommandDispatcher(): DocCommandDispatcher
methodexecute
execute<Result>(context: DocCommandContext, command: DocEditorCommand<Result>): Result

Runs a command, validates its result and applies its operation/effects.

context: DocCommandContext
command: DocEditorCommand<Result>
classEffectCommandsource ↗
class EffectCommand extends SheetCommand<SheetCommandResult>

Command that emits local effects without mutating OT state.

constructorconstructor
EffectCommand(effects: readonly SheetCommandEffect[]): EffectCommand

Creates an effect-only command.

effects: readonly SheetCommandEffect[]
propertyid
readonly id: "effect.apply"

Stable id for effect-only command execution.

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Returns an empty pipeline plus the local effects to apply.

_context: SheetCommandContext
classLocalActionCommandsource ↗
class LocalActionCommand extends SheetCommand<SheetCommandResult>

Runs a local, command-owned action that does not produce an OT transaction.

constructorconstructor
LocalActionCommand(id: string, run: (): void): LocalActionCommand

Creates a command that schedules one local action in a pipeline.

id: string
run: (): void
propertyid
readonly id: string

Stable, domain-owned command identifier for observability and automation.

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Returns a pipeline containing only the local action step.

_context: SheetCommandContext
classPipelineExecutionCommandsource ↗
class PipelineExecutionCommand extends SheetCommand<SheetCommandResult>

Executes a complete, named pipeline through the command bus.

constructorconstructor
PipelineExecutionCommand(id: string, pipeline: Pipeline): PipelineExecutionCommand

Creates a command around an existing named pipeline.

id: string
pipeline: Pipeline
propertyid
readonly id: string

Stable, domain-owned command identifier for observability and automation.

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Returns the provided pipeline unchanged.

_context: SheetCommandContext
classSheetAxisMoveBoundsErrorsource ↗
class SheetAxisMoveBoundsError extends SearError

A requested block or insertion boundary falls outside its axis.

constructorconstructor
SheetAxisMoveBoundsError(input: SheetMoveAxisInput, size: number): SheetAxisMoveBoundsError
input: SheetMoveAxisInput
size: number
propertycode
readonly code: "SHEET_AXIS_MOVE_BOUNDS"

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

classSheetCommandBussource ↗
class SheetCommandBus

The only supported execution entry point for sheet user and program actions. Hosts bind it to one editor instance after the Core has been created.

constructorconstructor
SheetCommandBus(platform?: Platform): SheetCommandBus

Creates a command bus that reports boundary diagnostics through the host platform.

platform: Platform
propertysymbolstatic
readonly symbol: typeof symbol

DI token for resolving the command bus bound to one editor instance.

methodbind
bind(context: SheetCommandContext): void

Binds the command bus to the runtime services for one editor instance.

context: SheetCommandContext
methoddestroy
destroy(): void

Clears editor binding, listeners and command registrations during teardown.

methodenforceRegistrationBoundary
enforceRegistrationBoundary(assertWrite: (): void): void

Closes setup-time command registration after the editor is assembled.

assertWrite: (): void
methodgetRegisteredCommandIds
getRegisteredCommandIds(): readonly string[]

Returns a stable snapshot of all commands exposed by this editor instance.

methodgetRegisteredCommands
getRegisteredCommands(): readonly SheetCommandDefinition<unknown, SheetCommandResult>[]

Returns the typed definitions registered on this editor instance.

methodhas
has(definition: string | SheetCommandDefinition<unknown, SheetCommandResult>): boolean

Returns whether this editor instance currently exposes a command id.

definition: string | SheetCommandDefinition<unknown, SheetCommandResult>
methodisExecuting
isExecuting(): boolean

Whether this editor's command bus is currently dispatching a command.

methodregister
register<Definition>(definition: Definition, factory: SheetCommandFactory<Definition>): (): void

Registers one feature-owned command factory. The returned function must be called by the feature's lifecycle cleanup when it registers dynamically.

definition: Definition
factory: SheetCommandFactory<Definition>
methodrun
run<Definition>(definition: Definition, input: SheetCommandInput<Definition>): SheetCommandDefinitionResult<Definition>

Executes a registered command through its feature-owned typed definition.

definition: Definition
input: SheetCommandInput<Definition>
methodrunWithoutMutationAuthority
runWithoutMutationAuthority<Value>(callback: (): Value): Value

Invokes external observers without inheriting this editor's command write authority.

callback: (): Value
methodsubscribe
subscribe(listener: SheetCommandListener): (): void

Subscribes to command lifecycle events and returns an unsubscribe function.

listener: SheetCommandListener
classSheetCommandDispatchersource ↗
class SheetCommandDispatcher

Executes command objects against one command context.

constructorconstructor
SheetCommandDispatcher(): SheetCommandDispatcher
methodexecute
execute<Result>(context: SheetCommandContext, command: SheetCommand<Result>): Result

Runs a command, validates its result and applies its pipeline/effects.

context: SheetCommandContext
command: SheetCommand<Result>
classSheetQueryRegistrysource ↗
class SheetQueryRegistry

Editor-local registry for typed, side-effect-free sheet queries.

constructorconstructor
SheetQueryRegistry(): SheetQueryRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for registration changes after assembly.

assertWrite: (): void
methodgetRegisteredQueryIds
getRegisteredQueryIds(): readonly string[]
methodhas
has(definition: string | SheetQueryDefinition<unknown, unknown>): boolean
definition: string | SheetQueryDefinition<unknown, unknown>
methodregister
register<Definition>(definition: Definition, handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>): (): void
definition: Definition
handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>
methodrun
run<Definition>(definition: Definition, input: SheetQueryInput<Definition>): SheetQueryResult<Definition>
definition: Definition
input: SheetQueryInput<Definition>
classTransactionPipelineCommandsource ↗
class TransactionPipelineCommand extends SheetCommand<SheetCommandResult>

Executes an already-created transaction through the pipeline command boundary.

constructorconstructor
TransactionPipelineCommand(id: string, transaction: Transaction): TransactionPipelineCommand

Creates a command around an existing transaction.

id: string
transaction: Transaction
propertyid
readonly id: string

Stable, domain-owned command identifier for observability and automation.

methodexecute
execute(_context: SheetCommandContext): SheetCommandResult

Converts the provided transaction into a pipeline result.

_context: SheetCommandContext
interfaceDocCommandContextsource ↗
interface DocCommandContext

Runtime services exposed to document commands while they execute.

methodapplyEffect
applyEffect(effect: DocCommandEffect): void

Applies a local UI/runtime effect after the operation has been committed.

effect: DocCommandEffect
methodexecutePipeline
executePipeline(pipeline: Pipeline): void

Executes command-owned work through the document core's shared pipeline boundary. Implementations commit document state before rendering.

pipeline: Pipeline
interfaceDocCommandDefinitionsource ↗
interface DocCommandDefinition<Input, Result>

A stable document command identifier carrying its input and result contract.

property[docCommandInputType]
readonly [docCommandInputType]: Input

Phantom field that preserves the command input type for callers.

property[docCommandResultType]
readonly [docCommandResultType]: Result

Phantom field that preserves the command result type for callers.

propertyid
readonly id: string

Globally stable command id owned by the document feature package that defines it.

interfaceDocCommandEventsource ↗
interface DocCommandEvent

Lifecycle event emitted by the document command bus for diagnostics and host UI.

propertyerror
readonly error?: unknown

Original thrown value when the command failed.

propertyid
readonly id: string

Stable command id being executed.

propertyphase
readonly phase: CommandExecutionPhase

Execution phase represented by this event.

propertyresult
readonly result?: DocCommandResult

Result returned by a completed command.

interfaceDocCommandResultsource ↗
interface DocCommandResult

Standard command result that document Core can execute and observe.

propertyeffects
readonly effects?: readonly DocCommandEffect[]

Optional local effects requested after operation execution.

propertypipeline
readonly pipeline: Pipeline

Command-owned pipeline containing mutation, render and local-action steps.

interfaceDocEditorCommandsource ↗
interface DocEditorCommand<Result>

Executable unit behind a typed document command definition.

propertyid
readonly id: string

Stable, domain-owned command identifier for observability and automation.

methodexecute
execute(context: DocCommandContext): Result

Runs command logic and returns a pipeline-backed result.

context: DocCommandContext
interfaceExtendSelectionCommandInputsource ↗
interface ExtendSelectionCommandInput

Input required to extend a sheet selection by keyboard navigation.

propertycursor
readonly cursor: SelectionPoint

Current moving edge before this navigation step.

propertydirection
readonly direction: SelectionMoveDirection

Direction requested by the user.

propertyfindMerge
readonly findMerge: (point: SelectionPoint): { end: SelectionPoint; start: SelectionPoint } | undefined

Lookup for merged ranges that should be selected as a whole.

propertyjumpToEdge
readonly jumpToEdge?: boolean

Whether navigation should jump to the sheet edge.

propertylastCol
readonly lastCol: number

Last valid column index.

propertylastRow
readonly lastRow: number

Last valid row index.

propertyorigin
readonly origin: SelectionPoint

Fixed selection anchor where extension began.

interfaceMoveSelectionCommandInputsource ↗
interface MoveSelectionCommandInput

Public contract for MoveSelectionCommandInput.

propertydirection
readonly direction: SelectionMoveDirection
propertyfindMerge
readonly findMerge: (point: SheetPoint): SheetMergedCellRange | undefined
propertyfocus
readonly focus: SheetPoint
propertyjumpToEdge
readonly jumpToEdge?: boolean
propertylastCol
readonly lastCol: number
propertylastRow
readonly lastRow: number
interfaceMoveSelectionCommandResultsource ↗
interface MoveSelectionCommandResult

Public contract for MoveSelectionCommandResult.

propertyanchor
readonly anchor: [number, number]
propertyfocus
readonly focus: [number, number]
interfaceSelectRangeCommandInputsource ↗
interface SelectRangeCommandInput

Public contract for SelectRangeCommandInput.

propertyend
readonly end: SelectionPoint
propertyfindMerge
readonly findMerge: (point: SelectionPoint): { end: SelectionPoint; start: SelectionPoint } | undefined
propertylastCol
readonly lastCol?: number
propertylastRow
readonly lastRow?: number
propertystart
readonly start: SelectionPoint
interfaceSelectRangeCommandResultsource ↗
interface SelectRangeCommandResult

Public contract for SelectRangeCommandResult.

propertyanchor
readonly anchor: [number, number]
propertyfocus
readonly focus: [number, number]
interfaceSheetClearRangeContentsCommandDataSourcesource ↗
interface SheetClearRangeContentsCommandDataSource<Cell>

Sheet cell data required to create clear-contents operations.

propertytarget
readonly target: PluginKey

Plugin key that owns the persisted sheet data matrix.

methodgetColumnCount
getColumnCount(): number

Current column count.

methodgetRowCount
getRowCount(): number

Current row count.

methodreadCell
readCell(row: number, column: number): Cell | null

Reads the current cell value at row, column.

row: number
column: number
interfaceSheetClearRangeContentsInputsource ↗
interface SheetClearRangeContentsInput extends SheetRangeInput

Public input for clearing persisted contents in a range.

Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetCommandsource ↗
interface SheetCommand<Result>

Executable unit behind a typed command definition.

propertyid
readonly id: string

Stable, domain-owned command identifier for observability and automation.

methodexecute
execute(context: SheetCommandContext): Result

Runs command logic and returns a pipeline-backed result.

context: SheetCommandContext
interfaceSheetCommandContextsource ↗
interface SheetCommandContext

Runtime services exposed to commands while they execute.

methodapplyEffect
applyEffect(effect: SheetCommandEffect): void

Applies a local UI/runtime effect after pipeline execution.

effect: SheetCommandEffect
methodexecutePipeline
executePipeline(pipeline: Pipeline): void

Applies the command-produced pipeline through the core transaction boundary.

pipeline: Pipeline
interfaceSheetCommandDefinitionsource ↗
interface SheetCommandDefinition<Input, Result>

A stable command identifier carrying its input and result contract.

property[sheetCommandInputType]
readonly [sheetCommandInputType]: Input

Phantom field that preserves the command input type for callers.

property[sheetCommandResultType]
readonly [sheetCommandResultType]: Result

Phantom field that preserves the command result type for callers.

propertyid
readonly id: string

Globally stable command id owned by the feature package that defines it.

interfaceSheetCommandEventsource ↗
interface SheetCommandEvent

Lifecycle event emitted by the command bus for diagnostics and host UI.

propertyerror
readonly error?: unknown

Original thrown value when the command failed.

propertyid
readonly id: string

Stable command id being executed.

propertyphase
readonly phase: CommandExecutionPhase

Execution phase represented by this event.

propertyresult
readonly result?: SheetCommandResult

Successfully executed command result, present only for the completed phase.

interfaceSheetCommandResultsource ↗
interface SheetCommandResult

Standard command result that Core can execute and observe.

propertycompletion
readonly completion?: Promise<unknown>

Optional asynchronous completion of a command-owned external effect.

propertyeffects
readonly effects?: readonly SheetCommandEffect[]

Optional local effects requested after pipeline execution.

propertyhistoryGroup
readonly historyGroup?: { id: string; phase: "end" | "begin" }

Optional identifier for combining two committed commands into one undo entry.

propertypipeline
readonly pipeline: Pipeline

Pipeline containing transaction, render, interaction and local-action steps.

interfaceSheetDeleteColumnsInputsource ↗
interface SheetDeleteColumnsInput

Public input for deleting columns starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetDeleteRowsInputsource ↗
interface SheetDeleteRowsInput

Public input for deleting rows starting at index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetInsertColumnsInputsource ↗
interface SheetInsertColumnsInput

Public input for inserting columns before index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetInsertRowsInputsource ↗
interface SheetInsertRowsInput

Public input for inserting rows before index.

propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetMoveAxisInputsource ↗
interface SheetMoveAxisInput

Moves a contiguous block before a boundary in the original axis (0 through size).

propertybefore
readonly before: number
propertycount
readonly count?: number
propertyindex
readonly index: number
interfaceSheetQueryDefinitionsource ↗
interface SheetQueryDefinition<Input, Result>

A stable query identifier carrying its input and result contract.

property__input
readonly __input?: Input
property__result
readonly __result?: Result
propertyid
readonly id: string
propertyresultMode
readonly resultMode?: "reader"

Reader queries return a live, read-only projection instead of a data snapshot.

interfaceSheetRangeBoundssource ↗
interface SheetRangeBounds

Normalized rectangular sheet range bounds expressed as inclusive cell coordinates.

propertyend
readonly end: SheetCellPoint

Inclusive bottom-right cell coordinate.

propertystart
readonly start: SheetCellPoint

Inclusive top-left cell coordinate.

interfaceSheetRangeInputsource ↗
interface SheetRangeInput

Common range input accepted by explicit range commands.

propertyanchor
readonly anchor: SheetCellPoint

One corner of the target range.

propertyfocus
readonly focus: SheetCellPoint

Opposite corner of the target range.

interfaceSheetStructureCommandDataSourcesource ↗
interface SheetStructureCommandDataSource<Cell>

Sheet matrix access used by structure commands without depending on a concrete data package.

propertytarget
readonly target: PluginKey

Plugin key that owns the persisted sheet data matrix.

methodgetColumnCount
getColumnCount(): number

Current column count.

methodgetRowCount
getRowCount(): number

Current row count.

methodreadColumn
readColumn(index: number): Cell | null[]

Reads a dense column payload for invertible column deletion.

index: number
methodreadRow
readRow(index: number): Cell | null[]

Reads a dense row payload for invertible row deletion.

index: number
typeCommandExecutionPhasesource ↗
type CommandExecutionPhase = typeof CommandExecutionPhase[keyof typeof CommandExecutionPhase]

Public string union for command lifecycle event phases.

typeDocCommandDefinitionResultsource ↗
type DocCommandDefinitionResult = conditional

Extracts the result contract from a typed document command definition.

typeDocCommandEffectsource ↗
type DocCommandEffect = { type: "focus-document" } | { type: "reset-caret-blink" }

Local runtime effects that document commands can request outside document state.

typeDocCommandFactorysource ↗
type DocCommandFactory = (input: DocCommandInput<Definition>): DocEditorCommand<DocCommandDefinitionResult<Definition>>

Factory installed by a document feature plugin to create a command from typed input.

typeDocCommandInputsource ↗
type DocCommandInput = conditional

Extracts the input contract from a typed document command definition.

typeDocCommandListenersource ↗
type DocCommandListener = (event: DocCommandEvent): void

Observer invoked when document command execution starts, completes, or fails.

typeSelectionMoveDirectionsource ↗
type SelectionMoveDirection = typeof SelectionMoveDirection[keyof typeof SelectionMoveDirection]

Type contract for SelectionMoveDirection.

typeSheetCellPointsource ↗
type SheetCellPoint = readonly [number, number]

A zero-based sheet cell coordinate expressed as [row, column].

typeSheetCommandDefinitionResultsource ↗
type SheetCommandDefinitionResult = conditional

Extracts the result contract from a typed command definition.

typeSheetCommandFactorysource ↗
type SheetCommandFactory = (input: SheetCommandInput<Definition>): SheetCommand<SheetCommandDefinitionResult<Definition>>

Factory installed by a feature plugin to create a command from typed input.

typeSheetCommandInputsource ↗
type SheetCommandInput = conditional

Extracts the input contract from a typed command definition.

typeSheetCommandListenersource ↗
type SheetCommandListener = (event: SheetCommandEvent): void

Observer invoked when command execution starts, completes or fails.

typeSheetQueryHandlersource ↗
type SheetQueryHandler = (input: Input): Result
typeSheetQueryInputsource ↗
type SheetQueryInput = conditional
typeSheetQueryResultsource ↗
type SheetQueryResult = conditional
typeSheetRangeCommandDataSourcesource ↗
type SheetRangeCommandDataSource = SheetClearRangeContentsCommandDataSource<Cell>

Data source for the built-in clear-contents command.

variableClearRangeContentsCommandsource ↗
ClearRangeContentsCommand: SheetCommandDefinition<SheetClearRangeContentsInput, SheetCommandResult>

Clears persisted cell contents in an explicit rectangular range.

variableCommandExecutionPhasesource ↗
CommandExecutionPhase: { Completed: "completed"; Failed: "failed"; Started: "started" }

Stable lifecycle phases emitted by Sheet, Doc, and Workbook command buses.

variableDeleteColumnCommandsource ↗
DeleteColumnCommand: SheetCommandDefinition<SheetDeleteColumnsInput, SheetCommandResult>

Deletes one or more columns starting at the requested column index.

variableDeleteRowCommandsource ↗
DeleteRowCommand: SheetCommandDefinition<SheetDeleteRowsInput, SheetCommandResult>

Deletes one or more rows starting at the requested row index.

variableInsertColumnCommandsource ↗
InsertColumnCommand: SheetCommandDefinition<SheetInsertColumnsInput, SheetCommandResult>

Inserts one or more columns before the requested column index.

variableInsertRowCommandsource ↗
InsertRowCommand: SheetCommandDefinition<SheetInsertRowsInput, SheetCommandResult>

Inserts one or more rows before the requested row index.

variableMoveColumnsCommandsource ↗
MoveColumnsCommand: SheetCommandDefinition<SheetMoveAxisInput, SheetCommandResult>

Reorders complete columns without overwriting their neighbors.

variableMoveRowsCommandsource ↗
MoveRowsCommand: SheetCommandDefinition<SheetMoveAxisInput, SheetCommandResult>

Reorders complete rows without overwriting their neighbors.

variableSelectionMoveDirectionsource ↗
SelectionMoveDirection: { Down: "down"; Left: "left"; Right: "right"; Up: "up" }

Cardinal directions accepted by sheet-selection navigation commands.

functioncreateClearRangeContentsOperationssource ↗
createClearRangeContentsOperations<Cell>(input: SheetClearRangeContentsInput, dataSource: SheetClearRangeContentsCommandDataSource<Cell>): UpdateCellOTOperation<Cell>[]

Creates UpdateCell operations that clear non-empty cells inside a range.

input: SheetClearRangeContentsInput
dataSource: SheetClearRangeContentsCommandDataSource<Cell>
functioncreateDeleteColumnOperationssource ↗
createDeleteColumnOperations(input: SheetDeleteColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount" | "readColumn">): DeleteColOTOperation<unknown>[]

Creates ColDelete operations from public command input, ordered from right to left.

input: SheetDeleteColumnsInput
dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount" | "readColumn">
functioncreateDeleteRowOperationssource ↗
createDeleteRowOperations(input: SheetDeleteRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount" | "readRow">): DeleteRowOTOperation<unknown>[]

Creates RowDelete operations from public command input, ordered from bottom to top.

input: SheetDeleteRowsInput
dataSource: Pick<SheetStructureCommandDataSource, "getRowCount" | "readRow">
functioncreateInsertColumnOperationssource ↗
createInsertColumnOperations(input: SheetInsertColumnsInput, dataSource: Pick<SheetStructureCommandDataSource, "getRowCount">): InsertColOTOperation<unknown>[]

Creates ColInsert operations from public command input.

input: SheetInsertColumnsInput
dataSource: Pick<SheetStructureCommandDataSource, "getRowCount">
functioncreateInsertRowOperationssource ↗
createInsertRowOperations(input: SheetInsertRowsInput, dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount">): InsertRowOTOperation<unknown>[]

Creates RowInsert operations from public command input.

input: SheetInsertRowsInput
dataSource: Pick<SheetStructureCommandDataSource, "getColumnCount">
functioncreateMoveColumnsOperationssource ↗
createMoveColumnsOperations(input: SheetMoveAxisInput, size: number): MoveColOTOperation<unknown>[]

Creates column swaps implementing insertion at an original column boundary.

input: SheetMoveAxisInput
size: number
functioncreateMoveRowsOperationssource ↗
createMoveRowsOperations(input: SheetMoveAxisInput, size: number): MoveRowOTOperation<unknown>[]

Creates row swaps implementing insertion at an original row boundary.

input: SheetMoveAxisInput
size: number
functioncreateSheetTransactionsource ↗
createSheetTransaction<OperationType>(target: PluginKey, operations: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): Transaction

Creates a transaction for command factories that need to produce pipeline transactions internally.

target: PluginKey
operations: readonly OperationType[]
meta: Readonly<Record<string, unknown>>
functiondefineDocCommandsource ↗
defineDocCommand<Input, Result>(id: string): DocCommandDefinition<Input, Result>

Creates an immutable, feature-owned document command contract.

id: string
functiondefineSheetCommandsource ↗
defineSheetCommand<Input, Result>(id: string): SheetCommandDefinition<Input, Result>

Creates an immutable, feature-owned command contract.

id: string
functiondefineSheetQuerysource ↗
defineSheetQuery<Input, Result>(id: string): SheetQueryDefinition<Input, Result>

Creates an immutable, feature-owned query contract.

id: string
functiondefineSheetReaderQuerysource ↗
defineSheetReaderQuery<Input, Result>(id: string): SheetQueryDefinition<Input, Result>

Defines a live reader whose methods own detached values at their read boundary.

id: string
functionextendSelectionsource ↗
extendSelection(input: ExtendSelectionCommandInput): { anchor: [number, number]; cursor: [number, number]; focus: [number, number] }

Extends a selection by one keyboard navigation step.

ReturnsNormalized selection range and updated moving cursor.

input: ExtendSelectionCommandInput

Current selection extension state.

functionmoveSelectionsource ↗
moveSelection(input: MoveSelectionCommandInput): MoveSelectionCommandResult

Resolves navigation as a sheet interaction, including merged-range boundaries.

input: MoveSelectionCommandInput
functionregisterSheetRangeCommandssource ↗
registerSheetRangeCommands(commands: SheetCommandBus, dataSource: SheetRangeCommandDataSource): void

Registers the built-in range commands on one sheet command bus.

commands: SheetCommandBus
dataSource: SheetRangeCommandDataSource
functionregisterSheetStructureCommandssource ↗
registerSheetStructureCommands(commands: SheetCommandBus, dataSource: SheetStructureCommandDataSource, moves?: SheetStructureMoveRegistry): void

Registers the default sheet row/column structure commands.

commands: SheetCommandBus
dataSource: SheetStructureCommandDataSource
moves: SheetStructureMoveRegistry
functionselectRangesource ↗
selectRange(input: SelectRangeCommandInput): SelectRangeCommandResult

Normalizes pointer or test-provided ranges so intersected merged cells are selected whole.

input: SelectRangeCommandInput
classSheetQueryBussource ↗
class SheetQueryBus

Editor-local registry for typed, side-effect-free sheet queries.

constructorconstructor
SheetQueryRegistry(): SheetQueryRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methoddestroy
destroy(): void
methodenforceWriteBoundary
enforceWriteBoundary(assertWrite: (): void): void

Requires editor command dispatch for registration changes after assembly.

assertWrite: (): void
methodgetRegisteredQueryIds
getRegisteredQueryIds(): readonly string[]
methodhas
has(definition: string | SheetQueryDefinition<unknown, unknown>): boolean
definition: string | SheetQueryDefinition<unknown, unknown>
methodregister
register<Definition>(definition: Definition, handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>): (): void
definition: Definition
handler: SheetQueryHandler<SheetQueryInput<Definition>, SheetQueryResult<Definition>>
methodrun
run<Definition>(definition: Definition, input: SheetQueryInput<Definition>): SheetQueryResult<Definition>
definition: Definition
input: SheetQueryInput<Definition>