-
Notifications
You must be signed in to change notification settings - Fork 74
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
typescript definitions - howto #244
Comments
@simllll - This was super helpful, thank you. As a note to anyone else coming across this, steps I took to solve the problem:
If you run into this error when trying to run
you can install a Java Runtime with
Go ahead and run that |
For what it's worth, I also took a crack at improving the official definitions, at least for the issues that were impacting me. The process to improve those is well defined and documented in the DefinitelyTyped repo, if a bit slow on the approval side due to lack of types/asana maintainers: DefinitelyTyped/DefinitelyTyped#57226 |
Another round of improvements is going in soon: DefinitelyTyped/DefinitelyTyped#60589 |
this should just be a hint for everyone who is looking for complete and (almost) valid type definitions,
currently @types/asana is incomplete and partly wrong, the best and easiert workaround I've found is to generate your own api client via open api files.
e.g. you can go to editor.swagger.com and download your client, or by using the following command:
after that you have a AsanaClient folder inside of "src" folder, e.g.
![image](https://user-images.githubusercontent.com/5757263/133940114-7901a0d1-eaac-4ddd-b2a6-5f1bacd0c863.png)
To use the api, here is an example code to get the basic idea:
the types are quite good, except for creating a task memberships properties, it assumes that project and section should be an object with a format like { gid: string }, but the correct type is just a gid (string). I guess there are more flaws, but for now I couldn't find anything else.
Hope this helps someone!
The text was updated successfully, but these errors were encountered: