react-native-healthkit-bridge
Version:
A comprehensive React Native bridge for Apple HealthKit with TypeScript support, advanced authorization, and flexible data queries
33 lines (32 loc) • 923 B
TypeScript
export interface CachedData<T = any> {
data: T;
timestamp: number;
ttl: number;
key: string;
}
export interface CacheStats {
hits: number;
misses: number;
size: number;
keys: string[];
hitRate: number;
}
export declare class HealthKitCache {
private static instance;
private cache;
private stats;
private constructor();
static getInstance(): HealthKitCache;
set<T>(key: string, data: T, ttl?: number): void;
get<T>(key: string): T | null;
has(key: string): boolean;
delete(key: string): boolean;
clear(): void;
invalidatePattern(pattern: string): void;
getStats(): CacheStats;
private evictOldest;
private startCleanupInterval;
static createKey(operation: string, ...params: any[]): string;
static createAuthKey(types: string[]): string;
static createQueryKey(identifier: string, unit: string, days: number): string;
}