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-12 18:07:51 +00:00
|
|
|
#import <FirebaseDatabase/FIRDatabase.h>
|
|
|
|
#import "RNFirebaseDatabase.h"
|
2017-08-11 15:07:32 +00:00
|
|
|
#import "RNFirebaseEvents.h"
|
2017-07-19 15:02:26 +00:00
|
|
|
#import <React/RCTEventEmitter.h>
|
|
|
|
|
|
|
|
@interface RNFirebaseDatabaseReference : NSObject
|
|
|
|
@property RCTEventEmitter *emitter;
|
|
|
|
@property FIRDatabaseQuery *query;
|
2017-08-02 15:51:00 +00:00
|
|
|
@property NSString *app;
|
2017-08-22 16:29:02 +00:00
|
|
|
@property NSString *key;
|
2017-07-19 15:02:26 +00:00
|
|
|
@property NSString *path;
|
|
|
|
@property NSMutableDictionary *listeners;
|
|
|
|
|
2017-08-22 16:29:02 +00:00
|
|
|
- (id)initWithPathAndModifiers:(RCTEventEmitter *)emitter app:(NSString *)app key:(NSString *)key refPath:(NSString *)refPath modifiers:(NSArray *)modifiers;
|
|
|
|
- (void)on:(NSString *) eventName registration:(NSDictionary *) registration;
|
|
|
|
- (void)once:(NSString *) eventType resolver:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
|
|
|
|
- (void)removeEventListener:(NSString *)eventRegistrationKey;
|
2017-07-19 15:02:26 +00:00
|
|
|
- (BOOL)hasListeners;
|
2017-08-22 16:29:02 +00:00
|
|
|
+ (NSDictionary *)snapshotToDict:(FIRDataSnapshot *)dataSnapshot;
|
2017-07-19 15:02:26 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
@interface RNFirebaseDatabaseReference : NSObject
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|