-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaration file non-exported types are importable #38592
Comments
implicitlyExported
is available for import even though it was not exportedimplicitlyExported
is available for import even though it was not exported
implicitlyExported
is available for import even though it was not exported
As far as we can tell, this is how TS currently decides which mode to use for declaration files. Is this intended? What is the use case for implicit exports / mixed mode?
|
Yeah, this is unfortunately... by design... if you add |
Thanks @weswigham |
Are there any plans on changing this behavior, maybe in a major release some time? |
No |
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,
implicitlyExported
is available for import.Playground Link:
n/a (declaration file issue)
Related Issues:
The text was updated successfully, but these errors were encountered: