This pretty much standard way of defining a javascript object (or namespace of functions) fails in typescript, saying that publicFunction does not exist on type {}. Is this by design?
var MyObject = function (){
var that = {};
var privateFunction = function () {};
that.publicFunction = function () {};
return that;
}();
PS: Found a "fix" to it by changing the first line to var that = <any>{}; but I was wondering why is this necessary.