File tree Expand file tree Collapse file tree 2 files changed +29
-31
lines changed Expand file tree Collapse file tree 2 files changed +29
-31
lines changed Original file line number Diff line number Diff line change @@ -4,36 +4,6 @@ import 'codemirror/addon/mode/overlay'
4
4
import 'codemirror/mode/markdown/markdown'
5
5
import debounce from 'lodash/debounce'
6
6
7
- window . CodeMirror = CodeMirror
8
-
9
- declare module 'codemirror' {
10
- function autoLoadMode ( instance : CodeMirror . Editor , mode : string ) : void
11
-
12
- interface ModeInfo {
13
- name : string
14
- mime ?: string
15
- mimes ?: string [ ]
16
- mode : string
17
- ext : string [ ]
18
- alias ?: string [ ]
19
- }
20
- const modeInfo : ModeInfo [ ]
21
-
22
- interface Editor {
23
- options : CodeMirror . EditorConfiguration
24
- }
25
-
26
- function findModeByMIME ( mime : string ) : ModeInfo | undefined
27
- function findModeByName ( name : string ) : ModeInfo | undefined
28
-
29
- function runMode (
30
- text : string ,
31
- modespec : any ,
32
- callback : HTMLElement | ( ( text : string , style : string | null ) => void ) ,
33
- options ?: { tabSize ?: number ; state ?: any }
34
- ) : void
35
- }
36
-
37
7
const dispatchModeLoad = debounce ( ( ) => {
38
8
window . dispatchEvent ( new CustomEvent ( 'codemirror-mode-load' ) )
39
9
} , 300 )
Original file line number Diff line number Diff line change 1
- declare module 'codemirror/mode/*' {
1
+ import CodeMirror from 'codemirror'
2
2
3
+ declare module 'codemirror/mode/*'
4
+
5
+ declare module 'codemirror' {
6
+ function autoLoadMode ( instance : CodeMirror . Editor , mode : string ) : void
7
+
8
+ interface ModeInfo {
9
+ name : string
10
+ mime ?: string
11
+ mimes ?: string [ ]
12
+ mode : string
13
+ ext : string [ ]
14
+ alias ?: string [ ]
15
+ }
16
+ const modeInfo : ModeInfo [ ]
17
+
18
+ interface Editor {
19
+ options : CodeMirror . EditorConfiguration
20
+ }
21
+
22
+ function findModeByMIME ( mime : string ) : ModeInfo | undefined
23
+ function findModeByName ( name : string ) : ModeInfo | undefined
24
+
25
+ function runMode (
26
+ text : string ,
27
+ modespec : any ,
28
+ callback : HTMLElement | ( ( text : string , style : string | null ) => void ) ,
29
+ options ?: { tabSize ?: number ; state ?: any }
30
+ ) : void
3
31
}
You can’t perform that action at this time.
0 commit comments