SteemConnect V2 - Typescript definitions
This is a wrapper of the SteemConnect V2 SDK that is able to run smoothly in Typescript thanks to the typings definitions written in the project.
By using these definitions in a Typescript project, you can get the following benefits:
- Get the documentation for each of the methods
- Use the correct datatype in the methods
- Autocompletation of code.
How to use
Supposing you already have SteemConnect V2 SDK (sc2-sdk) installed:
- First, you need to copy the types folder from my repo: https://github.com/jayserdny/steemConnect-v2-ts into the root of your project.
- Then, you need to tell Typescript where are your types by adding the following in your tsconfig.json file:
"typeRoots" : ["./types/sc2-sdk"]
For instance, your file will look similar to the following:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"typeRoots" : ["./types/sc2-sdk"]
}
}
And Typescript will automatically help you autocompleting the methods and checking the types for the methods in the SDK.
Example
As shown in the image above, you can see all the methods available in the SDK.
And you get the benefit to check what are the parameters and datatype for any method. Also, you get a brief definition of what the method does.
IDE / Frameworks benefits
- Avoid linter issues when compiling
- Avoid wrong datatype
- Avoid misspelled methods
And this can be implemented in any framework that uses Typescript and will work with any IDE that supports Typescript.
How to contribute
- Fork the following repo https://github.com/jayserdny/steemConnect-v2-ts
- Checkout a branch into your repo
- Commit the changes you did to your branch
- Make a pull request in my repo.
Proof of Github account
There is my account logged in into Github as a proof of ownership.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thanks! Since it is already approved, I will include your suggestion in the Readme file in the repo.
You can still edit your post and make it better and I encourage you to do it, even if I approved it.
We prefer accepting and suggest modification rather that reject out right.
Post updated. Suggested details added and license was added to the repo. Thanks.
I thought is was against your TOS. If so, I will update it when I have a chance :)
Hey @jaysermendez I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x