fitbit-sdk-types
Advanced tools
Comparing version 3.2.7 to 3.2.8
{ | ||
"name": "fitbit-sdk-types", | ||
"version": "3.2.7", | ||
"version": "3.2.8", | ||
"author": "Sergio Morchón Poveda <sergio.morchon@outlook.com>", | ||
@@ -5,0 +5,0 @@ "description": "Types for Fitbit SDK.", |
declare module 'accelerometer' { | ||
interface AccelerometerReading { | ||
readonly timestamp: number | null; | ||
interface AccelerometerReading extends SensorReading { | ||
readonly x: number | null; | ||
@@ -5,0 +4,0 @@ readonly y: number | null; |
@@ -9,2 +9,3 @@ declare module 'appbit' { | ||
readonly buildId: string; | ||
readonly launchArguments: any; | ||
readonly permissions: Permissions; | ||
@@ -11,0 +12,0 @@ onunload: (event: Event) => void; |
declare module 'barometer' { | ||
interface BarometerReading { | ||
interface BarometerReading extends SensorReading { | ||
readonly pressure: number | null; | ||
readonly timestamp: number | null; | ||
} | ||
@@ -6,0 +5,0 @@ interface Barometer extends Sensor<BarometerReading>, BarometerReading {} |
declare module 'body-presence' { | ||
interface BodyPresenceReading { | ||
interface BodyPresenceReading extends SensorReading { | ||
readonly present: boolean; | ||
@@ -4,0 +4,0 @@ } |
declare module 'document' { | ||
type EventHandler = (event: Event) => boolean; | ||
interface DocumentModule extends GlobalEvents { | ||
readonly default: DocumentModule; | ||
readonly root: Element; | ||
getEventHandler(elementType: string): EventHandler | null; | ||
@@ -7,0 +5,0 @@ setEventHandler(elementType: string, handler: EventHandler): void; |
@@ -18,3 +18,3 @@ interface ListScrollEvent extends Event { | ||
interface KeyboardEvent extends Event { | ||
readonly key: string; | ||
readonly key: 'back' | 'top' | 'down'; | ||
} | ||
@@ -21,0 +21,0 @@ interface MouseEvent extends Event { |
declare module 'gyroscope' { | ||
interface GyroscopeReading { | ||
readonly timestamp: number | null; | ||
interface GyroscopeReading extends SensorReading { | ||
readonly x: number | null; | ||
@@ -5,0 +4,0 @@ readonly y: number | null; |
declare module 'haptics' { | ||
type VibrationPatternName = | ||
| 'alert' | ||
| 'bump' | ||
| 'confirmation' | ||
| 'confirmation-max' | ||
| 'nudge' | ||
| 'nudge-max' | ||
| 'ping' | ||
| 'ring' | ||
| 'confirmation' | ||
| 'confirmation-max'; | ||
| 'ring'; | ||
interface Vibration { | ||
@@ -11,0 +12,0 @@ start(pattern: VibrationPatternName): void; |
declare module 'heart-rate' { | ||
interface HeartRateSensorReading { | ||
interface HeartRateSensorReading extends SensorReading { | ||
readonly heartRate: number | null; | ||
readonly timestamp: number | null; | ||
} | ||
@@ -6,0 +5,0 @@ interface HeartRateSensor |
declare module 'orientation' { | ||
type Quaternion = [number, number, number, number]; | ||
interface BatchReading { | ||
interface BatchReading extends SensorReading { | ||
readonly i: number; | ||
@@ -8,9 +8,8 @@ readonly j: number; | ||
readonly scalar: number; | ||
readonly timestamp: number; | ||
} | ||
interface OrientationSensor extends Sensor<BatchReading> { | ||
readonly quaternion: Quaternion; | ||
readonly timestamp: number; | ||
readonly quaternion: Quaternion | null; | ||
readonly timestamp: number | null; | ||
} | ||
class OrientationSensor extends SensorBase {} | ||
} |
@@ -18,5 +18,5 @@ declare module 'power' { | ||
onchange: (event: Event) => void; | ||
powerIsGood: boolean | undefined; | ||
readonly powerIsGood: boolean | undefined; | ||
} | ||
const charger: Charger; | ||
} |
@@ -7,3 +7,7 @@ type BatchedReading<Reading> = { | ||
interface Sensor<BatchReading extends {}, EventMap = {}> | ||
interface SensorReading { | ||
readonly timestamp: number | null; | ||
} | ||
interface Sensor<Reading extends SensorReading, EventMap = {}> | ||
extends EventTarget< | ||
@@ -19,3 +23,3 @@ EventMap & { | ||
onreading: (event: Event) => void; | ||
readonly readings: BatchedReading<BatchReading>; | ||
readonly readings: BatchedReading<Reading>; | ||
readonly activated: boolean; | ||
@@ -22,0 +26,0 @@ start(): void; |
@@ -14,8 +14,10 @@ declare module 'crypto' { | ||
//#region device | ||
type SHA_256 = 'SHA-256'; | ||
interface Algorithm { | ||
name: 'SHA-256'; | ||
name: SHA_256; | ||
[key: string]: any; | ||
} | ||
interface SubtleCrypto { | ||
digest( | ||
algorithm: string | Algorithm, | ||
algorithm: SHA_256 | Algorithm, | ||
data: ArrayBuffer | ArrayBufferView, | ||
@@ -22,0 +24,0 @@ ): Promise<string>; |
declare module 'device' { | ||
type IonicColors = undefined; | ||
type VersaColors = 'black' | 'rose-gold' | 'silver' | 'graphite'; | ||
interface Device { | ||
readonly bodyColor: IonicColors | VersaColors; | ||
readonly firmwareVersion: string; | ||
readonly lastSyncTime: Date; | ||
readonly modelId: string; | ||
readonly modelName: string; | ||
readonly modelName: 'Ionic' | 'Versa'; | ||
readonly screen: { | ||
@@ -8,0 +11,0 @@ readonly width: number; |
@@ -0,1 +1,15 @@ | ||
interface Coordinates { | ||
readonly accuracy: number; | ||
readonly altitude: number | null; | ||
readonly altitudeAccuracy: number | null; | ||
readonly heading: number | null; | ||
readonly latitude: number; | ||
readonly longitude: number; | ||
readonly speed: number | null; | ||
} | ||
interface Position { | ||
readonly coords: Coordinates; | ||
readonly timestamp: number; | ||
} | ||
declare module 'geolocation' { | ||
@@ -23,17 +37,10 @@ type WatchId = number; | ||
} | ||
type PositionErrorCode = | ||
| 'PERMISSION_DENIED' | ||
| 'POSITION_UNAVAILABLE' | ||
| 'TIMEOUT'; | ||
const PositionErrorCode: { | ||
readonly PERMISSION_DENIED: 'PERMISSION_DENIED'; | ||
readonly POSITION_UNAVAILABLE: 'POSITION_UNAVAILABLE'; | ||
readonly TIMEOUT: 'TIMEOUT'; | ||
readonly code: PositionErrorCode; | ||
}; | ||
interface PositionError { | ||
readonly PERMISSION_DENIED: typeof PositionErrorCode.PERMISSION_DENIED; | ||
readonly POSITION_UNAVAILABLE: typeof PositionErrorCode.POSITION_UNAVAILABLE; | ||
readonly TIMEOUT: typeof PositionErrorCode.TIMEOUT; | ||
readonly code: PositionErrorCode; | ||
readonly PERMISSION_DENIED: any; | ||
readonly POSITION_UNAVAILABLE: any; | ||
readonly TIMEOUT: any; | ||
readonly code: | ||
| PositionError['PERMISSION_DENIED'] | ||
| PositionError['POSITION_UNAVAILABLE'] | ||
| PositionError['TIMEOUT']; | ||
readonly message: string; | ||
@@ -40,0 +47,0 @@ } |
@@ -11,15 +11,2 @@ declare function clearInterval(handle: number): void; | ||
): number; | ||
interface Coordinates { | ||
readonly accuracy: number; | ||
readonly altitude: number | null; | ||
readonly altitudeAccuracy: number | null; | ||
readonly heading: number | null; | ||
readonly latitude: number | null; | ||
readonly longitude: number | null; | ||
readonly speed: number | null; | ||
} | ||
interface Position { | ||
readonly coords: Coordinates; | ||
readonly timestamp: number; | ||
} | ||
//#region device | ||
@@ -26,0 +13,0 @@ declare function cancelAnimationFrame(handle: number): void; |
@@ -11,2 +11,7 @@ declare module 'jpeg' { | ||
): void; | ||
function decode( | ||
filename: string, | ||
outputFilename: string, | ||
options?: JpegDecodeOptions, | ||
): void; | ||
} |
declare module 'messaging' { | ||
type CloseCode = 'CONNECTION_LOST' | 'PEER_INITIATED' | 'SOCKET_ERROR'; | ||
class CloseEvent extends Event { | ||
readonly CONNECTION_LOST: 'CONNECTION_LOST'; | ||
readonly PEER_INITIATED: 'PEER_INITIATED'; | ||
readonly SOCKET_ERROR: 'SOCKET_ERROR'; | ||
readonly code: CloseCode; | ||
readonly CONNECTION_LOST: any; | ||
readonly PEER_INITIATED: any; | ||
readonly SOCKET_ERROR: any; | ||
readonly code: | ||
| CloseEvent['CONNECTION_LOST'] | ||
| CloseEvent['PEER_INITIATED'] | ||
| CloseEvent['SOCKET_ERROR']; | ||
readonly wasClean: boolean; | ||
} | ||
type ErrorCode = 'BUFFER_FULL'; | ||
class ErrorEvent extends Error { | ||
readonly BUFFER_FULL: 'BUFFER_FULL'; | ||
readonly code: ErrorCode; | ||
readonly BUFFER_FULL: any; | ||
readonly code: ErrorEvent['BUFFER_FULL']; | ||
} | ||
@@ -18,3 +19,2 @@ class MessageEvent extends Event { | ||
} | ||
type ReadyState = number; | ||
interface MessageSocket | ||
@@ -29,4 +29,4 @@ extends EventTarget<{ | ||
class MessageSocket { | ||
readonly CLOSED: ReadyState; | ||
readonly OPEN: ReadyState; | ||
readonly CLOSED: any; | ||
readonly OPEN: any; | ||
readonly MAX_MESSAGE_SIZE: number; | ||
@@ -39,3 +39,3 @@ readonly bufferedAmount: number; | ||
onopen: (event: Event) => void; | ||
readonly readyState: ReadyState; | ||
readonly readyState: MessageSocket['CLOSED'] | MessageSocket['OPEN']; | ||
send(data: any): void; | ||
@@ -42,0 +42,0 @@ } |
@@ -14,7 +14,2 @@ declare module 'user-settings' { | ||
const exercise: ExerciseSettings; | ||
interface DeviceSettings { | ||
readonly airplaneModeEnabled: boolean; | ||
readonly vibrationEnabled: boolean; | ||
} | ||
const device: DeviceSettings; | ||
const locale: LocaleSettings; | ||
@@ -21,0 +16,0 @@ interface UnitsSettings { |
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
47610
1517