UNPKG

@kingstinct/react-native-healthkit

Version:
75 lines (74 loc) 2.34 kB
import type { SourceProxy } from '../specs/SourceProxy.nitro'; import type { WorkoutProxy } from '../specs/WorkoutProxy.nitro'; export declare enum ComparisonPredicateOperator { lessThan = 0, lessThanOrEqualTo = 1, greaterThan = 2, greaterThanOrEqualTo = 3, equalTo = 4, notEqualTo = 5, matches = 6, like = 7, beginsWith = 8, endsWith = 9, IN = 10, customSelector = 11, contains = 99, between = 100 } type PredicateWithMetadataValue = string | number | Date | boolean; export interface PredicateWithMetadataKey { readonly withMetadataKey: string; readonly operatorType?: ComparisonPredicateOperator; readonly value?: PredicateWithMetadataValue; } type ComputeRaw<A> = A extends Function ? A : { [K in keyof A]: A[K]; } & {}; type AllKeys<U> = U extends any ? keyof U : never; type _Strict<U, UAll extends U = U> = U extends any ? ComputeRaw<U & { [K in Exclude<AllKeys<UAll>, keyof U>]?: never; }> : never; export type StrictUnion<U extends object> = _Strict<U>; export interface DateFilter { readonly startDate?: Date; readonly endDate?: Date; readonly strictEndDate?: boolean; readonly strictStartDate?: boolean; } export interface FilterForSamplesBase { readonly uuid?: string; readonly uuids?: string[]; readonly metadata?: PredicateWithMetadataKey; readonly date?: DateFilter; readonly workout?: WorkoutProxy; readonly sources?: SourceProxy[]; } export interface FilterForSamples extends FilterForSamplesBase { readonly OR?: FilterForSamplesBase[]; readonly NOT?: FilterForSamplesBase[]; readonly AND?: FilterForSamplesBase[]; } /** * Generic options for querying. */ export interface GenericQueryOptions { filter?: FilterForSamples; /** * Specify -1, 0 or any non-positive number for fetching all samples * */ readonly limit: number; } export interface QueryOptionsWithAnchor extends GenericQueryOptions { readonly anchor?: string; } export interface QueryOptionsWithSortOrder extends GenericQueryOptions { readonly ascending?: boolean; } export interface QueryOptionsWithSortOrderAndUnit extends QueryOptionsWithSortOrder { readonly unit?: string; } export interface QueryOptionsWithAnchorAndUnit extends QueryOptionsWithAnchor { readonly unit?: string; } export {};