$typeof() returns a type derived from its argument, this function is used to assign or ovrride a type parameter, or in a comparison with another $typeof, and evaluated during elaboration. so, it's usually used in generate block.
$typename() returns a string that represents the resolved type of its argument.