I’m not sure if that’s possible since I haven’t used Type checking before and am unsure if you could do that.
There’s a guide made by someone who commented about this same issue you’re having. If you have time, I would also recommend reading the guide too as it is quite helpful to help wrap Type Checking in your head
Here’s the response they made about it
But basically in short, since function is used as a keyword to create a function, I don’t think it’s going to be possible to check if something returns a function as of now