Fitbit SDK Types
Add types to your Fitbit project to use safely the SDK.
This is a work in progress project to add static typing for the FITBIT SDK modules.
How to use in your app project
- Add this project as to your
devDependencies
with npm install --save-dev fitbit-sdk-types
. - Add a reference to your target folder's
tsconfig.json
file:
app/tsconfig.json
{
"extends": "../tsconfig.json",
"include": [
"./",
"../node_modules/fitbit-sdk-types/device"
]
}
- And use it:
app/index.ts
import { Accelerometer } from "accelerometer";
const acc = new Accelerometer();
console.log(acc.activated);
console.log(acc.potato);
Examples
You can see a ton of official examples working as tests right here, under the ./test
path.
Contributing
Make a PR submitting at least the desired test examples to work under the .test
path, ideally with some link to any of the Fitbit official sources to get more info.
Remainig
- All the Companion APIs.
- Some App's
document
module types (mostly WhateverElement
).