Thats not what I was talking about, but take for example req.data, you can't safely use it, a good example of how to do things is koa, where Middleware is generic amd takes a type for your state so you dont have to worry about combinding middleware in wromg ways
I think you have to make your own interfaces and type aliases to type the objects and return types of middleware the way you want. You can have dynamic properties in interfaces.
It's probably not as good as types built into libraries but at least it's an option.
At least there's this scaffold to start github.com/Microsoft/TypeScript-No...
Thats not what I was talking about, but take for example req.data, you can't safely use it, a good example of how to do things is koa, where Middleware is generic amd takes a type for your state so you dont have to worry about combinding middleware in wromg ways
I think you have to make your own interfaces and type aliases to type the objects and return types of middleware the way you want. You can have dynamic properties in interfaces.
It's probably not as good as types built into libraries but at least it's an option.
I wasnt saying you cant do it, but its harder than it needs to be and not as flexible