← All packages

@searsuite/sear-plugin-cell-format

Cell number-format state, commands, display projection, and persistence.

Format state

classCellFormatMatrixError
class CellFormatMatrixError extends SearError

Public error raised when persisted Sheet cell-format state is invalid.

Inherited members 9

Inherited from SearError.

classSheetCellFormatPlugin
class SheetCellFormatPlugin extends Plugin<unknown, CellProperties, SheetCellFormatPluginState>

Plugin owning per-cell number formats, their commands, OT, rendering projection, and export.

constructorSheetCellFormatPlugin(state: SheetCellFormatPluginState): SheetCellFormatPlugin
propertyreadonly documentState: PluginDocumentStateContribution<SheetCellFormatPluginState, SheetCellFormatPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn: 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
propertyreadonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertyreadonly warnOnDuplicateDepth: false

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

propertyreadonly documentState: PluginDocumentStateContribution<SheetCellFormatPluginState, SheetCellFormatPluginState>static
propertyreadonly pluginKey: PluginKeystatic
propertyreadonly symbol: symbolstatic
methodapply(state: SheetCellFormatPluginState, transaction: Transaction): SheetCellFormatPluginState | null

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

methodgetPluginConfig(): null

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

methodregisterCellVisualReaders(registry: SheetCellVisualReaderRegistry): void
methodregisterCommands(commands: SheetCommandBus): void
methodregisterFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

methodregisterQueries(queries: SheetQueryRegistry): void
methodregisterRangeMoves(registry: SheetRangeMoveRegistry): void
methodregisterRangeReorders(registry: SheetRangeReorderRegistry): void
methodregisterState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellFormatMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellFormatPluginState }

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

methodrender(): Node<CellProperties>[]

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

Inherited members 25

Inherited from Plugin.

interfaceSheetCellFormatPluginState

State exclusively owned by SheetCellFormatPlugin.

interfaceSheetCellFormatReader

Read-only projection of one Sheet's persisted cell-format matrix.

variableSheetCellFormatFieldKey
SheetCellFormatFieldKey: "sheet.cellFormat"

DataEngine field owned by SheetCellFormatPlugin.

Change and read formats

interfaceSheetAdjustRangeCellFormatDecimalsInput
interface SheetAdjustRangeCellFormatDecimalsInput extends SheetRangeInput

Input accepted by AdjustRangeCellFormatDecimalPlacesCommand.

Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetCellFormatCommandDataSource
interface SheetCellFormatCommandDataSource extends CellFormatCommandRangeDataSource

State access required by the cell-format command.

Inherited members 2
  • getColumnCount
  • getRowCount
interfaceSheetSetRangeCellFormatInput
interface SheetSetRangeCellFormatInput extends SheetRangeInput

Input accepted by SetRangeCellFormatCommand.

Inherited members 2

Inherited from SheetRangeInput.

variableAdjustRangeCellFormatDecimalPlacesCommand
AdjustRangeCellFormatDecimalPlacesCommand: SheetCommandDefinition<SheetAdjustRangeCellFormatDecimalsInput, SheetCommandResult>

Public command for increasing or decreasing a range's visible decimal places.

variableReadSheetCellFormatQuery
ReadSheetCellFormatQuery: SheetQueryDefinition<void, SheetCellFormatReader>

Reads the active Sheet's live, read-only cell-format projection.

variableSetRangeCellFormatCommand
SetRangeCellFormatCommand: SheetCommandDefinition<SheetSetRangeCellFormatInput, SheetCommandResult>

Public command for setting or clearing the number format of a cell range.

functioncreateAdjustCellFormatDecimalOperations
createAdjustCellFormatDecimalOperations(input: SheetAdjustRangeCellFormatDecimalsInput, dataSource: SheetCellFormatCommandDataSource): UpdateCellOTOperation<CellFormat>[]

Creates sparse MatrixOT updates for a decimal-place adjustment.

functioncreateSetRangeCellFormatOperations
createSetRangeCellFormatOperations(input: SheetSetRangeCellFormatInput, dataSource: SheetCellFormatCommandDataSource): UpdateCellOTOperation<CellFormat>[]

Creates sparse MatrixOT updates for one format range.

functionreadSheetCellFormats
readSheetCellFormats(dataEngine: DataEngine): CellFormatMatrix | null

Reads the live format matrix published by SheetCellFormatPlugin.

functionregisterSheetCellFormatCommand
registerSheetCellFormatCommand(commands: SheetCommandBus, dataSource: SheetCellFormatCommandDataSource): void

Registers the command owned by SheetCellFormatPlugin.