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:
import { createHash } from "crypto";
export const hash = createHash("sha256");
// ^^^^
// 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:
export declare const hash: import("crypto").Hash;