import { NativeEventEmitter } from 'react-native'; import type { HealthConfig, HealthProvider } from './health_config'; import type { AskConfig } from './ask_config'; import type { Subscription } from '@tryvital/vital-core-react-native'; export * from './health_config'; export declare const VitalHealthReactNativeModule: any; export declare const VitalHealthEvents: { statusEvent: string; }; export interface SyncNotificationContent { notificationTitle: string; notificationContent: string; channelName: string; channelDescription: string; } export type ConnectionStatus = 'autoConnect' | 'connected' | 'disconnected' | 'connectionPaused'; export interface SyncStatus { status: 'failedSyncing' | 'nothingToSync' | 'syncing' | 'successSyncing' | 'syncingCompleted' | 'completed' | 'unknown'; resource?: string; extra?: string; } export declare class VitalHealth { static status: NativeEventEmitter; private static eventEmitter; static setEventEmitter(emitter: NativeEventEmitter): void; static get canEnableBackgroundSyncNoninteractively(): boolean; static getConnectionStatus(provider?: HealthProvider): Promise; /** * @deprecated Use `getConnectionStatus()` instead. */ static get connectionStatus(): Promise; static observeConnectionStatusChange(listener: (status: ConnectionStatus) => void, provider?: HealthProvider): Subscription; static observeSyncStatusChange(listener: (status: SyncStatus) => void, provider?: HealthProvider): Subscription; /** * Whether health data sync is paused at the moment. * * To pause or unpause synchronization client-side, use `setPauseSynchronization`. * * Note that this has no effect on the Junction API side. This is intended as a temporary pause switch. * Consider using [Explicit Connect mode](https://docs.junction.com/wearables/sdks/health/connection-policies#explicit-connect-mode) * if you need the Junction API to track and persist disconnections. */ static isProviderSynchronizationPaused(provider?: HealthProvider): Promise; /** * @deprecated Use `isProviderSynchronizationPaused()` instead. */ static get pauseSynchronization(): Promise; /** * IMPORTANT: This is Android-only API. * * On iOS, this property always returns `true`. iOS HealthKit Background Delivery is * an app-level entitlement, and does not require explicit user consent. * * ## Overview * * Whether Background Sync on Android is enabled at the moment. */ static isBackgroundSyncEnabledForProvider(provider?: HealthProvider): Promise; /** * @deprecated Use `isBackgroundSyncEnabledForProvider()` instead. */ static get isBackgroundSyncEnabled(): Promise; /** * IMPORTANT: This is Android-only API. * * Returns the target frequency of Health Connect Background Sync. * * On iOS, this property always returns `3_600_000`. */ static getBackgroundSyncMinimumInterval(provider?: HealthProvider): Promise; /** * @deprecated Use `getBackgroundSyncMinimumInterval()` instead. */ static get backgroundSyncMinimumInterval(): Promise; /** * IMPORTANT: This is Android-only API. * * Returns the minimum time that must have elapsed before a any automatic Health Connect * data sync attempt is permitted. * * Automatic sync attempts include recurring Background Sync, as well as Sync on App Launch/Resumption. * * On iOS, this property always returns `0`. */ static getAutoSyncThrottle(provider?: HealthProvider): Promise; /** * @deprecated Use `getAutoSyncThrottle()` instead. */ static get autoSyncThrottle(): Promise; static isAvailable(provider?: HealthProvider): Promise; static configure(healthConfig: HealthConfig, provider?: HealthProvider): Promise; /** * Setup a HealthKit (iOS) or Health Connect (Android) connection with this device. * * @precondition You must configure the Health SDK to use the `explicit` Connection Policy. */ static connect(provider?: HealthProvider): Promise; /** * Disconnect the active HealthKit (iOS) or Health Connect (Android) connection with this device. * * @precondition You must configure the Health SDK to use the `explicit` Connection Policy. */ static disconnect(provider?: HealthProvider): Promise; /** * IMPORTANT: This is Android-only API. * * On iOS, this method is a no-op returning `true`. iOS HealthKit Background Delivery is an app-level * entitlement, and does not require explicit user consent. * * If you intend to pause or unpause synchronization, use `pauseSynchronization` * and `setPauseSynchronization(_:)` instead. * * ## Overview * * Enable background sync on Android. This includes requesting permissions from the end user whenever necessary. * * Vital SDK achieves automatic data sync through Android [AlarmManager] exact alarms. * * Refer to the [Vital Health Connect guide for full context and setup instructions](https://docs.tryvital.io/wearables/guides/android_health_connect). * * ## Gist on Exact Alarms * * "Exact Alarm" here refers to the Android Exact Alarm mechanism. The Vital SDK would propose * to the Android OS to fire the next data sync with a T+60min wall clock target. The Android OS * may fulfill the request exactly as proposed, e.g., when the user happens to be actively using * the device. However, it may also choose to defer it arbitrarily, under the influence of * power-saving policies like [Doze mode](https://developer.android.com/training/monitoring-device-state/doze-standby#understand_doze). * * On Android 12 (API Level 31) or above, this contract would automatically initiate the OS-required * user consent flow for Exact Alarm usage. If the permission has been granted prior, this activity * contract shall return synchronously. * * On Android 13 (API Level 33) or above, you have the option to use (with platform policy caveats) * the [android.Manifest.permission.USE_EXACT_ALARM] permission instead, which does not require an * explicit consent flow. This contract would return synchronously in this scenario. * * Regardless of API Level, your App Manifest must declare [android.Manifest.permission.RECEIVE_BOOT_COMPLETED]. * Otherwise, background sync stops once the phone encounters a cold reboot or a quick restart. * * @return `true` if the background sync has been enabled successfully. `false` otherwise. */ static enableBackgroundSync(provider?: HealthProvider): Promise; /** * IMPORTANT: This is Android-only API. * * On iOS, this method is a no-op. iOS HealthKit Background Delivery is an app-level * entitlement, and does not require explicit user consent. * * If you intend to pause or unpause synchronization, use `pauseSynchronization` * and `setPauseSynchronization(_:)` instead. * * ## Overview * * Disable background sync on Android. */ static disableBackgroundSync(provider?: HealthProvider): Promise; /** * IMPORTANT: This is Android-only API. * * On iOS, this method is a no-op. iOS does not require apps to show a user-visible * notification when performing extended work in background. * * ## Overview * Set the text content related to the Sync Notification. The OS has full discretion to present * this notification to the user, when any data sync work in background is taking longer than expected. * * Refer to the [Vital Health Connect guide for full context and setup instructions](https://docs.tryvital.io/wearables/guides/android_health_connect). */ static setSyncNotificationContent(content: SyncNotificationContent, provider?: HealthProvider): Promise; /** * IMPORTANT: This is Android-only API. * * On iOS, this method is a no-op. * * Set the minimum time that must have elapsed before a any automatic Health Connect * data sync attempt is permitted. * * A throttling threshold below 5 seconds is ignored. */ static setAutoSyncThrottle(thresholdInMilliseconds: number, provider?: HealthProvider): Promise; /** * IMPORTANT: This is Android-only API. * * On iOS, this method is a no-op. * * Set the target frequency of Health Connect Background Sync. * * A minimum interval below 3600 seconds is ignored. */ static setBackgroundSyncMinimumInterval(intervalInMilliseconds: number, provider?: HealthProvider): Promise; /** * Pause or unpause health data sync. * * Note that this has no effect on the Junction API side. This is intended as a temporary client-side pause switch. * Consider using [Explicit Connect mode](https://docs.junction.com/wearables/sdks/health/connection-policies#explicit-connect-mode) * if you need the Junction API to track and persist disconnections. */ static setPauseSynchronization(paused: boolean, provider?: HealthProvider): Promise; static askForResources(resources: VitalResource[], provider?: HealthProvider): Promise; static ask(readResources: VitalResource[], writeResources: VitalWriteResource[], config?: AskConfig | undefined, provider?: HealthProvider): Promise; static writeHealthData(resource: VitalWriteResource, value: number, startDate: Date, endDate: Date, provider?: HealthProvider): Promise; static hasAskedForPermission(resource: VitalResource, provider?: HealthProvider): Promise; static syncData(resources?: VitalResource[], provider?: HealthProvider): Promise; static openPlatformHealthApp(provider?: HealthProvider): Promise; /** * On iOS, this opens the Junction SDK in-built Sync Progress UI as a modal over your top view controller. * On Android, this is a no-op. */ static openSyncProgressView(provider?: HealthProvider): Promise; /** * On iOS, this reports whether Junction SDK Persistent Logging is currently enabled. To enable or disable persistent * logging, use [setPersistentLoggingEnabled]. * * On Android, this always reports `false` since the feature is unavailable. */ static isPersistentLoggingEnabled(provider?: HealthProvider): Promise; /** * On iOS, this enables or disables the Junction SDK Persistent Logging feature. The preference is persistent across application launches * until you change it again. * * On Android, this is a no-op. */ static setPersistentLoggingEnabled(enabled: boolean, provider?: HealthProvider): Promise; /** * On iOS, this packs the current Persistent Logging stash into an archive file, and opens the iOS Share Sheet. * * On Android, this is a no-op. */ static sharePersistentLogArchive(provider?: HealthProvider): Promise; } export declare enum VitalResource { Profile = "profile", Body = "body", Workout = "workout", Activity = "activity", Sleep = "sleep", Glucose = "glucose", BloodPressure = "bloodPressure", HeartRate = "heartRate", HeartRateVariability = "heartRateVariability", BloodOxygen = "bloodOxygen", Steps = "steps", ActiveEnergyBurned = "activeEnergyBurned", BasalEnergyBurned = "basalEnergyBurned", /** * @deprecated renamed to `Distance`. */ DistanceWalkingRunning = "distance", Distance = "distance", FloorsClimbed = "floorsClimbed", VO2Max = "vo2Max", Water = "water", Caffeine = "caffeine", MindfulSession = "mindfulSession", Temperature = "temperature", RespiratoryRate = "respiratoryRate", MenstrualCycle = "menstrualCycle", Meal = "meal", /** iOS Only */ AFibBurden = "afibBurden", /** iOS Only */ HeartRateAlert = "heartRateAlert", /** iOS Only */ Electrocardiogram = "electrocardiogram", /** iOS Only */ WheelchairPush = "wheelchairPush", /** iOS Only */ LeanBodyMass = "leanBodyMass", /** iOS Only */ WaistCircumference = "waistCircumference", /** iOS Only */ BodyMassIndex = "bodyMassIndex", /** iOS Only */ StandHour = "standHour", /** iOS Only */ StandDuration = "standDuration", /** iOS Only */ SleepApneaAlert = "sleepApneaAlert", /** iOS Only */ SleepBreathingDisturbance = "sleepBreathingDisturbance", /** iOS Only */ ForcedExpiratoryVolume1 = "forcedExpiratoryVolume1", /** iOS Only */ ForcedVitalCapacity = "forcedVitalCapacity", /** iOS Only */ PeakExpiratoryFlowRate = "peakExpiratoryFlowRate", /** iOS Only */ InhalerUsage = "inhalerUsage", /** iOS Only */ Fall = "fall", /** iOS Only */ UvExposure = "uvExposure", /** iOS Only */ DaylightExposure = "daylightExposure", /** iOS Only */ Handwashing = "handwashing", /** iOS Only */ BasalBodyTemperature = "basalBodyTemperature", /** iOS Only */ HeartRateRecoveryOneMinute = "heartRateRecoveryOneMinute" } export declare enum VitalWriteResource { Water = "water", /** iOS Only */ Caffeine = "caffeine", /** iOS Only */ MindfulSession = "mindfulSession" } export type PermissionOutcome = 'success' | 'cancelled' | 'unknownError' | 'notPrompted' | 'healthDataUnavailable'; //# sourceMappingURL=index.d.ts.map