UNPKG

1.76 kBTypeScriptView Raw
1// See docs https://codemirror.net/doc/manual.html#addon_match-highlighter
2
3import "../../";
4
5declare module "../../" {
6 interface HighlightSelectionMatches {
7 /**
8 * Minimum amount of selected characters that triggers a highlight (default 2).
9 */
10 minChars?: number | undefined;
11
12 /**
13 * The style to be used to highlight the matches (default "matchhighlight", which will correspond to CSS class cm-matchhighlight).
14 */
15 style?: string | undefined;
16
17 /**
18 * Controls whether whitespace is trimmed from the selection.
19 */
20 trim?: boolean | undefined;
21
22 /**
23 * Can be set to true or to a regexp matching the characters that make up a word.
24 */
25 showToken?: boolean | RegExp | undefined;
26
27 /**
28 * Used to specify how much time to wait, in milliseconds, before highlighting the matches (default is 100).
29 */
30 delay?: number | undefined;
31
32 /**
33 * If wordsOnly is enabled, the matches will be highlighted only if the selected text is a word.
34 */
35 wordsOnly?: boolean | undefined;
36
37 /**
38 * If annotateScrollbar is enabled, the occurences will be highlighted on the scrollbar via the matchesonscrollbar addon.
39 */
40 annotateScrollbar?: boolean | undefined;
41 }
42
43 interface EditorConfiguration {
44 /**
45 * Adds a highlightSelectionMatches option that can be enabled to highlight all instances of a currently selected word.
46 * When enabled, it causes the current word to be highlighted when nothing is selected (defaults to off).
47 */
48 highlightSelectionMatches?: HighlightSelectionMatches | boolean | undefined;
49 }
50}