I have the following problem i have the function "Foo" typed as the following.

```
function Foo(...cons: any[]) {
    return function (this: {inject: any}) {
            return (bar: any) => {
                this.onChange  // notice here how i have access to onChange
                return reactC;
        }
    }
}

```

The above code is almost what i want basically i'm hoping the "this" type iv'e added will be able to be used inside "bar" (ignore the 'any's those are the types i can easily get, i just want the "this" to be properally typed.

Implemented it looks like this.

```
export const TestImplementation: typeof Foo = Foo([Input])()(class TestClass {
    testFunction() {
        //this.inject
    }
});

```

// the "this" context of type 'void' is not assignable to the methods 'this' of type 'any'

and 'this.inject' isn't present.

Don't think my implementation is right but looking for any way to alter the type of 'this' within a class 
<https://preview.tinyurl.com/ycc9c4l5>
< safe link to the playground with this problem