Skip to content

Missing type definition file in root dir #43

Description

@Ekliptor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions