UNPKG

react-native-healthkit-bridge

Version:

A comprehensive React Native bridge for Apple HealthKit with TypeScript support, advanced authorization, and flexible data queries

28 lines (27 loc) 1.72 kB
import type { TurboModule } from 'react-native'; export interface Spec extends TurboModule { isHealthKitAvailable(callback: (error: string | null, result: boolean | null) => void): void; checkAvailability(): Promise<boolean>; requestAuthorization(): Promise<boolean>; requestSelectiveAuthorization(readTypes: string[], writeTypes: string[]): Promise<boolean>; getAuthorizationStatus(identifiers: string[]): Promise<Array<{ identifier: string; status: string; }>>; getQuantitySamplesForDays(identifier: string, unit: string, days: number): Promise<any[]>; getQuantitySamplesForRange(identifier: string, unit: string, startDate: string, endDate: string): Promise<any[]>; getLatestQuantitySample(identifier: string, unit: string): Promise<any>; getCategorySamplesForDays(identifier: string, days: number): Promise<any[]>; getStatisticsForType(identifier: string, unit: string, startDate: string, endDate: string, options: string[]): Promise<any>; getWorkouts(startDate: string, endDate: string): Promise<any[]>; saveQuantitySample(identifier: string, value: number, unit: string, startDate: string, endDate: string, metadata?: any): Promise<boolean>; saveCategorySample(identifier: string, value: number, startDate: string, endDate: string, metadata?: any): Promise<boolean>; startBackgroundObserver(identifier: string): Promise<string>; stopBackgroundObserver(identifier: string): Promise<string>; getAvailableTypes(): Promise<any[]>; getSupportedUnits(identifier: string): Promise<string[]>; addListener(eventName: string): void; removeListeners(count: number): void; } declare const _default: Spec; export default _default;