@searsuite/sear-plugin-cell-border
Independent Sheet cell borders, commands, rendering, history and collaboration.
Border values
- classCellBorderError
-
class CellBorderError extends SearErrorTyped error for invalid border commands or document values.
constructor CellBorderError(message: string, details?: Record<string, unknown>): CellBorderErrorproperty readonly code: "SHEET_CELL_BORDER_INVALID"Stable machine-readable identifier for this error category.
Inherited members 9
Inherited from SearError.
- classCellBorderMatrix
-
class CellBorderMatrix extends CSRMatrix<SheetCellBorder | null>Feature-owned sparse matrix; empty edge records are represented by absence.
constructor CellBorderMatrix(data?: CellBorderMatrixData, shape?: [number, number]): CellBorderMatrixmethod addItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
valueThe value to add.
method clone(): thisCreates an independent copy of this value and its mutable data.
method getItem(row: number, column: number): Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | nullRetrieves an item from the matrix at the specified row and column.
ReturnsThe item at the specified position or null if not present.
rowThe row index.
method setItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): thisStores an isolated edge record or clears its sparse entry.
Inherited members 32
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- interfaceBorderLinePaint
-
interface BorderLinePaintBorderLinePaint: Readonly<Record<SheetBorderLineStyle, BorderLinePaint>>Paint projection of one persisted border style.
property readonly dash: readonly number[]property readonly double?: booleanproperty readonly slanted?: booleanproperty readonly width: number - interfaceCellBorderMatrixData
-
Serialized sparse border entries.
- interfaceSheetBorderStroke
-
One explicit persisted border stroke.
property readonly color: stringproperty readonly style: SheetBorderLineStyle - typeSheetBorderLineStyle
-
type SheetBorderLineStyle = typeof SheetBorderLineStyle[keyof typeof SheetBorderLineStyle]SheetBorderLineStyle: { DashDot: "dashDot"; DashDotDot: "dashDotDot"; Dashed: "dashed"; Dotted: "dotted"; Double: "double"; Hair: "hair"; Medium: "medium"; MediumDashDot: "mediumDashDot"; … }Border line style input contract.
- typeSheetBorderPreset
-
type SheetBorderPreset = typeof SheetBorderPreset[keyof typeof SheetBorderPreset]SheetBorderPreset: { All: "all"; Bottom: "bottom"; Horizontal: "horizontal"; Inside: "inside"; Left: "left"; None: "none"; Outside: "outside"; Right: "right"; … }Border preset input contract.
- typeSheetBorderSide
-
type SheetBorderSide = typeof SheetBorderSide[keyof typeof SheetBorderSide]SheetBorderSide: { Bottom: "bottom"; Left: "left"; Right: "right"; Top: "top" }Cell border edge contract.
- typeSheetCellBorder
-
type SheetCellBorder = Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>>Explicit edges belonging to one cell; omitted edges have no custom border.
Set and read borders
- classSheetCellBorderPlugin
-
class SheetCellBorderPlugin extends Plugin<SearCoreSheet, CellProperties, SheetCellBorderPluginState>Plugin that owns cell border data, commands, structural projections, and export.
constructor SheetCellBorderPlugin(state: SheetCellBorderPluginState): SheetCellBorderPluginConstructs the plugin around its independently owned sparse border matrix.
property readonly depth: 2Border nodes are painted after base cells and merged-cell backgrounds.
property readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>SheetCellBorderPlugin owns its persisted state module.
property interestedIn: string[]Border follows direct updates and all sheet structure changes.
property readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Border transactions share the registered MatrixOT algebra.
property readonly warnOnDuplicateDepth: falseMultiple extension layers may share the same depth.
property readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>staticDocument-state export contribution for cell borders.
property readonly pluginKey: PluginKeystaticStable plugin key shared by all cell-border plugin instances.
property readonly symbol: symbolstaticDI token for resolving the cell-border plugin.
method apply(pluginState: SheetCellBorderPluginState, transaction: Transaction): SheetCellBorderPluginState | nullApplies direct border and structural matrix operations.
method getPluginConfig(): nullCell-border data has no render-time configuration.
method registerCommands(commands: SheetCommandBus): voidRegisters the cell-border command owned by this plugin.
method registerFormatTransfers(registry: SheetFormatTransferRegistry): voidTransfers only this owner's persisted formats.
method registerQueries(queries: SheetQueryRegistry): voidPublishes the border owner's typed read-only queries.
method registerRangeMoves(registry: SheetRangeMoveRegistry): voidmethod registerRangeReorders(registry: SheetRangeReorderRegistry): voidmethod registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellBorderMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellBorderPluginState }Registers border state for commands, projections, and collaboration.
method render(core: SearCoreSheet): Node<CellProperties>[]Contributes custom strokes without teaching the grid about border state.
Inherited members 24
Inherited from Plugin.
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfaceSheetCellBorderPluginState
-
State owned by SheetCellBorderPlugin.
property cellBorders: CellBorderMatrixSparse matrix containing explicit per-cell edge strokes.
- interfaceSheetSetRangeCellBorderInput
-
interface SheetSetRangeCellBorderInput extends SheetRangeInputPublic range-border input.
property readonly preset: SheetBorderPresetproperty readonly stroke: SheetBorderStroke - variableReadSheetCellBorderQuery
-
ReadSheetCellBorderQuery: SheetQueryDefinition<{ column: number; row: number }, Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null>Typed read of the explicit edges at one cell.
- variableSetRangeCellBorderCommand
-
SetRangeCellBorderCommand: SheetCommandDefinition<SheetSetRangeCellBorderInput, SheetCommandResult>Range-border command; all neighbor changes belong to the same transaction.
- variableSheetCellBorderFieldKey
-
SheetCellBorderFieldKey: "sheet.cellBorder"Stable data-view field owned by the border plugin.
- functionreadSheetCellBorders
-
readSheetCellBorders(dataEngine: DataEngine): CellBorderMatrix | nullReads the border owner's projection, when that plugin is installed.
No matching API entries.