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 im
posted @ 2024-05-23 08:21  Ajanuw  阅读(8)  评论(0编辑  收藏  举报