-
Notifications
You must be signed in to change notification settings - Fork 28
Missing type definition file in root dir #43
Copy link
Copy link
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels