TypeScript Version: 3.9.2, 3.8.3, 3.1.6 3.0.3 (and likely more)
Search Terms:
declaration file export, non-exported types, implicit export, dts, .d.ts, es-modules declaration
Code
module.d.ts
export declare const explicitlyExported: {};
declare const implicitlyExported: {};
importer.d.ts
import { implicitlyExported } from "./module"; // no error, is usable import
Expected behavior:
Error: Module '"./module"' has no exported member 'implicitlyExported'.
Actual behavior:
No error.
Even thought it wasn't exported, implicitlyExported is available for import.
Playground Link:
n/a (declaration file issue)
Related Issues:
TypeScript Version: 3.9.2, 3.8.3, 3.1.6 3.0.3 (and likely more)
Search Terms:
declaration file export, non-exported types, implicit export, dts, .d.ts, es-modules declaration
Code
module.d.ts
importer.d.ts
Expected behavior:
Error: Module '"./module"' has no exported member 'implicitlyExported'.
Actual behavior:
No error.
Even thought it wasn't exported,
implicitlyExportedis available for import.Playground Link:
n/a (declaration file issue)
Related Issues: