← All packages

API reference

@searsuite/sear-plugin-duplicate

Sparse Sheet duplicate-highlight state and duplicate row commands.

22 exportsderived from source

classDuplicateMatrixsource ↗
class DuplicateMatrix extends CSRMatrix<SheetDuplicateHighlight | null>

Sparse duplicate-highlight matrix. An absent cell has no duplicate marker.

constructorconstructor
DuplicateMatrix(data?: DuplicateMatrixData, shape?: [number, number]): DuplicateMatrix

Creates a sparse duplicate-highlight matrix from serialized CSR data.

data: DuplicateMatrixData
shape: [number, number]
methodaddItem
addItem(row: number, col: number, value: templateLiteral | null): this

Stores a duplicate highlight through the CSR API, removing the entry for null.

row: number
col: number
value: templateLiteral | null
methodsetItem
setItem(row: number, col: number, value: templateLiteral | null): this

Stores a duplicate highlight. Null is represented by removing the sparse entry.

row: number
col: number
value: templateLiteral | null
Inherited members 34

Inherited from CSRMatrix.

classSheetDuplicatePluginsource ↗
class SheetDuplicatePlugin extends Plugin<unknown, CellProperties, SheetDuplicatePluginState>

Plugin that owns duplicate-highlight data and duplicate row commands.

constructorconstructor
SheetDuplicatePlugin(state: SheetDuplicatePluginState, sheetData: SheetDataPlugin, cellCodecs: CellClipboardCodecRegistry): SheetDuplicatePlugin

Constructs the plugin around a shared sparse duplicate-highlight matrix.

state: SheetDuplicatePluginState
sheetData: SheetDataPlugin
cellCodecs: CellClipboardCodecRegistry
propertydocumentState
readonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>

SheetDuplicatePlugin owns its persisted state module.

propertyinterestedIn
interestedIn: string[]

Duplicate highlights follow direct updates and all sheet structure changes.

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

Duplicate-highlight transactions share the registered MatrixOT algebra.

propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Duplicate state is data-only and does not use render-depth diagnostics.

propertydocumentStatestatic
readonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>

Document-state export contribution for duplicate highlights.

propertypluginKeystatic
readonly pluginKey: PluginKey

Stable plugin key shared by all duplicate plugin instances.

propertysymbolstatic
readonly symbol: symbol

DI token for resolving the duplicate plugin.

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

Applies direct duplicate-highlight and structural matrix operations.

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

Duplicate state has no render-time configuration.

methodregisterCellVisualReaders
registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

Contributes duplicate highlights to the shared Sheet cell visual pipeline.

registry: SheetCellVisualReaderRegistry
methodregisterCommands
registerCommands(commands: SheetCommandBus): void

Registers duplicate commands owned by this plugin.

commands: SheetCommandBus
methodregisterRangeMoves
registerRangeMoves(registry: SheetRangeMoveRegistry): void

Contributes this owner's cell state to atomic range moves.

registry: SheetRangeMoveRegistry
methodregisterRangeReorders
registerRangeReorders(registry: SheetRangeReorderRegistry): void
registry: SheetRangeReorderRegistry
methodregisterState
registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): DuplicateMatrix; viewKey: string }[] }; key: PluginKey; state: SheetDuplicatePluginState }

Registers duplicate state for commands, projections, and collaboration.

methodrender
render(): Node<CellProperties>[]

Duplicate state contributes through grid cell properties, not scene nodes.

Inherited members 26

Inherited from Plugin.

interfaceDuplicateMatrixDatasource ↗
interface DuplicateMatrixData

Serialized sparse entries accepted by DuplicateMatrix.

propertydata
readonly data: string | null[]
propertyindices
readonly indices: number[]
propertyindptr
readonly indptr: number[]
interfaceSheetDuplicateClearInputsource ↗
interface SheetDuplicateClearInput extends SheetRangeInput

Public input for clearing duplicate highlights.

Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetDuplicateCommandDataSourcesource ↗
interface SheetDuplicateCommandDataSource extends DuplicateRangeDataSource

State access required by duplicate commands.

propertyduplicateTarget
readonly duplicateTarget: PluginKey
propertysheetDataTarget
readonly sheetDataTarget: PluginKey
methodreadCell
readCell(row: number, column: number): CellMatrixElement | null
row: number
column: number
methodreadCellText
readCellText(cell: CellMatrixElement): string
cell: CellMatrixElement
methodreadDuplicateHighlight
readDuplicateHighlight(row: number, column: number): templateLiteral | null
row: number
column: number
Inherited members 2
  • getColumnCount
  • getRowCount
