I have a published TypeScript module (let's call it shared-stuff
) that is designed to be imported by other TypeScript modules. This shared-stuff
module has third-party dependencies that have no @types
-scoped declarations, so inside of that module there are several declaration files:
/lib/declarations/
something.d.ts
another-thing.d.ts
These declaration files work fine within the context of shared-stuff
. However, once the consuming app starts importing from shared-stuff
, TypeScript gives me errors like:
Could not find a declaration file for module 'another-thing'.
I can work around this challenge by having the consumer explicitly import the .d.ts
files from the dependency, but this is not ideal since every consumer would have to do that same thing.
Is there a way to have a consuming module "inherit" the declarations from a dependency?