This union type looks incorrect. It's saying the return type of the function is invalid. But actually, either the function exists (with whatever its actual signature and return type is), or the entire function does not exist. So not sure where that as invalid at the end is coming from.

This union type looks incorrect. It's saying the return type of the function is
invalid. But actually, either the function exists (with whatever its actual signature and return type is), or the entire function does not exist. So not sure where thatas invalidat the end is coming from.