Is there a "best practice" sort of way how one would mark a function in TypeScript with the information that this function throws an error?
In Java one would annotate the function's signature with "throws XYError". This does not work with TypeScript.
I understand that it is not needed for the code to run but as far as I am concerned it is cleaner code when the function signature already tells me such information.
Any reasoned tips on how you guys deal with that situation are appreciated.