-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better user-facing types #142
Comments
I added a healthy dose of e.g. https://github.com/algorandfoundation/algokit-client-generator-ts/blob/main/examples/helloworld/client.ts#L129 and https://github.com/algorandfoundation/algokit-client-generator-ts/blob/main/examples/helloworld/client.ts#L624 |
From memory I found that when the intellisense came up for the args object itself it was clear and if I moved the expand to the method signature itself it was harder to read |
Side-note: I started out using Expand directly, but the problem I found when using Expand was I saw some problems in trying to define variables that are the equivalent type of a function parameter, so I started using Expand in a defined type and found I still got good intellisense, but had less typing issues in defining variables for the parameters. |
Currently the types on the generated client methods are not very helpful because there are various layers of TypeScript magic going on. The types presented to the user should be very clear in terms of what the expected inputs (or outputs) of a function are.
The easiest way is to probably use even more TypeScript magic to expand the types at the highest level. Something like this PR for the SDK: algorand/js-algorand-sdk#528
Eventually it might be worthwhile to have the types just be defined as explicit, even if there is some repetition in the generated code.
The text was updated successfully, but these errors were encountered: