@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.
constructor DuplicateMatrix(data?: DuplicateMatrixData, shape?: [number, number]): DuplicateMatrixCreates a sparse duplicate-highlight matrix from serialized CSR data.
method addItem(row: number, col: number, value: templateLiteral | null): thisStores a duplicate highlight through the CSR API, removing the entry for null.
method setItem(row: number, col: number, value: templateLiteral | null): thisStores a duplicate highlight. Null is represented by removing the sparse entry.
Inherited members 34
Inherited from CSRMatrix.
- name
- ndim
- nnz
- shape
- addColumn
- addListener
- addRow
- clone
- cloneCommittedView
- cloneDetached
- cloneForStaging
- deleteColumns
- deleteRows
- dispatch
- dot
- forEach
- forEachStored
- forEachStoredInRange
- forEachStoredInRow
- fromDense
- getCol
- getDefaultValue
- getItem
- getRow
- lockMutations
- multiply
- removeItem
- removeListener
- setDefaultValue
- sum
- swapColumn
- swapRow
- toArray
- transpose
- classSheetDuplicatePlugin
-
class SheetDuplicatePlugin extends Plugin<unknown, CellProperties, SheetDuplicatePluginState>Plugin that owns duplicate-highlight data and duplicate row commands.
constructor SheetDuplicatePlugin(state: SheetDuplicatePluginState, sheetData: SheetDataPlugin, cellCodecs: CellClipboardCodecRegistry): SheetDuplicatePluginConstructs the plugin around a shared sparse duplicate-highlight matrix.
property readonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>SheetDuplicatePlugin owns its persisted state module.
property interestedIn: string[]Duplicate highlights follow direct updates and all sheet structure changes.
property readonly transactionOT: { collaborative: boolean; definition: TransactionOTDefinition<MatrixOTOperation<unknown>>; ownerId: string; relations: OTTransformRelation<MatrixOTOperation<unknown>, MatrixOTOperation<unknown>>[] }Duplicate-highlight transactions share the registered MatrixOT algebra.
property readonly warnOnDuplicateDepth: falseDuplicate state is data-only and does not use render-depth diagnostics.
property readonly documentState: PluginDocumentStateContribution<SheetDuplicatePluginState, SheetDuplicatePluginState>staticDocument-state export contribution for duplicate highlights.
property readonly pluginKey: PluginKeystaticStable plugin key shared by all duplicate plugin instances.
property readonly symbol: symbolstaticDI token for resolving the duplicate plugin.
method apply(pluginState: SheetDuplicatePluginState, transaction: Transaction): SheetDuplicatePluginState | nullApplies direct duplicate-highlight and structural matrix operations.
method getPluginConfig(): nullDuplicate state has no render-time configuration.
method registerCellVisualReaders(registry: SheetCellVisualReaderRegistry): voidContributes duplicate highlights to the shared Sheet cell visual pipeline.
method registerCommands(commands: SheetCommandBus): voidRegisters duplicate commands owned by this plugin.
method registerRangeMoves(registry: SheetRangeMoveRegistry): voidContributes this owner's cell state to atomic range moves.
method registerRangeReorders(registry: SheetRangeReorderRegistry): voidmethod registerState(): { dataEngine: { dataView: { fieldKey: string; select: (state: unknown): DuplicateMatrix; viewKey: string }[] }; key: PluginKey; state: SheetDuplicatePluginState }Registers duplicate state for commands, projections, and collaboration.
method render(): Node<CellProperties>[]Duplicate state contributes through grid cell properties, not scene nodes.
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
- interfaceDuplicateMatrixData
-
Serialized sparse entries accepted by DuplicateMatrix.
property readonly data: string | null[]property readonly indices: number[]property readonly indptr: number[] - interfaceSheetDuplicateCommandDataSource
-
interface SheetDuplicateCommandDataSource extends DuplicateRangeDataSourceState access required by duplicate commands.
property readonly duplicateTarget: PluginKeyproperty readonly sheetDataTarget: PluginKeymethod readCell(row: number, column: number): CellMatrixElement | nullmethod readCellText(cell: CellMatrixElement): stringmethod readDuplicateHighlight(row: number, column: number): templateLiteral | nullInherited members 2
- getColumnCount
- getRowCount
- interfaceSheetDuplicateHighlightInput
-
interface SheetDuplicateHighlightInput extends SheetRangeInputPublic input for duplicate highlighting.
property readonly columns?: readonly number[]property readonly headerRow?: booleanproperty readonly highlight: templateLiteral - interfaceSheetDuplicatePluginState
-
State owned by SheetDuplicatePlugin.
property duplicates: DuplicateMatrixSparse matrix containing duplicate highlight settings.
- typeSheetDuplicateHighlight
-
type SheetDuplicateHighlight = HexColorA 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): valueAsserts 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): valueReturns whether a value is a supported duplicate-highlight color.
- functionreadSheetDuplicateHighlights
-
readSheetDuplicateHighlights(dataEngine: DataEngine): DuplicateMatrix | nullReads 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 SheetRangeInputPublic input for clearing duplicate highlights.
- interfaceSheetDuplicateDeleteInput
-
interface SheetDuplicateDeleteInput extends SheetRangeInputPublic input for duplicate deletion.
property readonly columns?: readonly number[]property readonly headerRow?: booleanproperty readonly keep?: SheetDuplicateKeepMode - 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): voidRegisters duplicate commands owned by SheetDuplicatePlugin.
No matching API entries.