01-08-2020 11:27
01-08-2020 11:27
Hello world.
New here. Just started developing a game for fitbit. First I used fitbit studio and made a working prototype in js. But then I read typescript was supported. New on ts and wanted to get used to it for my job. Had trouble getting even console to work.
But then I found this: https://community.fitbit.com/t5/SDK-Development/TypeScript-support/td-p/2990908
And set up the project locally with node and VSStudio. Got the console to work with writing outputs. Still I get css warnings for new fitbit stuff like text-length/x/y (unkown property).
But even worse, how to use style on an element?
this.hud = document.getElementById("hud")!
this.hud.style.visibility = "hidden";
Best Answer01-09-2020 11:06 - edited 01-09-2020 11:06
01-09-2020 11:06 - edited 01-09-2020 11:06
No answer and just found out about the tiny js memory.
Ok I guess ts is not worth it with only 64k memory. Going back to js and try to simplify things.
Best Answer01-10-2020 02:30
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
01-10-2020 02:30
You can checkout the #typescript channel on Discord, our resident expert Sergius can probably give some advice. I know there's some specific optimizations which can help reduce memory overhead.
Best Answer03-06-2020 11:19
03-06-2020 11:19
That's because `getElementById` returns just `Element`s that may or may not be `GraphicElement`, the ones that habe the `.style` property.
See an example of what you have to do: https://github.com/SergioMorchon/fitbit-sdk-types/blob/master/test-code-samples/app/user-interface/m...
`document.getElementById('demo') as GraphicsElement `