reflection - Decorate all properties with type metadata in TypeScript -


given code:

class foo {     text: string; } 

typescript produce javascript:

var foo = (function () {     function foo() {     }     return foo; }()); 

but if decorate text decorator, such function bar(t, k) {} this:

class foo {     @bar text: string; } 

typescript produce:

var foo = (function () {     function foo() {     }     __decorate([         bar,          __metadata('design:type', string)     ], foo.prototype, "text", void 0);     return foo; }()); 

that is, decorates text bar function and design:type metadata. great, i'd instruct typescript decorate all properties design:type metadata, without need of bogus decorator @bar.

is possibile in latest typescript? if not (see comments) suggestions on how use compiler api achieve this?


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -