2017-07-19 16:02:26 +01:00
|
|
|
#ifndef RNFirebaseDatabaseReference_h
|
|
|
|
#define RNFirebaseDatabaseReference_h
|
2017-08-11 16:07:32 +01:00
|
|
|
#import <Foundation/Foundation.h>
|
2017-07-19 16:02:26 +01:00
|
|
|
|
|
|
|
#if __has_include(<FirebaseDatabase/FIRDatabase.h>)
|
2017-08-12 19:07:51 +01:00
|
|
|
#import <FirebaseDatabase/FIRDatabase.h>
|
|
|
|
#import "RNFirebaseDatabase.h"
|
2017-08-11 16:07:32 +01:00
|
|
|
#import "RNFirebaseEvents.h"
|
2017-07-19 16:02:26 +01:00
|
|
|
#import <React/RCTEventEmitter.h>
|
|
|
|
#import "Firebase.h"
|
|
|
|
|
|
|
|
@interface RNFirebaseDatabaseReference : NSObject
|
|
|
|
@property RCTEventEmitter *emitter;
|
|
|
|
@property FIRDatabaseQuery *query;
|
2017-08-02 16:51:00 +01:00
|
|
|
@property NSString *app;
|
2017-07-19 16:02:26 +01:00
|
|
|
@property NSNumber *refId;
|
|
|
|
@property NSString *path;
|
|
|
|
@property NSMutableDictionary *listeners;
|
|
|
|
|
2017-08-02 16:51:00 +01:00
|
|
|
- (id)initWithPathAndModifiers:(RCTEventEmitter *)emitter app:(NSString *)app refId:(NSNumber *)refId refPath:(NSString *)refPath modifiers:(NSArray *)modifiers;
|
2017-07-19 16:02:26 +01:00
|
|
|
- (void)addEventHandler:(NSNumber *)listenerId eventName:(NSString *)eventName;
|
2017-08-02 16:51:00 +01:00
|
|
|
- (void)addSingleEventHandler:(NSString *)eventName resolver:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
|
2017-07-19 16:02:26 +01:00
|
|
|
- (void)removeEventHandler:(NSNumber *)listenerId eventName:(NSString *)eventName;
|
|
|
|
- (BOOL)hasListeners;
|
|
|
|
+ (NSDictionary *)snapshotToDict:(FIRDataSnapshot *)snapshot;
|
|
|
|
@end
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
@interface RNFirebaseDatabaseReference : NSObject
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|