Request: Class Decorator Mutation · Issue #4881 · microsoft/TypeScript (original) (raw)
Description
If we can get this to type check properly, we would have perfect support for boilerplate-free mixins:
declare function Blah(target: T): T & {foo: number}
@Blah class Foo { bar() { return this.foo; // Property 'foo' does not exist on type 'Foo' } }
new Foo().foo; // Property 'foo' does not exist on type 'Foo'