← All packages

@searsuite/sear-plugin-duplicate

Find and highlight duplicates

Highlight commands mark duplicate rows without deleting them; the read helper exposes the marks for rendering.

classDuplicateMatrix
class DuplicateMatrix extends CSRMatrix<SheetDuplicateHighlight | null>

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

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

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

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

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

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

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

Inherited members 34

Inherited from CSRMatrix.

classSheetDuplicatePlugin
class SheetDuplicatePlugin extends Plugin<unknown, CellProperties, SheetDuplicatePluginState>

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

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

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

propertyreadonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>

SheetDuplicatePlugin owns its persisted state module.

propertyinterestedIn: string[]

Duplicate highlights follow direct updates and all sheet structure changes.

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

Duplicate-highlight transactions share the registered MatrixOT algebra.

propertyreadonly warnOnDuplicateDepth: false

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

propertyreadonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>static

Document-state export contribution for duplicate highlights.

propertyreadonly pluginKey: PluginKeystatic

Stable plugin key shared by all duplicate plugin instances.

propertyreadonly symbol: symbolstatic

DI token for resolving the duplicate plugin.

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

Applies direct duplicate-highlight and structural matrix operations.

methodgetPluginConfig(): null

Duplicate state has no render-time configuration.

methodregisterCellVisualReaders(registry: SheetCellVisualReaderRegistry): void

Contributes duplicate highlights to the shared Sheet cell visual pipeline.

methodregisterCommands(commands: SheetCommandBus): void

Registers duplicate commands owned by this plugin.

methodregisterRangeMoves(registry: SheetRangeMoveRegistry): void

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

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

Registers duplicate state for commands, projections, and collaboration.

methodrender(): Node<CellProperties>[]

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

Inherited members 25

Inherited from Plugin.

interfaceDuplicateMatrixData

Serialized sparse entries accepted by DuplicateMatrix.

interfaceSheetDuplicateCommandDataSource
interface SheetDuplicateCommandDataSource extends DuplicateRangeDataSource

State access required by duplicate commands.

Inherited members 2
  • getColumnCount
  • getRowCount
interfaceSheetDuplicateHighlightInput
interface SheetDuplicateHighlightInput extends SheetRangeInput

Public input for duplicate highlighting.

Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetDuplicatePluginState

State owned by SheetDuplicatePlugin.

propertyduplicates: DuplicateMatrix

Sparse matrix containing duplicate highlight settings.

typeSheetDuplicateHighlight
type SheetDuplicateHighlight = HexColor

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

typeSheetDuplicateKeepMode
type SheetDuplicateKeepMode = typeof SheetDuplicateKeepMode[keyof typeof SheetDuplicateKeepMode] SheetDuplicateKeepMode: { First: "first"; Last: "last" }
variableClearDuplicateHighlightsCommand
ClearDuplicateHighlightsCommand: SheetCommandDefinition<SheetDuplicateClearInput, SheetCommandResult>

Public command for clearing duplicate highlights in a range.

variableHighlightDuplicateRowsCommand
HighlightDuplicateRowsCommand: SheetCommandDefinition<SheetDuplicateHighlightInput, SheetCommandResult>

Public command for highlighting duplicate cell values in a range.

variableSheetDuplicateFieldKey
SheetDuplicateFieldKey: "sheet.duplicateHighlights"

DataEngine field owned by SheetDuplicatePlugin.

functionassertSheetDuplicateHighlight
assertSheetDuplicateHighlight(value: unknown): value

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

functioncreateClearDuplicateHighlightOperations
createClearDuplicateHighlightOperations(input: SheetDuplicateClearInput, dataSource: SheetDuplicateCommandDataSource): UpdateCellOTOperation<templateLiteral | null>[]

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

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

Creates sparse update operations for duplicate-value highlighting.

functionisSheetDuplicateHighlight
isSheetDuplicateHighlight(value: unknown): value

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

functionreadSheetDuplicateHighlights
readSheetDuplicateHighlights(dataEngine: DataEngine): DuplicateMatrix | null

Reads duplicate highlights published by SheetDuplicatePlugin.

Clear or delete duplicates

Clear removes only highlight state. Delete removes the selected duplicate rows through Sheet operations.

interfaceSheetDuplicateClearInput
interface SheetDuplicateClearInput extends SheetRangeInput

Public input for clearing duplicate highlights.

Inherited members 2

Inherited from SheetRangeInput.

interfaceSheetDuplicateDeleteInput
interface SheetDuplicateDeleteInput extends SheetRangeInput

Public input for duplicate deletion.

Inherited members 2

Inherited from SheetRangeInput.

variableDeleteDuplicateRowsCommand
DeleteDuplicateRowsCommand: SheetCommandDefinition<SheetDuplicateDeleteInput, SheetCommandResult>

Public command for deleting duplicate row contents in a range.

functioncreateDeleteDuplicateRowsOperations
createDeleteDuplicateRowsOperations(input: SheetDuplicateDeleteInput, dataSource: SheetDuplicateCommandDataSource): DeleteRowOTOperation<CellMatrixElement>[]

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

functionregisterSheetDuplicateCommands
registerSheetDuplicateCommands(commands: SheetCommandBus, dataSource: SheetDuplicateCommandDataSource): void

Registers duplicate commands owned by SheetDuplicatePlugin.