File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ ( function ( mod ) {
5
+ if ( typeof exports == "object" && typeof module == "object" ) // CommonJS
6
+ mod ( require ( "../../lib/codemirror" ) , require ( "../javascript/javascript" ) ) ;
7
+ else if ( typeof define == "function" && define . amd ) // AMD
8
+ define ( [ "../../lib/codemirror" , "../javascript/javascript" ] , mod ) ;
9
+ else // Plain browser env
10
+ mod ( CodeMirror ) ;
11
+ } ) ( function ( CodeMirror ) {
12
+ "use strict" ;
13
+
14
+ CodeMirror . defineMode ( "typescript" , function ( config , modeConfig ) {
15
+
16
+ var javascriptConfig = {
17
+ isTS : true
18
+ } ;
19
+ for ( var attr in modeConfig ) {
20
+ javascriptConfig [ attr ] = modeConfig [ attr ] ;
21
+ }
22
+ javascriptConfig . name = "javascript" ;
23
+ return CodeMirror . getMode ( config , javascriptConfig ) ;
24
+
25
+ } , "javascript" ) ;
26
+
27
+ CodeMirror . defineMIME ( "text/typescript" , { name : "typescript" , typescript : true } ) ;
28
+ CodeMirror . defineMIME ( "application/typescript" , { name : "typescript" , typescript : true } ) ;
29
+ } ) ;
Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ mode/xml/xml.js \
33
33
mode/markdown/markdown_math.js \
34
34
mode/gfm/gfm.js \
35
35
mode/javascript/javascript.js \
36
+ mode/typescript/typescript.js \
37
+ mode/jsx/jsx.js \
36
38
mode/css/css.js \
37
39
mode/htmlmixed/htmlmixed.js \
38
40
mode/htmlembedded/htmlembedded.js \
You can’t perform that action at this time.
0 commit comments