Typed throw functions

It does. It's quite okay in TypeScript so far as shown here: Question/Idea: Improving explicit error handling in Swift (with enum operations)

In this post I try to evaluate how that could look for Swift with enums.