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-10-26 10:55:07 +00:00
|
|
|
#import "RNFirebaseUtil.h"
|
2017-07-19 15:02:26 +00:00
|
|
|
#import <React/RCTEventEmitter.h>
|
|
|
|
|
|
|
|
@interface RNFirebaseDatabaseReference : NSObject
|
|
|
|
@property RCTEventEmitter *emitter;
|
|
|
|
@property FIRDatabaseQuery *query;
|
2018-01-03 20:00:38 +00:00
|
|
|
@property NSString *appDisplayName;
|
2017-11-21 23:37:05 +00:00
|
|
|
@property NSString *dbURL;
|
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-11-21 23:37:05 +00:00
|
|
|
- (id)initWithPathAndModifiers:(RCTEventEmitter *)emitter appDisplayName:(NSString *)appDisplayName dbURL:(NSString *)dbURL key:(NSString *)key refPath:(NSString *)refPath modifiers:(NSArray *)modifiers;
|
2017-08-22 16:29:02 +00:00
|
|
|
- (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
|