当我将这个库安装到我的CLI项目中并尝试引用其中的类型时,我得到了以下错误信息:
error TS2306: File 'C:/ng-ikr-lib-test/node_modules/@types/fhir/index.d.ts' is not a module.
这是我的tsconfig:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
以及我的应用程序 tsconfig,它扩展了上述内容。
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"types": ["fhir"]
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}
您如何在angular-cli应用程序中使用此库中定义的类型?