This one is just better: fitbit-sdk-types
- Install package
npm install fitbit-sdk-typed --save-dev
- Configure your tsconfig.json
"compilerOptions": {
...
"types": null, /* Or add 'fitbit-sdk-typed' to the array */
"typeRoots": [
"node_modules/@types",
"node_modules/fitbit-sdk-typed"
],
...
- Happy coding!
All the interfaces are created from SDK references by hand in TypeScript.
After that found some between documentation and actual runtime objects and their properties, then checked during runtime for js object properties and such.
- Keep in mind which imports are accessible to Device and which to Companion.
Although Fitbit's compiler here will quickly throw error about that.
- Be aware! Documentation is far from perfect that means this package won't be perfect either. Although for common cases you should be fine.