How do I get TypeScript to emit property definitions such as:
Object.defineProperties(this, {
view: {
value: view,
enumerable: false,
This isn't currently supported if you want all the properties to be emitted like that. I'd recommend filing an issue at the CodePlex site with details about what your use case and requirements are.
If you do compile with --target ES5, you can have something like this:
class n {
get foo() { return 3; }
bar() { return 5; }
}
Which produces this code:
var n = (function () {
function n() { }
Object.defineProperty(n.prototype, "foo", {
get: function () {
return 3;
},
enumerable: true,
configurable: true
});
n.prototype.bar = function () {
return 5;
};
return n;
})();