在文件中导入一个空的import
,是因为在没有引入任何模块的情况下,TypeScript 不会识别该文件作为一个模块,并将它视为全局文件。
import ''
/**
* 全局类型声明,无需引入直接在 `.vue` 、`.ts` 、`.tsx` 文件使用即可获得类型提示
*/
declare global {
/**
* 对应 `public/config.json` 文件的类型声明
*/
interface ServerConfigs {
Title?: string
BaseUrl?: string
}
}