Invalid generated types for `typeof` imported objects

The slightly hacky setup for resolving local modules with typescript causes issues in the generated declaration files. Using typeof includes a dynamic import in the generated types. If that type is a local package, the import is a relative path which when packaged is no longer valid.

I think the best course of action is to avoid typeof on imported functions so this should be documented as well.