If I have an api that looks like this:
const execute = (func) => {
return func();
};
how can I ensure that the function always returns a value? The only solution that comes to mind is:
type Func = () => !never;
const execute = (func: Func) => func();
however, !never
does not exist.