← All packages

API reference

@searsuite/sear-plugin-cell-border

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

20 exportsderived from source

classCellBorderErrorsource ↗
class CellBorderError extends SearError

Typed error for invalid border commands or document values.

constructorconstructor
CellBorderError(message: string, details?: Record<string, unknown>): CellBorderError
message: string
details: Record<string, unknown>
propertycode
readonly code: "SHEET_CELL_BORDER_INVALID"

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

classCellBorderMatrixsource ↗
class CellBorderMatrix extends CSRMatrix<SheetCellBorder | null>

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

constructorconstructor
CellBorderMatrix(data?: CellBorderMatrixData, shape?: [number, number]): CellBorderMatrix
data: CellBorderMatrixData
shape: [number, number]
methodaddItem
addItem(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: number

The row index.

column: number
value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null

The value to add.

methodclone
clone(): this

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

methodgetItem
getItem(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: number

The row index.

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

Stores an isolated edge record or clears its sparse entry.

row: number
column: number
value: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null
Inherited members 32

Inherited from CSRMatrix.

classSheetCellBorderPluginsource ↗
class SheetCellBorderPlugin extends Plugin<SearCoreSheet, CellProperties, SheetCellBorderPluginState>

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

constructorconstructor
SheetCellBorderPlugin(state: SheetCellBorderPluginState): SheetCellBorderPlugin

Constructs the plugin around its independently owned sparse border matrix.

state: SheetCellBorderPluginState
propertydepth
readonly depth: 2

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

propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>

SheetCellBorderPlugin owns its persisted state module.

propertyinterestedIn
interestedIn: string[]

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

Border transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Multiple extension layers may share the same depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellBorderPluginState, Partial<SheetCellBorderPluginState>>

Document-state export contribution for cell borders.

propertypluginKeystatic
readonly pluginKey: PluginKey

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

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the cell-border plugin.

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

Applies direct border and structural matrix operations.

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

Cell-border data has no render-time configuration.

methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers the cell-border command owned by this plugin.

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

Transfers only this owner's persisted formats.

registry: SheetFormatTransferRegistry
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void

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

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

Registers border state for commands, projections, and collaboration.

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

Contributes custom strokes without teaching the grid about border state.

core: SearCoreSheet
Inherited members 25

Inherited from Plugin.

interfaceBorderLinePaintsource ↗
interface BorderLinePaint

Paint projection of one persisted border style.

propertydash
readonly dash: readonly number[]
propertydouble
readonly double?: boolean
propertyslanted
readonly slanted?: boolean
propertywidth
readonly width: number
interfaceCellBorderMatrixDatasource ↗
interface CellBorderMatrixData

Serialized sparse border entries.

propertydata
readonly data: Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetBorderStrokesource ↗
interface SheetBorderStroke

One explicit persisted border stroke.

propertycolor
readonly color: string
propertystyle
readonly style: SheetBorderLineStyle
interfaceSheetCellBorderPluginStatesource ↗
interface SheetCellBorderPluginState

State owned by SheetCellBorderPlugin.

propertycellBorders
cellBorders: CellBorderMatrix

Sparse matrix containing explicit per-cell edge strokes.

interfaceSheetSetRangeCellBorderInputsource ↗
interface SheetSetRangeCellBorderInput extends SheetRangeInput

Public range-border input.

propertypreset
readonly preset: SheetBorderPreset
propertystroke
readonly stroke: SheetBorderStroke
Inherited members 2

Inherited from SheetRangeInput.

typeSheetBorderLineStylesource ↗
type SheetBorderLineStyle = typeof SheetBorderLineStyle[keyof typeof SheetBorderLineStyle]

Border line style input contract.

typeSheetBorderPresetsource ↗
type SheetBorderPreset = typeof SheetBorderPreset[keyof typeof SheetBorderPreset]

Border preset input contract.

typeSheetBorderSidesource ↗
type SheetBorderSide = typeof SheetBorderSide[keyof typeof SheetBorderSide]

Cell border edge contract.

typeSheetCellBordersource ↗
type SheetCellBorder = Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>>

Explicit edges belonging to one cell; omitted edges have no custom border.

variableBorderLinePaintsource ↗
BorderLinePaint: Readonly<Record<SheetBorderLineStyle, BorderLinePaint>>

Shared style projection used by scene nodes and host previews.

variableReadSheetCellBorderQuerysource ↗
ReadSheetCellBorderQuery: SheetQueryDefinition<{ column: number; row: number }, Readonly<Partial<Record<SheetBorderSide, SheetBorderStroke>>> | null>

Typed read of the explicit edges at one cell.

variableSetRangeCellBorderCommandsource ↗
SetRangeCellBorderCommand: SheetCommandDefinition<SheetSetRangeCellBorderInput, SheetCommandResult>

Range-border command; all neighbor changes belong to the same transaction.

variableSheetBorderLineStylesource ↗
SheetBorderLineStyle: { DashDot: "dashDot"; DashDotDot: "dashDotDot"; Dashed: "dashed"; Dotted: "dotted"; Double: "double"; Hair: "hair"; Medium: "medium"; MediumDashDot: "mediumDashDot"; … }

Persisted line styles, shared by commands, rendering and hosts.

variableSheetBorderPresetsource ↗
SheetBorderPreset: { All: "all"; Bottom: "bottom"; Horizontal: "horizontal"; Inside: "inside"; Left: "left"; None: "none"; Outside: "outside"; Right: "right"; … }

Supported border presets for an inclusive Sheet range.

variableSheetBorderSidesource ↗
SheetBorderSide: { Bottom: "bottom"; Left: "left"; Right: "right"; Top: "top" }

Canonical edge names stored in a cell border record.

variableSheetCellBorderFieldKeysource ↗
SheetCellBorderFieldKey: "sheet.cellBorder"

Stable data-view field owned by the border plugin.

functionreadSheetCellBorderssource ↗
readSheetCellBorders(dataEngine: DataEngine): CellBorderMatrix | null

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

dataEngine: DataEngine