interfaceSheetDuplicateDeleteInputsource ↗
interface SheetDuplicateDeleteInput extends SheetRangeInput

Public input for duplicate deletion.

propertycolumns
readonly columns?: readonly number[]
propertyheaderRow
readonly headerRow?: boolean
propertykeep
readonly keep?: SheetDuplicateKeepMode
Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetDuplicateHighlightInputsource ↗
interface SheetDuplicateHighlightInput extends SheetRangeInput

Public input for duplicate highlighting.

propertycolumns
readonly columns?: readonly number[]
propertyheaderRow
readonly headerRow?: boolean
propertyhighlight
readonly highlight: templateLiteral
Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetDuplicatePluginStatesource ↗
interface SheetDuplicatePluginState

State owned by SheetDuplicatePlugin.

propertyduplicates
duplicates: DuplicateMatrix

Sparse matrix containing duplicate highlight settings.

typeSheetDuplicateHighlightsource ↗
type SheetDuplicateHighlight = HexColor

A persisted duplicate-highlight color represented as a hexadecimal color.

typeSheetDuplicateKeepModesource ↗
type SheetDuplicateKeepMode = typeof SheetDuplicateKeepMode[keyof typeof SheetDuplicateKeepMode]

Type contract for SheetDuplicateKeepMode.

variableClearDuplicateHighlightsCommandsource ↗
ClearDuplicateHighlightsCommand: SheetCommandDefinition<SheetDuplicateClearInput, SheetCommandResult>

Public command for clearing duplicate highlights in a range.

variableDeleteDuplicateRowsCommandsource ↗
DeleteDuplicateRowsCommand: SheetCommandDefinition<SheetDuplicateDeleteInput, SheetCommandResult>

Public command for deleting duplicate row contents in a range.

variableHighlightDuplicateRowsCommandsource ↗
HighlightDuplicateRowsCommand: SheetCommandDefinition<SheetDuplicateHighlightInput, SheetCommandResult>

Public command for highlighting duplicate cell values in a range.

variableSheetDuplicateFieldKeysource ↗
SheetDuplicateFieldKey: "sheet.duplicateHighlights"

DataEngine field owned by SheetDuplicatePlugin.

variableSheetDuplicateKeepModesource ↗
SheetDuplicateKeepMode: { First: "first"; Last: "last" }

Retention mode used by DeleteDuplicateRowsCommand.

functionassertSheetDuplicateHighlightsource ↗
assertSheetDuplicateHighlight(value: unknown): value

Asserts that a value is a supported duplicate-highlight color.

value: unknown
functioncreateClearDuplicateHighlightOperationssource ↗
createClearDuplicateHighlightOperations(input: SheetDuplicateClearInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]

Creates sparse update operations that remove duplicate highlights from a range.

input: SheetDuplicateClearInput
dataSource: SheetDuplicateCommandDataSource
functioncreateDeleteDuplicateRowsOperationssource ↗
createDeleteDuplicateRowsOperations(input: SheetDuplicateDeleteInput, dataSource: SheetDuplicateCommandDataSource): DeleteRowOTOperation<CellMatrixElement>[]

Creates sheet-data operations that clear duplicate row contents in the selected range.

input: SheetDuplicateDeleteInput
dataSource: SheetDuplicateCommandDataSource
functioncreateHighlightDuplicateOperationssource ↗
createHighlightDuplicateOperations(input: SheetDuplicateHighlightInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]

Creates sparse update operations for duplicate-value highlighting.

input: SheetDuplicateHighlightInput
dataSource: SheetDuplicateCommandDataSource
functionisSheetDuplicateHighlightsource ↗
isSheetDuplicateHighlight(value: unknown): value

Returns whether a value is a supported duplicate-highlight color.

value: unknown
functionreadSheetDuplicateHighlightssource ↗
readSheetDuplicateHighlights(dataEngine: DataEngine): DuplicateMatrix | null

Reads duplicate highlights published by SheetDuplicatePlugin.

dataEngine: DataEngine
functionregisterSheetDuplicateCommandssource ↗
registerSheetDuplicateCommands(commands: SheetCommandBus, dataSource: SheetDuplicateCommandDataSource): void

Registers duplicate commands owned by SheetDuplicatePlugin.

commands: SheetCommandBus
dataSource: SheetDuplicateCommandDataSource