Open ildefons opened 2 years ago
I installed cap-js in my typescript project as indicated yarn add ...
, but it fails to find the typescript declaration for root and roterand
@ildefons the declarations directory is only available at the source, the library has a public interface where the exports are defined. In other words, take into account the public interface of the package where the exports are defined.
You have the package.json "main" defined here https://github.com/Psychedelic/cap-js/blob/main/package.json#L8
"main": "dist/index.js",
You can see what's exported in the library entry-point https://github.com/Psychedelic/cap-js/blob/main/src/index.ts
For types you can also find:
"types": "dist/index.d.ts",
` Type> node1@1.0.0 start
node_modules/@psychedelic/cap-js/dist/index.d.ts:4:29 - error TS2307: Cannot find module './declarations/cap/router' or its corresponding type declarations.
4 import _ROUTER_SERVICE from "./declarations/cap/router";
node_modules/@psychedelic/cap-js/dist/index.d.ts:6:181 - error TS2307: Cannot find module './declarations/cap' or its corresponding type declarations.
6 import { GetUserRootBucketsResponse, GetTokenContractRootBucketResponse, GetTransactionResponse, GetTransactionsResponseBorrowed, GetIndexCanistersResponse, IndefiniteEvent } from "./declarations/cap";
node_modules/@psychedelic/cap-js/dist/utils.d.ts:2:23 - error TS2307: Cannot find module './declarations/cap/root' or its corresponding type declarations.
2 import { Event } from "./declarations/cap/root";