6
6
// See docs https://codemirror.net/doc/manual.html#addon_show-hint
7
7
8
8
declare module CodeMirror {
9
- var commands : any ;
9
+ var commands : any ;
10
10
11
11
/** Provides a framework for showing autocompletion hints. Defines editor.showHint, which takes an optional
12
12
options object, and pops up a widget that allows the user to select a completion. Finding hints is done with
13
13
a hinting functions (the hint option), which is a function that take an editor instance and options object,
14
14
and return a {list, from, to} object, where list is an array of strings or objects (the completions), and
15
15
from and to give the start and end of the token that is being completed as {line, ch} objects. An optional
16
16
selectedHint property (an integer) can be added to the completion object to control the initially selected hint. */
17
- function showHint ( cm : CodeMirror . Doc , hinter ?: ( doc : CodeMirror . Doc ) => Hints , options ?: ShowHintOptions ) : void ;
18
-
17
+ function showHint ( cm : CodeMirror . Doc , hinter ?: ( doc : CodeMirror . Doc ) => Hints , options ?: ShowHintOptions ) : void ;
19
18
20
19
interface Hints {
21
20
from : Position ;
22
21
to : Position ;
23
- list : Hint [ ] | string [ ] ;
22
+ list : ( Hint | string ) [ ] ;
24
23
}
25
24
26
25
/** Interface used by showHint.js Codemirror add-on
@@ -38,8 +37,8 @@ declare module CodeMirror {
38
37
39
38
interface Editor {
40
39
/** An extension of the existing CodeMirror typings for the Editor.on("keyup", func) syntax */
41
- on ( eventName : string , handler : ( doc : CodeMirror . Doc , event : any ) => void ) : void ;
42
- off ( eventName : string , handler : ( doc : CodeMirror . Doc , event : any ) => void ) : void ;
40
+ on ( eventName : string , handler : ( doc : CodeMirror . Doc , event : any ) => void ) : void ;
41
+ off ( eventName : string , handler : ( doc : CodeMirror . Doc , event : any ) => void ) : void ;
43
42
}
44
43
45
44
/** Extend CodeMirror.Doc with a state object, so that the Doc.state.completionActive property is reachable*/
@@ -50,7 +49,7 @@ declare module CodeMirror {
50
49
51
50
interface ShowHintOptions {
52
51
completeSingle : boolean ;
53
- hint : ( doc : CodeMirror . Doc ) => Hints ;
52
+ hint : ( doc : CodeMirror . Doc ) => Hints ;
54
53
}
55
54
56
55
/** The Handle used to interact with the autocomplete dialog box.*/
@@ -63,7 +62,7 @@ declare module CodeMirror {
63
62
pick ( ) : void ;
64
63
data : any ;
65
64
}
66
-
65
+
67
66
interface EditorConfiguration {
68
67
showHint ?: boolean ;
69
68
hintOptions ?: ShowHintOptions ;
0 commit comments