[英]Cannot declare global variables with TypeScript
不知道這是否是最好的方法:
在我的項目suman.d.ts
文件中,我有:
import Global = NodeJS.Global;
interface SumanGlobal extends Global {
_writeTestError: Function,
sumanRuntimeErrors: Array<Error | string>,
sumanOpts: Object,
sumanUncaughtExceptionTriggered: boolean
}
declare var global: SumanGlobal;
似乎暫時起作用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.