These are chat archives for highfidelity/hifi

25th
Sep 2014
Jeremy
@JeroMiya
Sep 25 2014 02:08
@thoys these docs can be used by JavaScript developers of course - they're easy to read even if you don't know TypeScript, but they're the generated docs for the TypeScript declarations, and using 'I' as a prefix for interface names is the convention in TypeScript. I could have possibly declared the types of the globals directly without interfaces, but the interfaces make the types more extensible for the user. Good point though about naming them the same as types in the C++, but in this case I think it's ok, and it makes it easier to maintain the declarations when I know which C++ classes they correspond to. I'll have to think about it some - if you have a better idea for an interface naming convention let me know.
Jeremy
@JeroMiya
Sep 25 2014 02:14
@AndrewMeadows The docs are generated from the TypeScript declarations, so the way to update them is to update the corresponding TypeScript interface, which in this case is IMyAvatar (https://github.com/JeroMiya/hifi-typescript/blob/master/HiFi/hifi/Avatar.d.ts#L247). I'll make a note of those changes and update Avatar.d.ts
Jeremy
@JeroMiya
Sep 25 2014 02:24
@AndrewMeadows I'm not sure what you were asking w.r.t. exposing the globals. I'm used to using DI frameworks like AngularJS instead of using globals but I'm guessing that might be a bit of overkill for interface scripting (I'm not even sure it's possible to unit test these scripts, heh. Anyone tried?)
Jeremy
@JeroMiya
Sep 25 2014 02:49
@thoys for JavaScript developers looking at those docs, the easiest way is to start with the globals and ignore the interfaces. You should only need to look at an interface if it is the type of a function argument, field, or the return type of a function
in that case, you can just click the link to go to the page for that interface