@searsuite/sear-plugin-find-replace
Find matches
Find queries return matching cells or a page of matches. Use the page query when the result set can be large.
- interfaceSheetFindInput
-
Query options shared by navigation and replacement.
property readonly content?: SheetFindContentWhether to read displayed values or formula source.
property readonly entireCell?: booleanRequires the search text to equal the entire cell text.
property readonly matchCase?: booleanEnables case-sensitive matching.
property readonly order?: SheetFindOrderCell traversal order.
property readonly range?: SheetFindRangeLimits search to an inclusive rectangular cell range.
property readonly text: stringLiteral text to search for; an empty string produces no matches.
- interfaceSheetFindMatch
-
One occurrence, with UTF-16 offsets within the cell's searched text.
property readonly column: numberZero-based column coordinate.
property readonly end: numberExclusive UTF-16 offset.
property readonly row: numberZero-based row coordinate.
property readonly start: numberInclusive UTF-16 offset.
property readonly text: stringSearched cell text at query time.
- interfaceSheetFindPage
-
Match window and its position in the complete result set.
property readonly matches: readonly SheetFindMatch[]property readonly revision: numberproperty readonly startIndex: numberproperty readonly total: number - interfaceSheetFindPageInput
-
interface SheetFindPageInput extends SheetFindInputA bounded window of matches in the requested traversal order.
property readonly backward?: booleanReads the matches preceding the cursor when set.
property readonly cursor?: Pick<SheetFindMatch, "start" | "row" | "column">Exclusive position from which to continue.
property readonly expectedRevision?: numberRejects a cursor created before the Sheet data changed.
property readonly limit: numberMaximum number of matches returned.
- interfaceSheetFindRange
-
Inclusive cell bounds for a Sheet search.
property readonly end: readonly [number, number]Last row and column.
property readonly start: readonly [number, number]First row and column.
- interfaceSheetFindSource
-
Sparse cells and optional projected values visible to a Sheet search.
property readonly codecs: Pick<CellClipboardCodecRegistry, "toPlainText">property readonly forEachProjectedValueInRange?: (startRow: number, startColumn: number, endRow: number, endColumn: number, visit: (row: number, column: number): void): voidproperty readonly getRevision?: (): numberproperty readonly matrix: CSRMatrix<CellMatrixElement>property readonly readValue?: (row: number, column: number, cell: CellMatrixElement | null): unknown - typeSheetFindContent
-
type SheetFindContent = typeof SheetFindContent[keyof typeof SheetFindContent]SheetFindContent: { Formula: "formula"; Value: "value" }Supported cell content projections for search.
- typeSheetFindOrder
-
type SheetFindOrder = typeof SheetFindOrder[keyof typeof SheetFindOrder]SheetFindOrder: { Columns: "columns"; Rows: "rows" }Supported match traversal orders.
- variableFindSheetMatchesQuery
-
FindSheetMatchesQuery: SheetQueryDefinition<SheetFindInput, readonly SheetFindMatch[]>Reads matching occurrences from current Sheet state.
- variableFindSheetMatchPageQuery
-
FindSheetMatchPageQuery: SheetQueryDefinition<SheetFindPageInput, SheetFindPage>Reads a bounded window and total count without retaining all matches.
- variableMAX_SHEET_FIND_PAGE_SIZE
-
MAX_SHEET_FIND_PAGE_SIZE: 200Bounds the memory used by a single Sheet search page.
- variableReadSheetFindRevisionQuery
-
ReadSheetFindRevisionQuery: SheetQueryDefinition<void, number>Reads the revision used to invalidate cached result windows.
- functionfindSheetMatches
-
findSheetMatches(input: SheetFindInput, source: SheetFindSource): SheetFindMatch[]Collects all occurrences for callers that need the complete result.
- functionfindSheetMatchPage
-
findSheetMatchPage(input: SheetFindPageInput, source: SheetFindSource): SheetFindPageFinds a bounded window while still reporting the complete match count.
Replace matches
- classSheetFindReplaceError
-
class SheetFindReplaceError extends SearErrorDiagnostic error surfaced to hosts by find and replace commands or queries.
constructor SheetFindReplaceError(code: SheetFindReplaceErrorCode, message: string, details?: SearErrorDetails): SheetFindReplaceErrorproperty readonly code: SheetFindReplaceErrorCodeStable error category.
Inherited members 9
Inherited from SearError.
- classSheetFindReplacePlugin
-
class SheetFindReplacePlugin extends Plugin<unknown, CellProperties, null>Stateless Sheet feature; matches always read the current staged data owner.
constructor SheetFindReplacePlugin(data: SheetDataPlugin, codecs: CellClipboardCodecRegistry, commits: CellCommitStrategyRegistry, projection?: Pick<SheetFindSource, "readValue" | "forEachProjectedValueInRange">): SheetFindReplacePluginproperty readonly warnOnDuplicateDepth: falseWhether PluginManager should warn when another ordered plugin shares this depth.
property readonly pluginKey: PluginKeystaticproperty readonly symbol: typeof symbolstaticmethod apply(_state: null, _transaction: Transaction): nullApplies a transaction to plugin-owned state and returns the next state.
method getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
method onTransactionCommitted(transaction: Transaction): voidRuns only after every step in the enclosing pipeline has succeeded and all staged plugin state has been committed. Use it for derived caches, notifications, persistence, and transport; never perform those effects in apply, because a later pipeline step may still fail.
transactionA committed transaction from the completed pipeline.
method registerCommands(commands: SheetCommandBus): voidmethod registerQueries(queries: SheetQueryRegistry): voidmethod registerState(): { key: PluginKey; state: null }Registers one or more plugin-owned state records with the host manager.
method render(): []Produces scene nodes owned by this plugin for the current core state.
Inherited members 27
Inherited from Plugin.
- depth
- documentState
- interestedIn
- transactionHistory
- transactionOT
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfaceSheetFindReplaceSource
-
interface SheetFindReplaceSource extends SheetFindSourceSearch source plus the cell commit policy used for replacements.
Inherited members 5
Inherited from SheetFindSource.
- interfaceSheetReplaceInput
-
interface SheetReplaceInput extends SheetFindInputReplacement options shared by single and bulk commands.
property readonly replacement: stringLiteral text inserted for each matching occurrence.
- interfaceSheetReplaceOneInput
-
interface SheetReplaceOneInput extends SheetReplaceInputReplaces one match returned by the find query.
property readonly match: SheetFindMatchSelected occurrence, including the cell text observed by the find query.
Inherited members 7
Inherited from SheetReplaceInput.
- typeSheetFindReplaceErrorCode
-
type SheetFindReplaceErrorCode = typeof SheetFindReplaceErrorCode[keyof typeof SheetFindReplaceErrorCode]SheetFindReplaceErrorCode: { CrossBlockReplacement: "SHEET_FIND_CROSS_BLOCK_REPLACEMENT"; InvalidPage: "SHEET_FIND_INVALID_PAGE"; InvalidRange: "SHEET_FIND_INVALID_RANGE"; InvalidRichText: "SHEET_FIND_INVALID_RICH_TEXT"; StaleResults: "SHEET_FIND_STALE_RESULTS" }Public code union for diagnostic find/replace failures.
- variableReplaceAllSheetMatchesCommand
-
ReplaceAllSheetMatchesCommand: SheetCommandDefinition<SheetReplaceInput, SheetCommandResult>Replaces all matching occurrences in one Sheet transaction.
- variableReplaceSheetMatchCommand
-
ReplaceSheetMatchCommand: SheetCommandDefinition<SheetReplaceOneInput, SheetCommandResult>Replaces one selected occurrence in a Sheet transaction.
- functionregisterSheetFindReplaceCommands
-
registerSheetFindReplaceCommands(commands: SheetCommandBus, source: SheetFindReplaceSource): voidPublishes single and bulk replace commands for a Sheet plugin.
- functionregisterSheetFindReplaceQueries
-
registerSheetFindReplaceQueries(queries: SheetQueryRegistry, source: SheetFindReplaceSource): voidPublishes the typed find query for a Sheet plugin.
- functionreplaceSheetMatches
-
replaceSheetMatches(input: SheetReplaceInput | SheetReplaceOneInput, source: SheetFindReplaceSource, one: boolean): UpdateCellOTOperation<CellMatrixElement | null>[]Builds one operation per changed cell for a single undoable transaction.
No matching API entries.