Skip to content

Type Editor


Type Editor / @type-editor/search / types/QueryImpl / QueryImpl

Interface: QueryImpl

Defined in: types/QueryImpl.ts:9

Internal interface for query implementation strategies. Different implementations handle string search vs. regex search.

Methods

findNext()

ts
findNext(
   state,
   from,
   to): SearchResult;

Defined in: types/QueryImpl.ts:18

Finds the next occurrence of the query in the document.

Parameters

ParameterTypeDescription
statePmEditorStateThe editor state to search in
fromnumberThe position to start searching from
tonumberThe position to search up to

Returns

SearchResult

The search result if found, or null if no match exists


findPrev()

ts
findPrev(
   state,
   from,
   to): SearchResult;

Defined in: types/QueryImpl.ts:28

Finds the previous occurrence of the query in the document.

Parameters

ParameterTypeDescription
statePmEditorStateThe editor state to search in
fromnumberThe position to start searching from
tonumberThe position to search back to

Returns

SearchResult

The search result if found, or null if no match exists