Package-level declarations

Types

Link copied to clipboard

Represents a self-assessed description (look and feel) of the cervical mucus for a user.

Link copied to clipboard
data class KHCyclingPedalingCadenceSample(val revolutionsPerMinute: Double, val time: Instant)

Represents a single measurement of KHRecord.CyclingPedalingCadence.

Link copied to clipboard

Depicts what kind of values a KHRecord refers to.

Link copied to clipboard
expect class KHealth

KHealth is a Kotlin Multiplatform wrapper around Android's Health Connect and Apple's HealthKit APIs. It provides a set of convenient properties and methods to perform most common operations easily (like checking/requesting permissions, reading/writing data, and more).

Link copied to clipboard
data class KHEither<T, U>(val left: T, val right: U)

Represents a disjoint union entity, generally used to depict objects that are supported on both Android and Apple platforms but use different return types internally.

Link copied to clipboard
data class KHHeartRateSample(val beatsPerMinute: Long, val time: Instant)

Represents a single measurement of the heart rate (KHRecord.HeartRate).

Link copied to clipboard

Refers to the pattern or characteristics of menstrual bleeding, such as light, moderate, or heavy flow, and its duration and consistency throughout the cycle.

Link copied to clipboard

An ovulation test checks for a rise in a hormone called luteinizing hormone (LH) in your urine, which happens just before ovulation.

Link copied to clipboard
data class KHPermission(val dataType: KHDataType, val read: Boolean, val write: Boolean)

Depicts an instance of the app's request to the operating system to provide it with the access to read and/or write a particular kind of data from the health store.

Link copied to clipboard

Represents the user's response to a KHPermission request. He can either grant or deny a permission request. But since Apple's HealthKit does not provide the real read status of any permission due to privacy concerns, another type of status was introduced named NotDetermined. In this case, the user will have to just try to read the data from HealthKit, if the data is returned, it means that the app was granted the permission, otherwise not.

Link copied to clipboard
data class KHPermissionWithStatus(val permission: KHPermission, val readStatus: KHPermissionStatus, val writeStatus: KHPermissionStatus)

Clubs a permission with its status. Useful for the case where the app requests statuses for a list of permissions that include a few unsupported ones on the current platform and the library removes it from the input request and output status lists for compatibility reasons. In that case, this object will come handy in detecting exactly which permissions were interacted with (i.e. granted or denied) by the user.

Link copied to clipboard
data class KHPowerSample(val unit: KHUnit.Power, val value: Double, val time: Instant)

Represents a single measurement of power. For example, using a power meter when exercising on a stationary bike.

Link copied to clipboard
sealed class KHReadRequest

Represents the kind of KHRecord the app wants to read.

Link copied to clipboard
sealed class KHRecord

Represents a readable or writable entity.

Link copied to clipboard

Captures the sleep stage the user entered during a sleep session.

Link copied to clipboard
data class KHSleepStageSample(val stage: KHSleepStage, val startTime: Instant, val endTime: Instant)

Represents a single measurement of KHRecord.SleepSession.

Link copied to clipboard
data class KHSpeedSample(val unit: KHUnit.Velocity, val value: Double, val time: Instant)

Represents a single measurement of the speed, a scalar magnitude.

Link copied to clipboard
sealed class KHUnit

The measurement scale of various types of values.

Link copied to clipboard
sealed class KHWriteResponse

Depicts the kind of response from the health store when a KHRecord is written onto it. The transaction can either Success completely, Fail completely, or Fail partially.

Link copied to clipboard
data class NoWriteAccessException(forPermission: String? = null)