CodeMirrorTypeScript mode[ CodeMirror Home Manual Code Language modes TypeScript TypeScript modeclass Greeter { greeting: string; constructor (message: string) { this.greeting = message; } greet() { return "Hello, " + this.greeting; } } </p> <p>var greeter = new Greeter("world");</p> <p>var button = document.createElement('button') button.innerText = "Say Hello" button.onclick = function() { alert(greeter.greet()) }</p> <p>document.body.appendChild(button)</p> <p> This is a specialization of the JavaScript mode.