UNPKG

@kingstinct/react-native-healthkit

Version:
60 lines (59 loc) 2.11 kB
import type { HybridObject } from 'react-native-nitro-modules'; import type { BaseSample, DeletedSample } from '../types'; import type { QueryOptionsWithAnchor, QueryOptionsWithSortOrder } from '../types/QueryOptions'; declare enum MedicationDoseEventScheduleType { asNeeded = 1, schedule = 2 } declare enum MedicationDoseEventLogStatus { notInteracted = 1, notificationNotSent = 2, snoozed = 3, taken = 4, skipped = 5, notLogged = 6 } interface RelatedCoding { system: string; code: string; version?: string; } type GeneralForm = 'capsule' | 'cream' | 'device' | 'drops' | 'foam' | 'gel' | 'inhaler' | 'injection' | 'liquid' | 'lotion' | 'ointment' | 'patch' | 'powder' | 'spray' | 'suppository' | 'tablet' | 'topical' | 'unknown'; interface MedicationConcept { identifier: string; displayText: string; generalForm: GeneralForm; relatedCodings: RelatedCoding[]; } export interface UserAnnotatedMedication { isArchived: boolean; hasSchedule: boolean; nickname?: string; medication: MedicationConcept; } export interface MedicationDoseEvent extends BaseSample { scheduleType: MedicationDoseEventScheduleType; medicationConceptIdentifier: string; scheduledDate?: Date; scheduledDoseQuantity?: number; doseQuantity?: number; logStatus: MedicationDoseEventLogStatus; unit: string; } export interface MedicationDoseEventsWithAnchorResponse { readonly samples: readonly MedicationDoseEvent[]; readonly deletedSamples: readonly DeletedSample[]; readonly newAnchor: string; } export interface MedicationModule extends HybridObject<{ ios: 'swift'; }> { queryMedications(): Promise<readonly UserAnnotatedMedication[]>; /** * @deprecated Use requestPerObjectReadAuthorization instead. */ requestMedicationsAuthorization(): Promise<boolean>; queryMedicationEvents(options: QueryOptionsWithSortOrder): Promise<readonly MedicationDoseEvent[]>; queryMedicationEventsWithAnchor(options: QueryOptionsWithAnchor): Promise<MedicationDoseEventsWithAnchorResponse>; } export {};