@searsuite/sear-plugin-cell-format
Cell number-format state, commands, display projection, and persistence.
Format state
- classCellFormatMatrix
-
class CellFormatMatrix extends CSRMatrix<CellFormat | null>Sparse matrix containing explicit per-cell number formats.
constructor CellFormatMatrix(data?: CellFormatMatrixData, shape?: [number, number]): CellFormatMatrixmethod addItem(row: number, column: number, format: CellFormat | null): thisStores a format through the CSR API.
method setItem(row: number, column: number, format: CellFormat | null): thisStores a validated format, or removes the sparse entry for null.
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
- classCellFormatMatrixError
-
class CellFormatMatrixError extends SearErrorPublic error raised when persisted Sheet cell-format state is invalid.
constructor CellFormatMatrixError(message: string, details?: SearErrorDetails): CellFormatMatrixErrorproperty readonly code: "SHEET_CELL_FORMAT_INVALID"Stable machine-readable identifier for this error category.
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.
constructor SheetCellFormatPlugin(state: SheetCellFormatPluginState): SheetCellFormatPluginproperty readonly documentState: PluginDocumentStateContribution<SheetCellFormatPluginState, SheetCellFormatPluginState>Document-state export modules owned by this plugin state.
property interestedIn: string[]Declares which Sheet OT action names this plugin is interested in. The engine will only call
applywhen a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.['uc', 'rr', 'rc']— only called for UpdateCell, ResizeRow, ResizeCol['*']— called for any transaction (wildcard)[]— only called for this plugin's own transactions
property readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Shared transaction algebra used by history and collaboration.
property readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
property readonly documentState: PluginDocumentStateContribution<SheetCellFormatPluginState, SheetCellFormatPluginState>staticproperty readonly pluginKey: PluginKeystaticproperty readonly symbol: symbolstaticmethod apply(state: SheetCellFormatPluginState, transaction: Transaction): SheetCellFormatPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
method getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
method registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidmethod registerCommands(commands: SheetCommandBus): voidmethod registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
method registerQueries(queries: SheetQueryRegistry): voidmethod registerRangeMoves(registry: SheetRangeMoveRegistry): voidmethod registerRangeReorders(registry: SheetRangeReorderRegistry): voidmethod registerState(): { 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.
method render(): Node<CellProperties>[]Produces scene nodes owned by this plugin for the current core state.
Inherited members 25
Inherited from Plugin.
- depth
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- 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 SheetRangeInputInput accepted by AdjustRangeCellFormatDecimalPlacesCommand.
property readonly delta: number - interfaceSheetCellFormatCommandDataSource
-
interface SheetCellFormatCommandDataSource extends CellFormatCommandRangeDataSourceState access required by the cell-format command.
property readonly target: PluginKeymethod readCellFormat(row: number, column: number): CellFormat | nullInherited members 2
- getColumnCount
- getRowCount
- interfaceSheetSetRangeCellFormatInput
-
interface SheetSetRangeCellFormatInput extends SheetRangeInputInput accepted by SetRangeCellFormatCommand.
- 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 | nullReads the live format matrix published by SheetCellFormatPlugin.
- functionregisterSheetCellFormatCommand
-
registerSheetCellFormatCommand(commands: SheetCommandBus, dataSource: SheetCellFormatCommandDataSource): voidRegisters the command owned by SheetCellFormatPlugin.
No matching API entries.