# find-and-replace/findandreplacestate

module

<a id="classes">

## Classes

<a id="class-FindAndReplaceState">

### [FindAndReplaceState](module_find-and-replace_findandreplacestate-FindAndReplaceState.md)

<a id="type-definitions">

## Type Definitions

<a id="typedef-FindCallback">

### `FindCallback`

<a id="typedef-FindCallbackResult">

### `FindCallbackResult` _(deprecated)_

<a id="typedef-FindCallbackResultObject">

### `FindCallbackResultObject`

<a id="functions">

## Functions

<a id="function-sortSearchResultsByMarkerPositions">

### `sortSearchResultsByMarkerPositions( model, results ) → Array<FindResultType>` _(internal)_

Sorts search results by marker positions. Make sure that the results are sorted in the same order as they appear in the document to avoid issues with the `find next` command. Apparently, the order of the results in the state might be different than the order of the markers in the model.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-find-and-replace/src/findandreplacestate.ts#L178)

#### Parameters

* `model: Model`
* `results: Array<FindResultType>`

#### Returns

* `Array<FindResultType>`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
