@searsuite/sear-plugin-cell-highlight
Highlight rules
A rule pairs a condition with a style. Range readers supply the cell values used to evaluate that condition.
- interfaceAddCellHighlightRuleInput
-
interface AddCellHighlightRuleInput extends SheetRangeInputCommon range input accepted by explicit range commands.
- interfaceCellHighlightCondition
-
property readonly count?: numberproperty readonly includeEqual?: booleanproperty readonly kind: CellHighlightKindproperty readonly operator?: CellHighlightValueOperator | CellHighlightTextOperatorproperty readonly percent?: booleanproperty readonly secondValue?: stringproperty readonly value?: string - interfaceCellHighlightRule
-
One conditional rule stored at its range's top-left matrix cell.
property readonly condition: CellHighlightConditionproperty readonly endColumn: numberproperty readonly endRow: numberproperty readonly id: stringproperty readonly priority: numberproperty readonly style: CellHighlightStyle - interfacePositionedCellHighlightRule
-
property readonly column: numberproperty readonly row: numberproperty readonly rule: CellHighlightRule - typeCellHighlightKind
-
type CellHighlightKind = typeof CellHighlightKind[keyof typeof CellHighlightKind]CellHighlightKind: { AboveAverage: "aboveAverage"; BelowAverage: "belowAverage"; Bottom: "bottom"; Duplicate: "duplicate"; Empty: "empty"; Error: "error"; NotEmpty: "notEmpty"; NotError: "notError"; … } - typeCellHighlightNumericRangeReader
-
type CellHighlightNumericRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: number): void): void - typeCellHighlightStyle
-
type CellHighlightStyle = typeof CellHighlightStyle[keyof typeof CellHighlightStyle]CellHighlightStyle: { GreenFill: "greenFill"; RedBorder: "redBorder"; RedFill: "redFill"; RedText: "redText"; YellowFill: "yellowFill" } - typeCellHighlightTextOperator
-
type CellHighlightTextOperator = typeof CellHighlightTextOperator[keyof typeof CellHighlightTextOperator]CellHighlightTextOperator: { Contains: "contains"; EndsWith: "endsWith"; NotContains: "notContains"; StartsWith: "startsWith" } - typeCellHighlightValueOperator
-
type CellHighlightValueOperator = typeof CellHighlightValueOperator[keyof typeof CellHighlightValueOperator]CellHighlightValueOperator: { Between: "between"; Equal: "equal"; Greater: "greater"; GreaterOrEqual: "greaterOrEqual"; Less: "less"; LessOrEqual: "lessOrEqual"; NotBetween: "notBetween"; NotEqual: "notEqual" } - typeCellHighlightValueRangeReader
-
type CellHighlightValueRangeReader = (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (value: unknown): void): void - typeCellHighlightValueReader
-
type CellHighlightValueReader = (row: number, column: number): unknown - variableAddCellHighlightRuleCommand
-
AddCellHighlightRuleCommand: SheetCommandDefinition<AddCellHighlightRuleInput, SheetCommandResult> - variableClearCellHighlightRulesCommand
-
ClearCellHighlightRulesCommand: SheetCommandDefinition<ClearCellHighlightRulesInput, SheetCommandResult> - variableReadCellHighlightRulesQuery
-
ReadCellHighlightRulesQuery: SheetQueryDefinition<void, readonly PositionedCellHighlightRule[]> - variableRemoveCellHighlightRuleCommand
-
RemoveCellHighlightRuleCommand: SheetCommandDefinition<RemoveCellHighlightRuleInput, SheetCommandResult>
Apply and read highlights
Add, remove, and clear commands change the stored rules; the read query returns the rules affecting a range.
- classCellHighlightMatrix
-
class CellHighlightMatrix extends CSRMatrix<CellHighlightRule[] | null>Sparse rule anchors; the range index avoids scanning all rules for every visible cell.
constructor CellHighlightMatrix(data?: CellHighlightMatrixData, shape?: [number, number]): CellHighlightMatrixmethod addItem(row: number, column: number, rules: CellHighlightRule[] | null): thisAdds an item to the matrix at the specified row and column.
ReturnsThe current instance for chaining.
rowThe row index.
method clone(): thisCreates an independent copy of this value and its mutable data.
method findRules(row: number, column: number): PositionedCellHighlightRule[]method forEachStored(callback: (rules: CellHighlightRule[] | null, row: number, column: number): void): voidVisits only stored anchors even when the sheet has many empty rows.
method getItem(row: number, column: number): CellHighlightRule[] | 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 getRules(): PositionedCellHighlightRule[]method replaceRules(entries: readonly PositionedCellHighlightRule[]): voidmethod setItem(row: number, column: number, rules: CellHighlightRule[] | null): thisInherited members 31
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- classSheetCellHighlightPlugin
-
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.
constructor SheetCellHighlightPlugin(state: SheetCellHighlightPluginState, dependencies: CellHighlightDependencies): SheetCellHighlightPluginproperty readonly documentState: PluginDocumentStateContribution<SheetCellHighlightPluginState, SheetCellHighlightPluginState>Document-state export modules owned by this plugin state.
property interestedIn: MatrixOTActionName[]Declares which Sheet OT action names this plugin is interested in. The engine will only call
applywhen a transaction contains at least one operation matching these action names, unless the transaction is owned by this plugin.['uc', 'rr', 'rc']— only called for UpdateCell, ResizeRow, ResizeCol['*']— called for any transaction (wildcard)[]— only called for this plugin's own transactions
property readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Shared transaction algebra used by history and collaboration.
property readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
property readonly documentState: PluginDocumentStateContribution<SheetCellHighlightPluginState, SheetCellHighlightPluginState>staticproperty readonly pluginKey: PluginKeystaticproperty readonly symbol: typeof symbolstaticmethod apply(state: SheetCellHighlightPluginState, transaction: Transaction): SheetCellHighlightPluginState | nullApplies a transaction to plugin-owned state and returns the next state.
method dispose(): voidmethod getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
method invalidateRangeStatistics(cells?: readonly SheetDisplayedValueCoordinate[]): voidInvalidates derived range statistics after displayed values change.
method registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidmethod registerCommands(commands: SheetCommandBus): voidmethod registerQueries(queries: SheetQueryRegistry): voidmethod registerRangeMoves(registry: SheetRangeMoveRegistry): voidmethod 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.
method render(): Node<CellProperties>[]Produces scene nodes owned by this plugin for the current core state.
Inherited members 25
Inherited from Plugin.
- depth
- transactionHistory
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- variableSheetCellHighlightFieldKey
-
SheetCellHighlightFieldKey: "sheet.cellHighlight" - functionreadSheetCellHighlights
-
readSheetCellHighlights(dataEngine: DataEngine): CellHighlightMatrix | null
No matching API entries.