Type Editor / @type-editor/search / set-search-state / setSearchState
Function: setSearchState()
ts
function setSearchState(transaction, query, range?): Transaction;Defined in: set-search-state.ts:17
Add metadata to a transaction that updates the active search query and searched range, when dispatched.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
transaction | Transaction | undefined | The transaction to add metadata to |
query | SearchQuery | undefined | The new search query to set |
range | DocumentRange | null | Optional range to limit search scope, or null to search the entire document |
Returns
Transaction
The transaction with the search metadata added