RCTAppleHealthKit+Queries.h 5.74 KB
Newer Older
1 2 3 4 5
//
//  RCTAppleHealthKit+Queries.h
//  RCTAppleHealthKit
//
//  Created by Greg Wilson on 2016-06-26.
Martin RP's avatar
Martin RP committed
6 7
//  This source code is licensed under the MIT-style license found in the
//  LICENSE file in the root directory of this source tree.
8 9 10 11 12 13
//

#import "RCTAppleHealthKit.h"

@interface RCTAppleHealthKit (Queries)

14
- (void)fetchMostRecentQuantitySampleOfType:(HKQuantityType *)quantityType predicate:(NSPredicate *)predicate completion:(void (^)(HKQuantity *mostRecentQuantity, NSDate *startDate, NSDate *endDate, NSError *error))completion;
15
- (void)fetchSumOfSamplesTodayForType:(HKQuantityType *)quantityType unit:(HKUnit *)unit completion:(void (^)(double, NSError *))completionHandler;
16
- (void)fetchSumOfSamplesOnDayForType:(HKQuantityType *)quantityType unit:(HKUnit *)unit day:(NSDate *)day completion:(void (^)(double, NSDate *, NSDate *, NSError *))completionHandler;
17 18 19 20 21
- (void)fetchCumulativeSumStatisticsCollection:(HKQuantityType *)quantityType
                                          unit:(HKUnit *)unit
                                     startDate:(NSDate *)startDate
                                       endDate:(NSDate *)endDate
                                    completion:(void (^)(NSArray *, NSError *))completionHandler;
Furyou81's avatar
Furyou81 committed
22 23 24 25 26 27 28 29 30 31 32 33


- (void)fetchSamplesOfType:(HKSampleType *)quantityType
                              unit:(HKUnit *)unit
                         predicate:(NSPredicate *)predicate
                         ascending:(BOOL)asc
                             limit:(NSUInteger)lim
                        completion:(void (^)(NSArray *, NSError *))completion;
- (void)setObserverForType:(HKSampleType *)quantityType
                      unit:(HKUnit *)unit;


34 35 36 37 38 39
- (void)fetchQuantitySamplesOfType:(HKQuantityType *)quantityType
                              unit:(HKUnit *)unit
                         predicate:(NSPredicate *)predicate
                         ascending:(BOOL)asc
                             limit:(NSUInteger)lim
                        completion:(void (^)(NSArray *, NSError *))completion;
40 41 42 43 44 45
- (void)fetchQuantityDoubleSamplesOfType:(HKQuantityType *)quantityType
                              unit:(HKUnit *)unit
                         predicate:(NSPredicate *)predicate
                         ascending:(BOOL)asc
                             limit:(NSUInteger)lim
                        completion:(void (^)(NSArray *, NSError *))completion;
46 47 48 49 50 51
- (void)fetchCorrelationSamplesOfType:(HKQuantityType *)quantityType
                                 unit:(HKUnit *)unit
                            predicate:(NSPredicate *)predicate
                            ascending:(BOOL)asc
                                limit:(NSUInteger)lim
                           completion:(void (^)(NSArray *, NSError *))completion;
52 53
- (void)fetchCumulativeSumStatisticsCollection:(HKQuantityType *)quantityType
                                          unit:(HKUnit *)unit
54
                                        period:period
55 56 57 58
                                     startDate:(NSDate *)startDate
                                       endDate:(NSDate *)endDate
                                     ascending:(BOOL)asc
                                         limit:(NSUInteger)lim
59
                                           gap:(NSString *)gap
60 61
                          includeManuallyAdded:(BOOL)includeManuallyAdded
                                    completion:(void (^)(NSArray *, NSError *))completionHandler;
62 63
- (void)fetchCumulativeSumStatisticsCollection:(HKQuantityType *)quantityType
                                          unit:(HKUnit *)unit
Furyou81's avatar
Furyou81 committed
64
                                     startDate:(NSDate *)startDate
65 66 67 68 69 70 71
                                       endDate:(NSDate *)endDate
                                     ascending:(BOOL)asc
                                         limit:(NSUInteger)lim
                                    completion:(void (^)(NSArray *, NSError *))completionHandler;
- (void)fetchCumulativeSumStatisticsCollection:(HKQuantityType *)quantityType
                                          unit:(HKUnit *)unit
                                          period:(NSUInteger)period
72 73 74 75
                                     startDate:(NSDate *)startDate
                                       endDate:(NSDate *)endDate
                                     ascending:(BOOL)asc
                                         limit:(NSUInteger)lim
76
                          includeManuallyAdded:(BOOL)includeManuallyAdded
77
                                    completion:(void (^)(NSArray *, NSError *))completionHandler;
78 79 80 81 82 83


- (void)fetchSleepCategorySamplesForPredicate:(NSPredicate *)predicate
                                   limit:(NSUInteger)lim
                                   completion:(void (^)(NSArray *, NSError *))completion;

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
- (void)fetchQuantitySamplesOfTypeByAnchor:(HKQuantityType *)quantityType
                                      unit:(HKUnit *)unit
                                 predicate:(NSPredicate *)predicate
                                 ascending:(BOOL)asc
                                     limit:(NSUInteger)lim
                                completion:(void (^)(NSDictionary *, NSError *))completion;

- (void)fetchCorrelationSamplesOfTypeByAnchor:(HKQuantityType *)quantityType
                                         unit:(HKUnit *)unit
                                    predicate:(NSPredicate *)predicate
                                    ascending:(BOOL)asc
                                        limit:(NSUInteger)lim
                                   completion:(void (^)(NSDictionary *, NSError *))completion;

- (void)fetchSleepCategorySamplesForPredicateByAnchor:(NSPredicate *)predicate
                                                limit:(NSUInteger)lim
                                           completion:(void (^)(NSDictionary *, NSError *))completion;

102
@end