Can someone explain how to create a class decorator that modifies the decorated class such that TS doesn't yell at me?
I tried creating a simple decorator that simply adds one property bar on the prototype. The code works at runtime (click Run on the playground), but TS is not happy with the code. I'm using Object.defineProperties because my real use-case creates the name dynamically; this is a simplified example of the type woes. If it matters, I'm not making an old TS experimental decorator, but an ES decorator. As far as I can tell, my implementation is compliant with the TC39 proposal. The problem is, that I don't know how to make it compliant with TS and I can't for the life of me find any documentation on how to create ES decorators in TS.
I'm getting multiple confusing errors:
A mixin class must have a constructor with a single rest parameter of type 'any[]'.What does this mean? I tried adding what it requested and the error didn't go away and the requested line errors too. Explicit constructors shouldn't be required anyway in a decorator.Property 'bar' does not exist on type 'Foo'.Why not? It's being added in the decorator and the type is augmented to match. It exists at runtime, so what do I need to do to make TS realize this?

