← All packages

@searsuite/sear-plugin-cell-border

Independent Sheet cell borders, commands, rendering, history and collaboration.

Border values

classCellBorderError
class CellBorderError extends SearError

Typed error for invalid border commands or document values.

Inherited members 9

Inherited from SearError.

classCellBorderMatrix
class CellBorderMatrix extends CSRMatrix<SheetCellBorder | null>

Feature-owned sparse matrix; empty edge records are represented by absence.

constructorCellBorderMatrix(data?: CellBorderMatrixData, shape?: [number, number]): CellBorderMatrix
methodaddItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): this

Adds an item to the matrix at the specified row and column.

ReturnsThe current instance for chaining.

row

The row index.

value

The value to add.

methodclone(): this

Creates an independent copy of this value and its mutable data.

methodgetItem(row: number, column: number): Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null

Retrieves an item from the matrix at the specified row and column.

ReturnsThe item at the specified position or null if not present.

row

The row index.

methodsetItem(row: number, column: number, value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null): this

Stores an isolated edge record or clears its sparse entry.

Inherited members 32

Inherited from CSRMatrix.

interfaceBorderLinePaint
interface BorderLinePaint BorderLinePaint: Readonly<Record<SheetBorderLineStyle, BorderLinePaint>>

Paint projection of one persisted border style.

interfaceSheetBorderStroke

One explicit persisted border stroke.

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.

constructorSheetCellBorderPlugin(state: SheetCellBorderPluginState): SheetCellBorderPlugin

Constructs the plugin around its independently owned sparse border matrix.

propertyreadonly depth: 2

Border nodes are painted after base cells and merged-cell backgrounds.

propertyreadonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>

SheetCellBorderPlugin owns its persisted state module.

propertyinterestedIn: string[]

Border follows direct updates and all sheet structure changes.

propertyreadonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Border transactions share the registered MatrixOT algebra.

propertyreadonly warnOnDuplicateDepth: false

Multiple extension layers may share the same depth.

propertyreadonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>static

Document-state export contribution for cell borders.

propertyreadonly pluginKey: PluginKeystatic

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

propertyreadonly symbol: symbolstatic

DI token for resolving the cell-border plugin.

methodapply(pluginState: SheetCellBorderPluginState, transaction: Transaction): SheetCellBorderPluginState | null

Applies direct border and structural matrix operations.

methodgetPluginConfig(): null

Cell-border data has no render-time configuration.

methodregisterCommands(commands: SheetCommandBus): void

Registers the cell-border command owned by this plugin.

methodregisterFormatTransfers(registry: SheetFormatTransferRegistry): void

Transfers only this owner's persisted formats.

methodregisterQueries(queries: SheetQueryRegistry): void

Publishes the border owner's typed read-only queries.

methodregisterRangeMoves(registry: SheetRangeMoveRegistry): void
methodregisterRangeReorders(registry: SheetRangeReorderRegistry): void
methodregisterState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellBorderMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellBorderPluginState }

Registers border state for commands, projections, and collaboration.

methodrender(core: SearCoreSheet): Node<CellProperties>[]

Contributes custom strokes without teaching the grid about border state.

Inherited members 24

Inherited from Plugin.

interfaceSheetCellBorderPluginState

State owned by SheetCellBorderPlugin.

propertycellBorders: CellBorderMatrix

Sparse matrix containing explicit per-cell edge strokes.

interfaceSheetSetRangeCellBorderInput
interface SheetSetRangeCellBorderInput extends SheetRangeInput

Public range-border input.

Inherited members 2

Inherited from SheetRangeInput.

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 | null

Reads the border owner's projection, when that plugin is installed.