← All packages

API reference

@searsuite/sear-plugin-cell-highlight

Conditional cell highlight rules, sparse range state, commands, and rendering contributions.

24 exportsderived from source

classCellHighlightMatrixsource ↗
class CellHighlightMatrix extends CSRMatrix<CellHighlightRule[] | null>

Sparse rule anchors; the range index avoids scanning all rules for every visible cell.

constructorconstructor
CellHighlightMatrix(data?: CellHighlightMatrixData, shape?: [number, number]): CellHighlightMatrix
data: CellHighlightMatrixData
shape: [number, number]
methodaddItem
addItem(row: number, column: number, rules: CellHighlightRule[] | 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
rules: CellHighlightRule[] | null
methodclone
clone(): this

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

methodfindRules
findRules(row: number, column: number): PositionedCellHighlightRule[]
row: number
column: number
methodforEachStored
forEachStored(callback: (rules: CellHighlightRule[] | null, row: number, column: number): void): void

Visits only stored anchors even when the sheet has many empty rows.

callback: (rules: CellHighlightRule[] | null, row: number, column: number): void
methodgetItem
getItem(row: number, column: number): CellHighlightRule[] | 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
methodgetRules
getRules(): PositionedCellHighlightRule[]
methodreplaceRules
replaceRules(entries: readonly PositionedCellHighlightRule[]): void
entries: readonly PositionedCellHighlightRule[]
methodsetItem
setItem(row: number, column: number, rules: CellHighlightRule[] | null): this
row: number
column: number
rules: CellHighlightRule[] | null
Inherited members 31

Inherited from CSRMatrix.

classSheetCellHighlightPluginsource ↗
class SheetCellHighlightPlugin extends Plugin<unknown, CellProperties, SheetCellHighlightPluginState>

Base contract implemented by sheet and document plugins.

Plugins own their state, declare lifecycle hooks, transform transactions into state, and render scene nodes for their host core. Runtime packages should extend this contract rather than reaching into Core internals.

constructorconstructor
SheetCellHighlightPlugin(state: SheetCellHighlightPluginState, dependencies: CellHighlightDependencies): SheetCellHighlightPlugin
state: SheetCellHighlightPluginState
dependencies: CellHighlightDependencies
propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetCellHighlightPluginState, SheetCellHighlightPluginState>

Document-state export modules owned by this plugin state.

propertyinterestedIn
interestedIn: MatrixOTActionName[]

Declares which Sheet OT action names this plugin is interested in. The engine will only call apply when a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.

  • [&#39;uc&#39;, &#39;rr&#39;, &#39;rc&#39;] — only called for UpdateCell, ResizeRow, ResizeCol
  • [&#39;*&#39;] — called for any transaction (wildcard)
  • [] — only called for this plugin's own transactions
propertytransactionOT
readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }

Shared transaction algebra used by history and collaboration.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetCellHighlightPluginState, SheetCellHighlightPluginState>
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
methodapply
apply(state: SheetCellHighlightPluginState, transaction: Transaction): SheetCellHighlightPluginState | null

Applies a transaction to plugin-owned state and returns the next state.

state: SheetCellHighlightPluginState
transaction: Transaction
methoddispose
dispose(): void
methodgetPluginConfig
getPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodinvalidateRangeStatistics
invalidateRangeStatistics(cells?: readonly SheetDisplayedValueCoordinate[]): void

Invalidates derived range statistics after displayed values change.

cells: readonly SheetDisplayedValueCoordinate[]
methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void
registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterQueries
registerQueries(queries: SheetQueryRegistry): void
queries: SheetQueryRegistry
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void
registry: SheetRangeMoveRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): CellHighlightMatrix; viewKey: string }[] }; key: PluginKey; state: SheetCellHighlightPluginState }

Registers one or more plugin-owned state records with the host manager.

methodrender
render(): Node<CellProperties>[]

Produces scene nodes owned by this plugin for the current core state.

Inherited members 26

Inherited from Plugin.

interfaceAddCellHighlightRuleInputsource ↗
interface AddCellHighlightRuleInput extends SheetRangeInput

Common range input accepted by explicit range commands.

propertycondition
readonly condition: CellHighlightCondition
propertystyle
readonly style: CellHighlightStyle
Inherited members 2

