Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use @types/fhir in angular cli project

When i npm install this library into my cli project and try to reference the types within it i get this:

 error TS2306: File 'C:/ng-ikr-lib-test/node_modules/@types/fhir/index.d.ts' is not a module.

Here is my 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"
    ]
  }
}

and my app tsconfig which extends the above.

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "module": "es2015",
    "types": ["fhir"]
  },
  "exclude": [
    "src/test.ts",
    "**/*.spec.ts"
  ]
}

How are you supposed to use the types defined in this library in an angular-cli app?

https://www.npmjs.com/package/@types/fhir

like image 453
cobolstinks Avatar asked Sep 16 '26 06:09

cobolstinks


1 Answers

If others stumble upon this, I published a repackaged version of this library to the public npm registry. You can find it here:

https://www.npmjs.com/package/fhir-stu3

Cheers.

like image 170
cobolstinks Avatar answered Sep 17 '26 19:09

cobolstinks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!