@kingstinct/react-native-healthkit
Version:
React Native bindings for HealthKit
45 lines (36 loc) • 1.38 kB
text/typescript
import type { CategorySampleTyped } from './CategoryType'
import type { CategoryTypeIdentifier } from './CategoryTypeIdentifier'
import type { QuantitySample } from './QuantitySample'
import type { QuantityTypeIdentifier } from './QuantityTypeIdentifier'
import type { SampleTypeIdentifier } from './Shared'
export interface EmitterSubscription {
remove: () => void
}
export interface OnChangeCallbackArgs {
readonly typeIdentifier: SampleTypeIdentifier
readonly errorMessage?: string
}
export interface OnQuantitySamplesCallbackError {
readonly typeIdentifier: QuantityTypeIdentifier
readonly errorMessage: string
}
export interface OnQuantitySamplesCallbackSuccess {
readonly typeIdentifier: QuantityTypeIdentifier
readonly samples: readonly QuantitySample[]
}
export type OnQuantitySamplesCallback =
| OnQuantitySamplesCallbackError
| OnQuantitySamplesCallbackSuccess
export interface OnCategorySamplesCallbackError {
readonly typeIdentifier: CategoryTypeIdentifier
readonly errorMessage: string
}
export interface OnCategorySamplesCallbackSuccess<
T extends CategoryTypeIdentifier,
> {
readonly typeIdentifier: CategoryTypeIdentifier
readonly samples: readonly CategorySampleTyped<T>[]
}
export type OnCategorySamplesCallback<T extends CategoryTypeIdentifier> =
| OnCategorySamplesCallbackError
| OnCategorySamplesCallbackSuccess<T>