Augmentations for the global scope can only be directly nested in external modules or ambient module declarations(2669)
You can indicate that the file is a module like so:
export {};
declare global {
namespace NodeJS {
interface Global {
config: MyConfigType
}
}
}
Or if you're trying to add a global type within the browser context:
export {};
declare global {
interface Window {
ENV: any;
}
}