TanglePay / TanglePay-SDK

DApp SDK to interact with TanglePay wallets
Apache License 2.0
6 stars 2 forks source link

Export Typing #28

Closed maxcodefaster closed 1 year ago

maxcodefaster commented 1 year ago

To use this esm module in a typescript project it needs types:

https://stackoverflow.com/questions/41292559/could-not-find-a-declaration-file-for-module-module-name-path-to-module-nam

Use case:

I want to import this library in my angular app, but I cant as it has no typings.

alexmengyuan commented 1 year ago

Hi max, We will add types ASAP, Thx for the catch

alexmengyuan commented 1 year ago

Hi max, v0.0.9 has just been released, index.d.ts is added there, let me know if this solves your problem. Thx

maxcodefaster commented 1 year ago

Mhm maybe i am importing it wrong but:

image image
alexmengyuan commented 1 year ago

Hi max, could you try this code snippet to see if it works for you? import * as iota from 'tanglepay-sdk' currently the whole package is export default as an object Thx

maxcodefaster commented 1 year ago

Hi max, could you try this code snippet to see if it works for you? import * as iota from 'tanglepay-sdk' currently the whole package is export default as an object Thx

Same result. Tried this before. I guess it is missing a d.ts file.

image
alexmengyuan commented 1 year ago

Hi max, sorry for the inconvenience, v0.1.1 is out and I checked index.d.ts in npm page's code tab let me know if it solves your problem this time Thx

maxcodefaster commented 1 year ago

Hi max, sorry for the inconvenience, v0.1.1 is out and I checked index.d.ts in npm page's code tab let me know if it solves your problem this time Thx

Yes works! Awesome, thank you :)

image image