UNPKG

react-native-healthkit-bridge

Version:

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

30 lines (29 loc) 1.41 kB
import { QuantityTypeIdentifier, CategoryTypeIdentifier, CharacteristicTypeIdentifier, AuthorizationStatus } from '../types/healthkit.types'; type HealthKitIdentifier = QuantityTypeIdentifier | CategoryTypeIdentifier | CharacteristicTypeIdentifier; interface AuthorizationResult { success: boolean; authorizedTypes: string[]; deniedTypes: string[]; notDeterminedTypes: string[]; message: string; } export declare function useHealthKitAuthorization(): { loading: boolean; error: string | null; authorized: boolean | null; checkAuthorizationStatus: (types: HealthKitIdentifier[]) => Promise<AuthorizationStatus[]>; requestAuthorization: (types: HealthKitIdentifier[]) => Promise<AuthorizationResult>; checkTypeAvailability: (types: string[]) => Promise<Record<string, boolean>>; checkReadPermissions: (types: string[]) => Promise<Record<string, boolean>>; checkWritePermissions: (types: string[]) => Promise<Record<string, boolean>>; getDetailedAuthorizationStatus: (types: string[]) => Promise<Array<{ identifier: string; status: string; canRead: boolean; canWrite: boolean; isAvailable: boolean; }>>; requestReadOnlyAuthorization: (types: HealthKitIdentifier[]) => Promise<AuthorizationResult>; requestWriteOnlyAuthorization: (types: HealthKitIdentifier[]) => Promise<AuthorizationResult>; }; export {};