This org-mode babel extension enables you to execute typescript code blocks.
You need to install node.js and typescript to use this extension.
With setting up MELPA, use M-x package-install ob-typescript
.
Add ob-typescript.el to your load-path
and require.
(add-to-list 'load-path "/path/to/ob-typescript.el")
(require 'ob-typescript)
(org-babel-do-load-languages
'org-babel-load-languages
'((typescript . t)
))
module Greeting {
export class Hello {
constructor(private text : string) {
}
say() :void{
console.log(this.text);
}
}
}
var hello : Greeting.Hello = new Greeting.Hello("Hello, World!");
hello.say();
You can see transpile results by specifying “:wrap SRC js” header argument.
module Greeting {
export class Hello {
constructor(private text : string) {
}
say() :void{
console.log(this.text);
}
}
}
var hello : Greeting.Hello = new Greeting.Hello("Hello, World!");
hello.say();