Inherited from SheetRangeInput.

interfaceCellHighlightConditionsource ↗
interface CellHighlightCondition
propertycount
readonly count?: number
propertyincludeEqual
readonly includeEqual?: boolean
propertykind
readonly kind: CellHighlightKind
propertyoperator
readonly operator?: CellHighlightValueOperator | CellHighlightTextOperator
propertypercent
readonly percent?: boolean
propertysecondValue
readonly secondValue?: string
propertyvalue
readonly value?: string
interfaceCellHighlightRulesource ↗
interface CellHighlightRule

One conditional rule stored at its range's top-left matrix cell.

propertycondition
readonly condition: CellHighlightCondition
propertyendColumn
readonly endColumn: number
propertyendRow
readonly endRow: number
propertyid
readonly id: string
propertypriority
readonly priority: number
propertystyle
readonly style: CellHighlightStyle
interfacePositionedCellHighlightRulesource ↗
interface PositionedCellHighlightRule
propertycolumn
readonly column: number
propertyrow
readonly row: number
propertyrule
readonly rule: CellHighlightRule
interfaceSheetCellHighlightPluginStatesource ↗
interface SheetCellHighlightPluginState
propertycellHighlights
readonly cellHighlights: CellHighlightMatrix
typeCellHighlightKindsource ↗
type CellHighlightKind = typeof CellHighlightKind[keyof typeof CellHighlightKind]
typeCellHighlightNumericRangeReadersource ↗
type CellHighlightNumericRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: number): void): void
typeCellHighlightStylesource ↗
type CellHighlightStyle = typeof CellHighlightStyle[keyof typeof CellHighlightStyle]
typeCellHighlightTextOperatorsource ↗
type CellHighlightTextOperator = typeof CellHighlightTextOperator[keyof typeof CellHighlightTextOperator]
typeCellHighlightValueOperatorsource ↗
type CellHighlightValueOperator = typeof CellHighlightValueOperator[keyof typeof CellHighlightValueOperator]
typeCellHighlightValueRangeReadersource ↗
type CellHighlightValueRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: unknown): void): void
typeCellHighlightValueReadersource ↗
type CellHighlightValueReader = (row: number, column: number): unknown
variableAddCellHighlightRuleCommandsource ↗
AddCellHighlightRuleCommand: SheetCommandDefinition<AddCellHighlightRuleInput, SheetCommandResult>
variableCellHighlightKindsource ↗
CellHighlightKind: { AboveAverage: "aboveAverage"; BelowAverage: "belowAverage"; Bottom: "bottom"; Duplicate: "duplicate"; Empty: "empty"; Error: "error"; NotEmpty: "notEmpty"; NotError: "notError"; … }
variableCellHighlightStylesource ↗
CellHighlightStyle: { GreenFill: "greenFill"; RedBorder: "redBorder"; RedFill: "redFill"; RedText: "redText"; YellowFill: "yellowFill" }
variableCellHighlightTextOperatorsource ↗
CellHighlightTextOperator: { Contains: "contains"; EndsWith: "endsWith"; NotContains: "notContains"; StartsWith: "startsWith" }
variableCellHighlightValueOperatorsource ↗
CellHighlightValueOperator: { Between: "between"; Equal: "equal"; Greater: "greater"; GreaterOrEqual: "greaterOrEqual"; Less: "less"; LessOrEqual: "lessOrEqual"; NotBetween: "notBetween"; NotEqual: "notEqual" }
variableClearCellHighlightRulesCommandsource ↗
ClearCellHighlightRulesCommand: SheetCommandDefinition<ClearCellHighlightRulesInput, SheetCommandResult>
variableReadCellHighlightRulesQuerysource ↗
ReadCellHighlightRulesQuery: SheetQueryDefinition<void, readonly PositionedCellHighlightRule[]>
variableRemoveCellHighlightRuleCommandsource ↗
RemoveCellHighlightRuleCommand: SheetCommandDefinition<RemoveCellHighlightRuleInput, SheetCommandResult>
variableSheetCellHighlightFieldKeysource ↗
SheetCellHighlightFieldKey: "sheet.cellHighlight"
functionreadSheetCellHighlightssource ↗
readSheetCellHighlights(dataEngine: DataEngine): CellHighlightMatrix | null
dataEngine: DataEngine