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 Answer
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.
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 AnswerThat'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 `