import { Extension } from '../../types'; import { SearchFilter } from './search'; /** * Extension that highlights selection matches in an editor. * @param caseSensitive Whether or not matches must have the same case. Defaults to false. * @param minLength Minimum length needed to perform a search. Defaults to 1. * @param maxLength Maximum length at which to perform a search. Defaults to 200. * Lower values of `minLength` and higher values of `maxLength` can impact performance. * * The CSS-selector `.selection-matches span` can be used to style the matches. */ declare const highlightSelectionMatches: (caseSensitive?: boolean, minLength?: number, maxLength?: number) => Extension; /** * Extension that highlights all instances of the word the cursor is on if there's no selection. * @param filter Function that can filter away matches based on their position. * The filter can be changed later using the `setFilter` method. * @param includeHyphens A function returning whether or not hyphens should be included in the search. * For languages that don't commonly use hyphens as an operator (such as CSS), it makes sense to * return true. If this parameter is omitted, hyphens are not included. * * The CSS-selector `.word-matches span` can be used to style the matches. * * @example * This filters away all words that start inside a string, comment or keyword or regex token. * Different filter functions should be chosen based on the language. * ``` * const selector = ".string, .comment, .keyword, .regex" * const filter = start => !getClosestToken(editor, selector, 0, 0, start) * const includeHyphens = position => getLanguage(editor, position) == "css" * * const extensions = [highlightCurrentWord(filter, includeHyphens)] * ``` */ declare const highlightCurrentWord: (filter?: SearchFilter, includeHyphens?: (cursorPosition: number) => boolean) => Extension; export { highlightSelectionMatches, highlightCurrentWord };