> But type declaration may not be in the view port.
Type declaration doesn't have to be in the view; the very point of type annotations is to support static type systems, which you can query about any type. For example, if you use mypy, you can add `reveal_type( any_kind_of_expr )` anywhere in your code and you'll get the most precise type available, be it inferred or declared manually, for that expression at given point in code.
But type declaration may not be in the view port.
Or you may read a script or snippet, which is a type or code that won't bother with typing.