nodejs如何在typescript项目中申明全局变量-牛翰网

nodejs如何在typescript项目中申明全局变量

这样做的目的是避免循环引用,编写多余的类型文件 //global.d.ts import type { A } from './a'; import type { B } from './b'; declare global { var a: A; var b: B; } //index.ts import { ...