I wrote a typescript library that I’ve used successfully in several projects. It includes several types.
I have now written an Angular library that consumes the above typescript library. I would like to export the typescript library types as part of the Angular library, but nothing appears to be working.
I have tried (‘type’, ‘namespace’, and ‘my-lib’ are placeholders for the actual values, used only to illustrate the issue):
export { <type> } from "<my-lib>";
export * from "<my-lib>";
export { default as <type> } from "<my-lib>";
export * as <namespace> from "<my-lib>";
Nothing seems to work. I have tried pretty much every suggestion that I’ve seen online.
When I install the Angular library that I created, none of the types from ‘my-lib’ are recognized.
I see the types from the Angular library, but not the ‘my-lib’ library.
Surely there must be some way to accomplish this. It would be silly to have to ask a developer to install another package, before using my Angular library.
Edit: just for laughs, I exported the ‘rxjs’ library from the ‘my-lib’ public-api.ts file, using:
export * from 'rxjs';
And of course, that shows up with no issue. So, obviously it’s possible. That being said, I’m unable to reproduce the same result from ‘my-lib’.
user25611283 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.