Fix many tsc errors
This MR fixes all the tsc errors which can we fixed without playing with JSDoc typing.
The commit names are (I hope) self explanatory, ohterwise don't hesitate to ask for details. I just took all the error provided by
yarn ci:ts-client and tried to fix them without JSDOc typing.