Is TypeScript not using revealing module pattern for classes? I expected different result from this code.
class Test {
private privateProperty: any;
public publicProperty: any;
}
generates this:
var Test = (function () {
function Test() { }
return Test;
})();
I expected something like this:
var test = (function(){
var privateProperty;
var publicProperty;
return {
publicProperty: publicProperty;
};
})();
private/publicchecking is just done by the compiler and doesn’t influence generated code. (But that’s just a guess.:)) Your second example wouldn’t be right, though; it doesn’t even return a function.moduleis most similar to what you've posted