For any app in apps
, I need a global.d.ts
having some types like this
interface Window{
analytics: any;
}
It needs to be reusable and shifted to packages/types
and can be used anywhere in apps.
I moved the Window type to packages/types
but global types weren't working while importing in apps.
Setting this up properly requires a few steps:
shared-types
package inside thepackages
folder of your monorepopackage.json
ofshared-types
, define where the types are located:shared-types
dependency to the apps that need itSee this Sharing Code and Internal Packages sections of the Turborepo docs for more details.