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 \
3333mode/markdown/markdown_math.js \
3434mode/gfm/gfm.js \
3535mode/javascript/javascript.js \
36+ mode/typescript/typescript.js \
37+ mode/jsx/jsx.js \
3638mode/css/css.js \
3739mode/htmlmixed/htmlmixed.js \
3840mode/htmlembedded/htmlembedded.js \
You can’t perform that action at this time.
0 commit comments