'How can I split type declarations into multiple files?
I created a types package (@types/acme) that gets imported into multiple projects.
The type package currently declares all its types in a single index.d.ts and that works fine.
declare enum Device { Desktop = "desktop", Phone = "phone" }
declare enum Browser { Firefox = "firefox", Chrome = "chrome" }
How can I split the declarations from index.d.ts into multiple files so that the above declarations end up in devices.d.ts and browsers.d.ts ?
When splitting the declarations into their own files, they are recognized inside the types packages BUT they are no longer recognized by the projects that declare @types/acme as their dependency.
Later Edit: We are currently using an approach similar to https://github.com/types/sequelize where we explicitly import the types but I'm still wondering if there is a way to split de declarations and have them available in the projects as ambient types.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
