> For the complete documentation index, see [llms.txt](https://sudevgeny.gitbook.io/typescript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sudevgeny.gitbook.io/typescript/project/modules/globals.md).

# globals.d.ts

We discussed *global* vs. *file* modules when covering [projects](/typescript/project/modules.md) and recommended using file based modules and not polluting the global namespace.

Nevertheless, if you have beginning TypeScript developers you can give them a `globals.d.ts` file to put interfaces / types in the global namespace to make it easy to have some *types* just *magically* available for consumption in *all* your TypeScript code.

> For any code that is going to generate *JavaScript* we highly recommend using *file modules*.

* `globals.d.ts` is great for adding extensions to `lib.d.ts` if you need to.
* It's good for quick `declare module "some-library-you-dont-care-to-get-defs-for";` when doing JS to TS migrations.
