打字稿错误和预期的声明或声明

时间:2020-07-03 19:27:34

标签: typescript

此文件中出现错误,但是我没有发现任何错误,是吗? 我逐个删除每个语句,直到文件为空,错误才消失。

当然,我希望出现错误或问题“}”等。但是我什么也没看到。 enter image description here

global.d.ts

declare module '*.scss' {
  const content: {[className: string]: string};
  export = content;
}

declare global {
  type Dictionary<T> = {[key: string]: T};
}

type GenericFunction = (...any: any[]) => any;
type GenericObject = {
  [key: string]: string
}

declare global {
  interface Window {
    addEventListener:any;
    adEventListener:any
  }
}

还有第二个问题。您是否应该将声明全局项目嵌套在一个“全局”下? ((顺便说一句,我确实嵌套了,但这并不能解决问题))。

0 个答案:

没有答案