Relaxing declaration emit visiblity rules

With import types available, many of the visibility errors reported during declaration file generation can be handled by the compiler without the need to change the input.

For instance:

  1. import { createHash } from "crypto";
  2. export const hash = createHash("sha256");
  3. // ^^^^
  4. // Exported variable 'hash' has or is using name 'Hash' from external module "crypto" but cannot be named.

With TypeScript 2.9, no errors are reported, and now the generated file looks like:

  1. export declare const hash: import("crypto").Hash;