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