← All packages

API reference

@searsuite/sear-plugin-cell-fill

Sparse Sheet fill state, commands, visual projection, collaboration, and export.

14 exportsderived from source

classCellFillMatrixsource ↗
class CellFillMatrix extends CSRMatrix<SheetCellFill | null>

Sparse cell-fill matrix. An absent cell has no fill.

constructorconstructor
CellFillMatrix(data?: CellFillMatrixData, shape?: [number, number]): CellFillMatrix

Creates a sparse cell-fill matrix from serialized CSR data.

data: CellFillMatrixData
shape: [number, number]
methodaddItem
addItem(row: number, col: number, value: templateLiteral | null): this

Stores a fill color through the CSR API, removing the entry for null.

row: number
col: number
value: templateLiteral | null
methodsetItem
setItem(row: number, col: number, value: templateLiteral | null): this

Stores a fill color. Null is represented by removing the sparse entry.

row: number
col: number
value: templateLiteral | null
Inherited members 34

Inherited from CSRMatrix.

classSheetCellFillPluginsource ↗
class SheetCellFillPlugin extends Plugin<unknown, CellProperties, SheetCellFillPluginState>

Plugin that owns cell fill data, commands, structural projections, and export.

constructorconstructor
SheetCellFillPlugin(state: SheetCellFillPluginState): SheetCellFillPlugin

Constructs the plugin around a shared sparse fill matrix.

state: SheetCellFillPluginState
propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellFillPluginState, SheetCellFillPluginState>

SheetCellFillPlugin owns its persisted state module.

propertyinterestedIn
interestedIn: string[]

Fill 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>>[] }

Fill transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Fill state is data-only and does not use render-depth diagnostics.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellFillPluginState, SheetCellFillPluginState>

Document-state export contribution for cell fills.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all cell-fill plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the cell-fill plugin.

methodapply
apply(pluginState: SheetCellFillPluginState, transaction: Transaction): SheetCellFillPluginState | null

Applies direct fill and structural matrix operations.

pluginState: SheetCellFillPluginState
transaction: Transaction
methodgetPluginConfig
getPluginConfig(): null

Cell-fill data has no render-time configuration.

methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

Contributes explicit fill colors to the shared Sheet cell visual pipeline.

registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the cell-fill command owned by this plugin.

commands: SheetCommandBus
methodregisterFormatTransfers
registerFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

registry: SheetFormatTransferRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellFillMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellFillPluginState }

Registers fill state for commands, projections, and collaboration.

methodrender
render(): Node<CellProperties>[]

Cell-fill data contributes through grid cell properties, not scene nodes.

Inherited members 26

Inherited from Plugin.

interfaceCellFillMatrixDatasource ↗
interface CellFillMatrixData

Serialized sparse entries accepted by CellFillMatrix.

propertydata
readonly data: string | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetCellFillCommandDataSourcesource ↗
interface SheetCellFillCommandDataSource extends CellFillCommandRangeDataSource

State access required by the cell-fill command.

propertytarget
readonly target: PluginKey
methodreadCellFill
readCellFill(row: number, column: number): templateLiteral | null
row: number
column: number
Inherited members 2
  • getColumnCount
  • getRowCount
interfaceSheetCellFillPluginStatesource ↗
interface SheetCellFillPluginState

State owned by SheetCellFillPlugin.

propertycellFills
cellFills: CellFillMatrix

Sparse matrix containing explicit cell fill colors.

interfaceSheetSetRangeCellFillInputsource ↗
interface SheetSetRangeCellFillInput extends SheetRangeInput

Public input for setting or clearing cell fill in a range.

propertyfill
readonly fill: templateLiteral | null
Inherited members 2

Inherited from SheetRangeInput.

typeSheetCellFillsource ↗
type SheetCellFill = HexColor

A persisted cell fill color represented as a CSS-compatible hexadecimal color.

variableSetRangeCellFillCommandsource ↗
SetRangeCellFillCommand: SheetCommandDefinition<SheetSetRangeCellFillInput, SheetCommandResult>

Public command for setting or clearing cell fill in a range.

variableSheetCellFillFieldKeysource ↗
SheetCellFillFieldKey: "sheet.cellFill"

DataEngine field owned by SheetCellFillPlugin.

functionassertSheetCellFillsource ↗
assertSheetCellFill(value: unknown): value

Asserts that a value is a supported cell fill color.

value: unknown
functioncreateSetRangeCellFillOperationssource ↗
createSetRangeCellFillOperations(input: SheetSetRangeCellFillInput, dataSource: SheetCellFillCommandDataSource): UpdateCellOTOperation<templateLiteral>[]

Creates sparse update operations for a cell-fill range.

input: SheetSetRangeCellFillInput
dataSource: SheetCellFillCommandDataSource
functionisSheetCellFillsource ↗
isSheetCellFill(value: unknown): value

Returns whether a value is a supported cell fill color.

value: unknown
functionreadSheetCellFillssource ↗
readSheetCellFills(dataEngine: DataEngine): CellFillMatrix | null

Reads cell fills published by SheetCellFillPlugin.

dataEngine: DataEngine
functionregisterSheetCellFillCommandsource ↗
registerSheetCellFillCommand(commands: SheetCommandBus, dataSource: SheetCellFillCommandDataSource): void

Registers the cell-fill command owned by SheetCellFillPlugin.

commands: SheetCommandBus
dataSource: SheetCellFillCommandDataSource