VS Code TypeScript IntelliSense不提示global.d.ts中的全局命名空间
全局命名空间的IntelliSense补全问题
在应用中声明全局命名空间后,代码可正常运行且无编译错误,但IntelliSense存在补全异常:输入命名空间名称(如libTypes)时无补全提示,不过输入libTypes.后,IntelliSense会正常列出该命名空间下的所有可用类型。
相关代码示例
global.d.ts 示例
import * as _libTypes from 'library/types'; declare global { const libTypes: typeof _libTypes; } export as namespace libTypes; export = _libTypes;
tsconfig.json 配置
{ "files": [ "src/main.ts" ], "include": [ "src/**/*.d.ts" ] }
内容的提问来源于stack exchange,提问作者Valentin
相关产品推荐
相关产品推荐

