Is possible I export a class static method on TypeScript to NodeJs? Example:
class Help {
static show() { ... }
}
export = Help.show;
It returns it:
class.Help.ts(5,19): error TS1005: ';' expected.
An alternative solution:
class Help {
static show() { }
}
var show = Help.show;
export = show;
The limitation is by design. Stuff after export = needs to be an identifier. E.g. the following will not compile either:
var foo = {show:()=>null}
export = foo.show;
this in a function. This is not required for static methods as this will not point to some instance. this preservation is need for member methods and typescript has good ways : youtube.com/watch?v=tvocUcbCupA