API reference
@searsuite/sear-plugin-alignment
Sheet horizontal and vertical alignment state, commands, rendering projections, and persistence.
28 exportsderived from source
- classAlignmentMatrixsource ↗
-
class AlignmentMatrix extends CSRMatrix<string>Sparse horizontal-alignment matrix whose absent cells resolve to left alignment.
Only non-left values are persisted. This keeps alignment state proportional to user overrides, while retaining a stable left-aligned default for every cell in the declared sheet shape. Explicit default values in serialized input are compacted while materializing the sparse matrix.
constructorconstructor AlignmentMatrix(data?: AlignmentMatrixData, shape?: [number, number]): AlignmentMatrixCreates an alignment matrix and compacts explicit left-alignment entries.
data: AlignmentMatrixDataOptional serialized CSR entries from persisted state.
shape: [number, number]Declared row and column count; empty cells resolve to left alignment.
propertydefaultAlignmentstatic readonly defaultAlignment: LeftDefault horizontal alignment returned for cells without an explicit override.
methodaddItem addItem(row: number, col: number, value: string): thisStores an explicit non-default override, or removes the entry when left alignment is requested.
ReturnsThis matrix after the sparse update.
row: numberZero-based row receiving the override.
col: numberZero-based column receiving the override.
value: stringRequested horizontal alignment.
Inherited members 34
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- clone
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getItem
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- classSheetAlignmentPluginsource ↗
-
class SheetAlignmentPlugin extends Plugin<unknown, CellProperties, SheetAlignmentPluginState>Plugin that owns cell alignment data.
Alignment state accepts direct alignment transactions owned by this plugin and also tracks sheet-data cell type changes to maintain built-in default alignment projections.
constructorconstructor SheetAlignmentPlugin(state: SheetAlignmentPluginState, readCellData?: (): SheetMatrix): SheetAlignmentPluginConstructs the alignment plugin.
state: SheetAlignmentPluginStateShared alignment state.
readCellData: (): SheetMatrix
propertydocumentState readonly documentState: PluginDocumentStateContribution<SheetAlignmentPluginState, SheetAlignmentPluginState>SheetAlignmentPlugin owns the persisted alignment export module.
propertyinterestedIn interestedIn: string[]Alignment reacts to direct cell updates and sheet-structure changes.
propertytransactionOT readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Alignment transactions share the registered MatrixOT algebra.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseAlignment data is state-only; duplicate render/event depth diagnostics do not apply.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetAlignmentPluginState, SheetAlignmentPluginState>Document-state export contribution for persisted cell alignments.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key shared by all alignment plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the alignment plugin.
methodapply apply(pluginState: SheetAlignmentPluginState, transaction: Transaction): SheetAlignmentPluginState | nullApplies alignment operations to the alignment matrix.
ReturnsUpdated plugin state, or null when the transaction has no relevant operations.
pluginState: SheetAlignmentPluginStateCurrent alignment state.
transaction: TransactionTransaction containing direct or derived MatrixOT-compatible operations.
methodgetPluginConfig getPluginConfig(): nullAlignment data has no render-time configuration.
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidContributes horizontal alignment to the shared Sheet cell visual pipeline.
registry: SheetCellVisualReaderRegistrycontext: SheetCellVisualReaderRegistrationContext
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters the horizontal alignment command owned by this plugin.
commands: SheetCommandBus
methodregisterFormatTransfers registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registry: SheetFormatTransferRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: SheetRangeReorderRegistry
methodregisterState registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): AlignmentMatrix; viewKey: string }[] }; key: PluginKey; state: SheetAlignmentPluginState }Registers alignment state for commands, projections, and collaboration.
methodrender render(): Node<CellProperties>[]Alignment data does not render scene nodes directly.
ReturnsAn empty node list.
Inherited members 26
Inherited from Plugin.
- depth
- pluginKey
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- classSheetVerticalAlignmentPluginsource ↗
-
class SheetVerticalAlignmentPlugin extends Plugin<unknown, CellProperties, SheetVerticalAlignmentPluginState>Plugin that owns vertical cell alignment data, commands, and structural projections.
constructorconstructor SheetVerticalAlignmentPlugin(state: SheetVerticalAlignmentPluginState): SheetVerticalAlignmentPluginConstructs the vertical alignment plugin around a shared sparse matrix.
state: SheetVerticalAlignmentPluginState
propertydocumentState readonly documentState: PluginDocumentStateContribution<SheetVerticalAlignmentPluginState, SheetVerticalAlignmentPluginState>SheetVerticalAlignmentPlugin owns its persisted export module.
propertyinterestedIn interestedIn: string[]Vertical alignment follows direct updates and all sheet structure changes.
propertytransactionOT readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Vertical alignment transactions share the registered MatrixOT algebra.
propertywarnOnDuplicateDepth readonly warnOnDuplicateDepth: falseAlignment state is data-only and does not use render-depth diagnostics.
propertydocumentStatestatic readonly documentState: PluginDocumentStateContribution<SheetVerticalAlignmentPluginState, SheetVerticalAlignmentPluginState>Document-state export contribution for persisted vertical alignments.
propertypluginKeystatic readonly pluginKey: PluginKeyStable plugin key shared by all vertical alignment plugin instances.
propertysymbolstatic readonly symbol: symbolDI token for resolving the vertical alignment plugin.
methodapply apply(pluginState: SheetVerticalAlignmentPluginState, transaction: Transaction): SheetVerticalAlignmentPluginState | nullApplies direct vertical alignment and structural matrix operations.
pluginState: SheetVerticalAlignmentPluginStatetransaction: Transaction
methodgetPluginConfig getPluginConfig(): nullVertical alignment data has no render-time configuration.
methodregisterCellVisualReaders registerCellVisualReaders(registry: SheetCellVisualReaderRegistry, context: SheetCellVisualReaderRegistrationContext): voidContributes vertical alignment to the shared Sheet cell visual pipeline.
registry: SheetCellVisualReaderRegistrycontext: SheetCellVisualReaderRegistrationContext
methodregisterCommands registerCommands(commands: SheetCommandBus): voidRegisters the vertical alignment command owned by this plugin.
commands: SheetCommandBus
methodregisterFormatTransfers registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
registry: SheetFormatTransferRegistry
methodregisterRangeMoves registerRangeMoves(registry: SheetRangeMoveRegistry): voidregistry: SheetRangeMoveRegistry
methodregisterRangeReorders registerRangeReorders(registry: SheetRangeReorderRegistry): voidregistry: SheetRangeReorderRegistry
methodregisterState registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): VerticalAlignmentMatrix; viewKey: string }[] }; key: PluginKey; state: SheetVerticalAlignmentPluginState }Registers vertical alignment state for commands, projections, and collaboration.
methodrender render(): Node<CellProperties>[]Vertical alignment data does not render scene nodes directly.
Inherited members 26
Inherited from Plugin.
- depth
- pluginKey
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- classVerticalAlignmentMatrixsource ↗
-
class VerticalAlignmentMatrix extends CSRMatrix<string>Sparse vertical-alignment matrix whose absent cells resolve to centered alignment.
constructorconstructor VerticalAlignmentMatrix(data?: VerticalAlignmentMatrixData, shape?: [number, number]): VerticalAlignmentMatrixCreates a matrix and compacts explicit default-alignment entries.
data: VerticalAlignmentMatrixDatashape: [number, number]
propertydefaultAlignmentstatic readonly defaultAlignment: CenterDefault vertical alignment returned for cells without an explicit override.
methodaddItem addItem(row: number, col: number, value: string): thisStores an explicit non-default override, or removes it for centered alignment.
row: numbercol: numbervalue: string
Inherited members 34
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- clone
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getItem
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- interfaceAlignmentMatrixDatasource ↗
-
interface AlignmentMatrixDataSerialized sparse entries accepted by AlignmentMatrix.
- interfaceSheetAlignmentPluginStatesource ↗
-
interface SheetAlignmentPluginStateState owned by SheetAlignmentPlugin.
propertycellAlignments cellAlignments: AlignmentMatrixSparse matrix containing non-left or cell-type-derived horizontal alignment overrides.
- interfaceSheetHorizontalAlignmentCommandDataSourcesource ↗
-
interface SheetHorizontalAlignmentCommandDataSource extends AlignmentCommandRangeDataSourceState access required by the horizontal alignment command.
propertytarget readonly target: PluginKeymethodreadCellAlignment readCellAlignment(row: number, column: number): SheetHorizontalAlignment | nullrow: numbercolumn: number
Inherited members 2
- getColumnCount
- getRowCount
- interfaceSheetSetRangeVerticalAlignmentInputsource ↗
-
interface SheetSetRangeVerticalAlignmentInput extends SheetRangeInputPublic input for setting vertical alignment in a range.
propertyverticalAlignment readonly verticalAlignment: SheetVerticalAlignment - interfaceSheetVerticalAlignmentCommandDataSourcesource ↗
-
interface SheetVerticalAlignmentCommandDataSource extends AlignmentCommandRangeDataSourceState access required by the vertical alignment command.
propertytarget readonly target: PluginKeymethodreadCellVerticalAlignment readCellVerticalAlignment(row: number, column: number): SheetVerticalAlignment | nullrow: numbercolumn: number
Inherited members 2
- getColumnCount
- getRowCount
- interfaceSheetVerticalAlignmentPluginStatesource ↗
-
interface SheetVerticalAlignmentPluginStateState owned by SheetVerticalAlignmentPlugin.
propertycellVerticalAlignments cellVerticalAlignments: VerticalAlignmentMatrixSparse matrix containing non-centered vertical alignment overrides.
- interfaceVerticalAlignmentMatrixDatasource ↗
-
interface VerticalAlignmentMatrixDataSerialized sparse entries accepted by VerticalAlignmentMatrix.
- typeSheetSetRangeAlignmentInputsource ↗
-
type SheetSetRangeAlignmentInput = SheetRangeInput & { alignment: SheetHorizontalAlignment } | { alignment: SheetHorizontalAlignment; ranges: readonly SheetRangeInput[] }Public input for setting horizontal alignment in one or more ranges.
- variableSetRangeAlignmentCommandsource ↗
-
SetRangeAlignmentCommand: SheetCommandDefinition<SheetSetRangeAlignmentInput, SheetCommandResult>Public command for setting horizontal alignment in a range.
- variableSetRangeVerticalAlignmentCommandsource ↗
-
SetRangeVerticalAlignmentCommand: SheetCommandDefinition<SheetSetRangeVerticalAlignmentInput, SheetCommandResult>Public command for setting vertical alignment in a range.
- variableSheetHorizontalAlignmentFieldKeysource ↗
-
SheetHorizontalAlignmentFieldKey: "sheet.alignment.horizontal"DataEngine field owned by SheetAlignmentPlugin.
- variableSheetVerticalAlignmentFieldKeysource ↗
-
SheetVerticalAlignmentFieldKey: "sheet.alignment.vertical"DataEngine field owned by SheetVerticalAlignmentPlugin.
- functioncreateSetRangeAlignmentOperationssource ↗
-
createSetRangeAlignmentOperations(input: SheetSetRangeAlignmentInput, dataSource: SheetHorizontalAlignmentReader): UpdateCellOTOperation<SheetHorizontalAlignment>[]Creates sparse UpdateCell operations for horizontal alignment.
input: SheetSetRangeAlignmentInputdataSource: SheetHorizontalAlignmentReader
- functioncreateSetRangeVerticalAlignmentOperationssource ↗
-
createSetRangeVerticalAlignmentOperations(input: SheetSetRangeVerticalAlignmentInput, dataSource: SheetVerticalAlignmentReader): UpdateCellOTOperation<SheetVerticalAlignment>[]Creates sparse UpdateCell operations for vertical alignment.
input: SheetSetRangeVerticalAlignmentInputdataSource: SheetVerticalAlignmentReader
- functionreadSheetCellAlignmentssource ↗
-
readSheetCellAlignments(dataEngine: DataEngine): AlignmentMatrix | nullReads horizontal cell alignment published by SheetAlignmentPlugin.
dataEngine: DataEngine
- functionreadSheetCellVerticalAlignmentssource ↗
-
readSheetCellVerticalAlignments(dataEngine: DataEngine): VerticalAlignmentMatrix | nullReads vertical cell alignment published by SheetVerticalAlignmentPlugin.
dataEngine: DataEngine
- functionregisterSheetHorizontalAlignmentCommandsource ↗
-
registerSheetHorizontalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetHorizontalAlignmentCommandDataSource): voidRegisters the horizontal alignment command owned by SheetAlignmentPlugin.
commands: SheetCommandBusdataSource: SheetHorizontalAlignmentCommandDataSource
- functionregisterSheetVerticalAlignmentCommandsource ↗
-
registerSheetVerticalAlignmentCommand(commands: SheetCommandBus, dataSource: SheetVerticalAlignmentCommandDataSource): voidRegisters the vertical alignment command owned by SheetVerticalAlignmentPlugin.
commands: SheetCommandBusdataSource: SheetVerticalAlignmentCommandDataSource
- functionassertSheetHorizontalAlignmentsource ↗
-
assertSheetHorizontalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet horizontal alignments.
value: unknown
- functionassertSheetVerticalAlignmentsource ↗
-
assertSheetVerticalAlignment(value: unknown): valueAsserts that a value is one of the supported Sheet vertical alignments.
value: unknown
- functionisSheetHorizontalAlignmentsource ↗
-
isSheetHorizontalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet horizontal alignment.
value: unknown
- functionisSheetVerticalAlignmentsource ↗
-
isSheetVerticalAlignment(value: unknown): valueReturns whether an unknown value is a supported Sheet vertical alignment.
value: unknown
- enumSheetHorizontalAlignmentsource ↗
-
enum SheetHorizontalAlignmentHorizontal alignment values supported by the built-in Sheet alignment feature.
- enumSheetVerticalAlignmentsource ↗
-
enum SheetVerticalAlignmentVertical alignment values supported by the built-in Sheet alignment feature.
No public exports match that search.