fitbit-sdk-types
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "fitbit-sdk-types", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Types for Fitbit SDK.", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "tsc -p test" | ||
"test": "tsc -p test", | ||
"prettier": "prettier **/*.ts **/*.tsx **/*.json **/*.md", | ||
"tslint": "tslint src/**/*.ts", | ||
"check-code": "npm run tslint && npm run prettier -- -l", | ||
"fix-code": "npm run tslint -- --fix && npm run prettier -- --write" | ||
}, | ||
"devDependencies": { | ||
"prettier": "^1.14.3", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.1.1" | ||
@@ -11,0 +17,0 @@ }, |
# Fitbit SDK Types | ||
[![npm version](https://badge.fury.io/js/fitbit-sdk-types.svg)](https://badge.fury.io/js/fitbit-sdk-types) | ||
[![Build Status](https://travis-ci.org/SergioMorchon/scroll-based-carousel.svg?branch=master)](https://travis-ci.org/SergioMorchon/scroll-based-carousel) | ||
Add types to your Fitbit project to use safely the SDK, work safely with TypeScript preventing you of doing stupid mistakes. | ||
@@ -13,7 +16,3 @@ | ||
"extends": "./node_modules/@fitbit/sdk/sdk-tsconfig.json", | ||
"include": [ | ||
"node_modules/fitbit-sdk-types/src", | ||
"./**/*.ts", | ||
"./**/*.tsx" | ||
] | ||
"include": ["node_modules/fitbit-sdk-types/src", "./**/*.ts", "./**/*.tsx"] | ||
} | ||
@@ -38,8 +37,8 @@ ``` | ||
* **Avoid using `any` in callbacks of defined functions**: | ||
TypeScript will give it the correct type, but only if you let it be. If you cast them as any other type, you could be hiding errors (either in your code or in this type definition, or even in the official documentation). | ||
- **Avoid using `any` in callbacks of defined functions**: | ||
TypeScript will give it the correct type, but only if you let it be. If you cast them as any other type, you could be hiding errors (either in your code or in this type definition, or even in the official documentation). | ||
* **Be careful about what you import**: | ||
Currently, there is only **one** Fitbit build process for **up to 3** different targets -to know: `app`, `companion` and `settings`-. | ||
So because of this, I didn't found a way of having one single `tsconfig.json` called from the *fitbit-cli* and different typings per target. So you will have to declare them all together, knowing that -for example- although there is an ambien module for `accelerometer`, it won't exist inside the `companion` target. | ||
- **Be careful about what you import**: | ||
Currently, there is only **one** Fitbit build process for **up to 3** different targets -to know: `app`, `companion` and `settings`-. | ||
So because of this, I didn't found a way of having one single `tsconfig.json` called from the _fitbit-cli_ and different typings per target. So you will have to declare them all together, knowing that -for example- although there is an ambien module for `accelerometer`, it won't exist inside the `companion` target. | ||
@@ -46,0 +45,0 @@ ## Contributing |
@@ -6,4 +6,4 @@ declare module 'appbit' { | ||
readonly buildId: string; | ||
readonly permissions: Permissions; | ||
onunload(this: Appbit, event: Event): void; | ||
readonly permissions: Permissions; | ||
exit(): void; | ||
@@ -10,0 +10,0 @@ } |
@@ -6,3 +6,6 @@ declare module 'clock' { | ||
} | ||
interface Clock { | ||
interface Clock | ||
extends EventTarget<{ | ||
tick: TickEvent; | ||
}> { | ||
granularity: Granularity; | ||
@@ -9,0 +12,0 @@ ontick: (event: TickEvent) => void; |
@@ -27,3 +27,2 @@ declare module 'companion' { | ||
onunload: (event: Event) => void; | ||
yield(): void; | ||
monitorSignificantLocationChanges: boolean; | ||
@@ -35,4 +34,5 @@ onsignificantlocationchange: ( | ||
wakeInterval: number | undefined; | ||
yield(): void; | ||
} | ||
export const me: Companion; | ||
} |
@@ -34,5 +34,5 @@ type ElementState = | ||
value: number | [number, number]; | ||
enabled: boolean; | ||
animate(trigger: string): void; | ||
sendEvent(event: Event): void; | ||
enabled: boolean; | ||
} | ||
@@ -39,0 +39,0 @@ interface ScrollIndicatorElement extends ContainerElement { |
@@ -52,3 +52,10 @@ declare module 'fs' { | ||
): FileDescriptor; | ||
export function listDirSync(path: string): Iterator<string>; | ||
interface DirectoryIteratorResult { | ||
readonly done: boolean; | ||
readonly value: string | undefined; | ||
} | ||
interface DirectoryIterator { | ||
next(): DirectoryIteratorResult; | ||
} | ||
export function listDirSync(path: string): DirectoryIterator; | ||
} |
@@ -11,2 +11,2 @@ type PermissionName = | ||
granted(permissionName: PermissionName): boolean; | ||
} | ||
} |
@@ -14,6 +14,6 @@ type BatchedReading<Reading> = { [P in keyof Reading]: Array<Reading[P]> }; | ||
onreading: (event: Event) => void; | ||
readonly readings: BatchedReading<BatchReading>; | ||
readonly activated: boolean; | ||
start(): void; | ||
stop(): void; | ||
readonly activated: boolean; | ||
readonly readings: BatchedReading<BatchReading>; | ||
} | ||
@@ -20,0 +20,0 @@ |
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
34251
45
1207
3
46