Augmentations for the global scope can only be directly nested in external modules or ambient module declarations(2669)

后端 未结 2 984
不思量自难忘°
不思量自难忘° 2021-02-04 23:14

I would like to store my NodeJS config in the global scope.

I tried to follow this => Extending TypeScript Global object in node.js and other solution on stackoverflow,

2条回答
  •  天命终不由人
    2021-02-04 23:38

    Or if you're trying to add a global type within the browser context:

    export {};
    
    declare global {
      interface Window {
        ENV: any;
      }
    }
    

提交回复
热议问题