1
+ import { editor } from 'monaco-editor'
2
+
1
3
export default class VimStatusBar {
2
- constructor ( node , editor , sanitizer = null ) {
4
+ private node : HTMLElement
5
+
6
+ private editor : editor . IStandaloneCodeEditor
7
+
8
+ private modeInfoNode = document . createElement ( 'span' )
9
+
10
+ private secInfoNode = document . createElement ( 'span' )
11
+
12
+ private notifNode = document . createElement ( 'span' )
13
+
14
+ private keyInfoNode = document . createElement ( 'span' )
15
+
16
+ private sanitizer : null | ( ( content : string ) => string )
17
+
18
+ constructor ( node : HTMLElement , editor : editor . IStandaloneCodeEditor , sanitizer = null ) {
3
19
this . node = node
4
- this . modeInfoNode = document . createElement ( 'span' )
5
- this . secInfoNode = document . createElement ( 'span' )
6
- this . notifNode = document . createElement ( 'span' )
7
20
this . notifNode . className = 'vim-notification'
8
- this . keyInfoNode = document . createElement ( 'span' )
9
21
this . keyInfoNode . setAttribute ( 'style' , 'float: right' )
10
22
this . node . appendChild ( this . modeInfoNode )
11
23
this . node . appendChild ( this . secInfoNode )
@@ -16,7 +28,7 @@ export default class VimStatusBar {
16
28
this . sanitizer = sanitizer
17
29
}
18
30
19
- setMode ( ev ) {
31
+ setMode ( ev : { mode : string ; subMode : string } ) {
20
32
if ( ev . mode === 'visual' && ev . subMode === 'linewise' ) {
21
33
this . setText ( '--VISUAL LINE--' )
22
34
return
@@ -25,7 +37,7 @@ export default class VimStatusBar {
25
37
this . setText ( `--${ ev . mode . toUpperCase ( ) } --` )
26
38
}
27
39
28
- setKeyBuffer ( key ) {
40
+ setKeyBuffer ( key : string ) {
29
41
this . keyInfoNode . textContent = key
30
42
}
31
43
@@ -66,7 +78,7 @@ export default class VimStatusBar {
66
78
this . modeInfoNode . textContent = text
67
79
}
68
80
69
- toggleVisibility ( toggle ) {
81
+ toggleVisibility ( toggle : boolean ) {
70
82
if ( toggle ) {
71
83
this . node . style . display = 'block'
72
84
} else {
0 commit comments