-
Notifications
You must be signed in to change notification settings - Fork 90
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 typescript type support #175
Comments
Hi, Thanks - yes, the documentation for TypeScript on Espruino isn't great @bobrippling when you have a moment, would you be able to jump in and provide some pointers? @bobrippling has done a huge chunk of Typescript work, especially for Bangle.js, and I believe most of that is now auto-generated: https://github.com/espruino/BangleApps/tree/master/typescript |
Hey - yes I'm not familiar with How have you found setting up the repo you referenced? |
Actually I realise the directory I linked also links to https://github.com/espruino/Espruino/blob/master/TYPESCRIPT.md which explains about auto-generating the typescript - a lot of work has gone into that, so if we can find any way to not hand-write TS declarations that would be way better. I feel like probably we need a generic (non-bangle.js) export and to then try and get |
I tried updating scripts/build_types.js so that the espruino.d.ts it generates matches the type definitions (http://www.espruino.com/Reference#software) in the official api documentation |
Cool, do you have the branch for this? |
I am reading through the code; |
That's a good question - maybe you could submit a PR to the project?
If you see something you want changing you are welcome to contribute updated typings. If you find the relevant file (which you can do by going to https://www.espruino.com/Reference#software, finding the function and clicking |
I don't see any `{{ in that screenshot? But that file is C, not JS |
The end of this line |
Ahh, sorry - didn't spot that! Yes, that's a typo. It won't affect the code, but it's a bit ugly for sure - just fixed it |
I'm a newbie to esprunio and the official documentation [https://www.espruino.com/Typescript+and+Visual+Studio+Code+IDE](https://www.espruino.com/Typescript+ and+Visual+Studio+Code+IDE) which seems to be aged and actually difficult to run.
The library
@types/espruino
also doesn't type-define as expected, so I also need to write a.d.ts
file for more accurate type-definition when usingtypescript
.https://github.com/2234839/espruino_ts
I remember seeing an issue about espruino automatically generating type definitions, and I'd like to handwrite a better
@types/espruino
for esprunio if this converter doesn't live up to expectations.Is this required, and if so what are the other requirements?
The text was updated successfully, but these errors were encountered: