3 <title>CodeMirror: TypeScript mode
</title>
4 <meta charset=
"utf-8"/>
5 <link rel=stylesheet
href=
"../../doc/docs.css">
7 <link rel=
"stylesheet" href=
"../../lib/codemirror.css">
8 <script src=
"../../lib/codemirror.js"></script>
9 <script src=
"javascript.js"></script>
10 <style type=
"text/css">.CodeMirror {border-top:
1px solid black; border-bottom:
1px solid black;}
</style>
12 <a href=
"http://codemirror.net"><img id=logo
src=
"../../doc/logo.png"></a>
15 <li><a href=
"../../index.html">Home
</a>
16 <li><a href=
"../../doc/manual.html">Manual
</a>
17 <li><a href=
"https://github.com/marijnh/codemirror">Code
</a>
20 <li><a href=
"../index.html">Language modes
</a>
21 <li><a class=active
href=
"#">TypeScript
</a>
26 <h2>TypeScript mode
</h2>
29 <div><textarea id=
"code" name=
"code">
32 constructor (message: string) {
33 this.greeting = message;
36 return
"Hello, " + this.greeting;
40 var greeter = new Greeter(
"world");
42 var button = document.createElement('button')
43 button.innerText =
"Say Hello"
44 button.onclick = function() {
45 alert(greeter.greet())
48 document.body.appendChild(button)
53 var editor = CodeMirror.fromTextArea(document.getElementById(
"code"), {
56 mode:
"text/typescript"
60 <p>This is a specialization of the
<a href=
"index.html">JavaScript mode
</a>.
</p>