When importing slp-sdk in a TypeScript project with:
import * as SLP from "slp-sdk";
it will complain:
Error:(7, 22) TS7016: Could not find a declaration file for module 'slp-sdk'. '/ts-test/node_modules/slp-sdk/lib/SLP.js' implicitly has an 'any' type.
Try `npm install @types/slp-sdk` if it exists or add a new declaration (.d.ts) file containing `declare module 'slp-sdk';`
This error is correct, since there is no .d.ts or .ts file in the root dir.
The best fix would be to rename index.js to index.ts and export proper TS classes (as you already did in bitbox-sdk).
I know I can still use it in a TypeScript project, but without slp-sdk types which defeats the purpose of using TypeScript.
When importing slp-sdk in a TypeScript project with:
import * as SLP from "slp-sdk";it will complain:
This error is correct, since there is no .d.ts or .ts file in the root dir.
The best fix would be to rename
index.jstoindex.tsand export proper TS classes (as you already did in bitbox-sdk).I know I can still use it in a TypeScript project, but without slp-sdk types which defeats the purpose of using TypeScript.