Paynow-NodeJS-SDK icon indicating copy to clipboard operation
Paynow-NodeJS-SDK copied to clipboard

Added Paynow Module support for projects built entirely in typescript

Open ghost opened this issue 4 years ago • 0 comments

Your module couldn't be imported into a node project written in Typescript as you were not emitting type declarations during your build using tsc. So, I made the following changes to cater for programmers who would like to use your module whilst still writing their code in Typescript

  1. I set the declaration flag to true in your tsconfig.json file
  2. I set the declaration output directory to "dist/declarations" in your tsconfig.json file
  3. I then set the "types" key to "dist/declarations/index.d.ts" in package.json (so Typescript could find the types when your module is imported in a Typescript Project)
  4. I built the module and then tested it in a MyEAN Stack Web Application written entirely in Typescript and it worked like a charm
  5. I edited READMe.md to include a pointer on how to import your module in a typescript project. That is, I included the statement : import { Paynow } from "paynow";

NB: Now your module can now be imported in both Typescript projects and regular es6 projects

ghost avatar Feb 03 '21 18:02 ghost