Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Javascript definition file for Roll20 API (d.ts) aka: intellisense support for Roll20

So, i realised there wasn't one, so i went and made one. Its pretty raw but i will keep adding to it as i work on my library. <a href="https://github.com/finite8/roll20-api-scripts/blob" rel="nofollow">https://github.com/finite8/roll20-api-scripts/blob</a>... Why is this awesome? That's why. Intellisense in VS Code. Really easy to setup. Just setup your folder structure something like this: Bobs your uncle (maybe?). If you want an example of a project setup using it, refer to my Virtual Bard project:&nbsp; <a href="https://github.com/finite8/roll20-api-scripts/tree" rel="nofollow">https://github.com/finite8/roll20-api-scripts/tree</a>...
I have actually been working on rewriting my Roll20 scripts in TypeScript and made my own declaration file. I've gone a little farther with it than you have. I've basically been filling it in as I go when I need to reference parts of the API. You can check it out here:&nbsp; <a href="https://github.com/Shaangor/Roll20/blob/master/src/roll20.d.ts" rel="nofollow">https://github.com/Shaangor/Roll20/blob/master/src/roll20.d.ts</a> . I am also trying to create a mock testing framework to be able to test my scripts outside of the Roll20 sandbox. It is a bit of a pain having to re-upload and restart the sandbox every time and not knowing 100% if your script will work ahead of time. TypeScript helps with that but a full testing suite would help a lot.
1490937102

Edited 1490937481
Shaangor said: I have actually been working on rewriting my Roll20 scripts in TypeScript and made my own declaration file. I've gone a little farther with it than you have. I've basically been filling it in as I go when I need to reference parts of the API. You can check it out here:&nbsp; <a href="https://github.com/Shaangor/Roll20/blob/master/src/roll20.d.ts" rel="nofollow">https://github.com/Shaangor/Roll20/blob/master/src/roll20.d.ts</a> . I am also trying to create a mock testing framework to be able to test my scripts outside of the Roll20 sandbox. It is a bit of a pain having to re-upload and restart the sandbox every time and not knowing 100% if your script will work ahead of time. TypeScript helps with that but a full testing suite would help a lot. That is a piece of beauty. Well done sir! edit: Just realised. The link i provided was out of date. I have actually worked off in my own private repo for a while now. &nbsp; <a href="https://github.com/finite8/VirtualBard" rel="nofollow">https://github.com/finite8/VirtualBard</a> I have expanded on my typedef file (yours is still bigger i think tho. might merge that:) ) but i too have tried to put together a very basic mocking framework for unit testing. Not perfect, but emulates some of the functionality:&nbsp; <a href="https://github.com/finite8/VirtualBard/blob/master" rel="nofollow">https://github.com/finite8/VirtualBard/blob/master</a>...