Skip to content

Commit b3aeee6

Browse files
committed
Merge pull request DefinitelyTyped#5745 from borisyankov/fix/codemirror-showhint
codemirror showhint formatting
2 parents 874426b + 1f5d902 commit b3aeee6

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

codemirror/codemirror-showhint.d.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@
66
// See docs https://codemirror.net/doc/manual.html#addon_show-hint
77

88
declare module CodeMirror {
9-
var commands : any;
9+
var commands: any;
1010

1111
/** Provides a framework for showing autocompletion hints. Defines editor.showHint, which takes an optional
1212
options object, and pops up a widget that allows the user to select a completion. Finding hints is done with
1313
a hinting functions (the hint option), which is a function that take an editor instance and options object,
1414
and return a {list, from, to} object, where list is an array of strings or objects (the completions), and
1515
from and to give the start and end of the token that is being completed as {line, ch} objects. An optional
1616
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;
1918

2019
interface Hints {
2120
from: Position;
2221
to: Position;
23-
list: Hint[] | string[];
22+
list: (Hint | string)[];
2423
}
2524

2625
/** Interface used by showHint.js Codemirror add-on
@@ -38,8 +37,8 @@ declare module CodeMirror {
3837

3938
interface Editor {
4039
/** 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;
4342
}
4443

4544
/** Extend CodeMirror.Doc with a state object, so that the Doc.state.completionActive property is reachable*/
@@ -50,7 +49,7 @@ declare module CodeMirror {
5049

5150
interface ShowHintOptions {
5251
completeSingle: boolean;
53-
hint: (doc : CodeMirror.Doc) => Hints;
52+
hint: (doc: CodeMirror.Doc) => Hints;
5453
}
5554

5655
/** The Handle used to interact with the autocomplete dialog box.*/
@@ -63,7 +62,7 @@ declare module CodeMirror {
6362
pick(): void;
6463
data: any;
6564
}
66-
65+
6766
interface EditorConfiguration {
6867
showHint?: boolean;
6968
hintOptions?: ShowHintOptions;

0 commit comments

Comments
 (0)