fitbit-sdk-types
Advanced tools
Comparing version 0.1.1 to 0.2.0
{ | ||
"name": "fitbit-sdk-types", | ||
"version": "0.1.1", | ||
"description": "Work in progress. Types for Fitbit SDK.", | ||
"scripts": { | ||
"test-device": "tsc -p test/device", | ||
"test-companion": "tsc -p test/companion", | ||
"test": "npm run test-device && npm run test-companion" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^3.1.1" | ||
}, | ||
"author": "Sergio Morchón Poveda", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SergioMorchon/fitbit-sdk-types" | ||
}, | ||
"license": "ISC" | ||
"name": "fitbit-sdk-types", | ||
"version": "0.2.0", | ||
"description": "Work in progress. Types for Fitbit SDK.", | ||
"scripts": { | ||
"test-device": "tsc -p test/device", | ||
"test-companion": "tsc -p test/companion", | ||
"test-settings": "tsc -p test/settings", | ||
"test": "npm run test-device && npm run test-companion && npm run test-settings" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^3.1.1" | ||
}, | ||
"author": "Sergio Morchón Poveda", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SergioMorchon/fitbit-sdk-types" | ||
}, | ||
"license": "ISC", | ||
"dependencies": { | ||
"@types/react": "^16.4.16" | ||
} | ||
} |
# Fitbit SDK Types | ||
Add types to your Fitbit project to use safely the SDK. | ||
Add types to your Fitbit project to use safely the SDK, work safely with TypeScript preventing you of doing stupid mistakes. | ||
_This is a work in progress project to add static typing for the FITBIT SDK modules._ | ||
## How to use in your app project | ||
1. Add this project as to your `devDependencies`with `npm install --save-dev fitbit-sdk-types`. | ||
2. Add a reference to your target folder's `tsconfig.json` file: | ||
**app/tsconfig.json** | ||
2. Add a reference in your target folder's `tsconfig.json` file: | ||
**app/tsconfig.json** | ||
```json | ||
{ | ||
"extends": "../tsconfig.json", | ||
"include": [ | ||
"./", | ||
"../node_modules/fitbit-sdk-types/device" | ||
] | ||
"compilerOptions": { | ||
"checkJs": true | ||
}, | ||
"include": ["./", "../node_modules/fitbit-sdk-types/device"] | ||
} | ||
``` | ||
3. And use it: | ||
**app/index.ts** | ||
**app/index.js** | ||
```typescript | ||
import { Accelerometer } from "accelerometer"; | ||
import { Accelerometer } from 'accelerometer'; | ||
@@ -38,6 +39,1 @@ const acc = new Accelerometer(); | ||
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`). |
declare module 'cbor' { | ||
export function encode(data: any): ArrayBuffer; | ||
export function decode(data: ArrayBuffer | ArrayBufferView): any; | ||
export class Float { | ||
value: number; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33370
51
1184
1
39
+ Added@types/react@^16.4.16
+ Added@types/prop-types@15.7.14(transitive)
+ Added@types/react@16.14.62(transitive)
+ Added@types/scheduler@0.16.8(transitive)
+ Addedcsstype@3.1.3(transitive)