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.15 kB
TypeScript
import { QuantityTypeIdentifier, CategoryTypeIdentifier, CharacteristicTypeIdentifier } from '../types/healthkit.types';
type HealthKitIdentifier = QuantityTypeIdentifier | CategoryTypeIdentifier | CharacteristicTypeIdentifier;
interface SmartAuthorizationResult {
success: boolean;
authorizedTypes: string[];
deniedTypes: string[];
notDeterminedTypes: string[];
message: string;
}
interface DataTypeAuthorizationResult {
isAuthorized: boolean;
wasRequested: boolean;
message: string;
}
export declare function useSmartAuthorization(): {
loading: boolean;
error: string | null;
requestSmartAuthorization: (requiredTypes: HealthKitIdentifier[]) => Promise<SmartAuthorizationResult>;
ensureDataTypeAuthorization: (dataType: HealthKitIdentifier) => Promise<DataTypeAuthorizationResult>;
checkMultipleAuthStatus: (types: HealthKitIdentifier[]) => Promise<{
authorized: HealthKitIdentifier[];
denied: HealthKitIdentifier[];
notDetermined: HealthKitIdentifier[];
}>;
requestOnlyUnauthorized: (types: HealthKitIdentifier[]) => Promise<SmartAuthorizationResult>;
};
export {};