Filter exports only when we are trying to import from a module

This way types that are not exported are still defined during type
checking, but the user will get an error message if they try to use
them directly.