icon-sdk-js
icon-sdk-js copied to clipboard
Need Typescript Types Support
Hey @WeiLi512, I've just ran into this issue. I might look at what's involved in getting the types added to DefinitelyTyped. I'd be interested to get some feedback from you if I do, or if you've made a start then I'd be happy to collaborate on that
I am very happy to give feedback if you do that. I am using the icon-sdk-js library in one project that uses typescript.
I will also involve in your project if you start the project.
Hey @bkbooth, Did you start the development of adding types? I want to contribute to the project. Please let me know if you have any updates. Thanks.
@WeiLi512 I've sort of made a start. I have a @types/icon-sdk-js.d.ts
local to my current project where I'm trying to type things from the SDK as I use them. I might take a look today how to move that to a separate repo so we can collaborate.
Cool. I hope to see the repo soon.
I'm still not sure the best way to move this to a repo yet, I haven't been able to prioritise this. I copied what I've got into a gist in case it helps you. I'm actively implementing icon-sdk-js features into my current project so I'll be fleshing this out over the next week or 2. Feel free to add comments or revisions, we might just be able to collaborate via this gist for a bit
https://gist.github.com/bkbooth/cbb66db2057db1b81be1d7735d9031fa
At the moment I just have this local to my project in ./@types/icon-sdk-js.d.ts
and the TS compiler is finding the types definitions.
Great I am also using the icon-sdk-js package in my current project using typescript. This gist will help me. I will also give feedback while using the gist in my project. Thanks.
Setting up the gist inspired me to see what's involved in setting up the repo. I set this up and it seems to mostly work, but I'm having an issue with the bignumber.js
dependency/version in my actual project when I link this. I'll leave it for now, but feel free to take a look and see if you can get it working.
https://github.com/bkbooth/types-icon-sdk-js
https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html If you knew that, you would have taken less time. I also just know that. Anyway thanks for your work.
@WeiLi512 yeah, I found that when I first started looking around. I couldn't get it to work for icon-sdk-js
for some reason though. Have you tried it and got it working? I might not have configured it correctly.
It worked for me. But I had to customize it for some types.
.
#29 We support typescript