2017-09-28 12:48:28 +00:00
|
|
|
#ifndef RNFirebaseFirestoreDocumentReference_h
|
|
|
|
#define RNFirebaseFirestoreDocumentReference_h
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2017-10-03 16:23:28 +00:00
|
|
|
#if __has_include(<FirebaseFirestore/FirebaseFirestore.h>)
|
2017-09-28 12:48:28 +00:00
|
|
|
|
2017-10-03 16:23:28 +00:00
|
|
|
#import <FirebaseFirestore/FirebaseFirestore.h>
|
2017-10-02 14:45:07 +00:00
|
|
|
#import <React/RCTEventEmitter.h>
|
|
|
|
#import "RNFirebaseEvents.h"
|
2017-09-28 12:48:28 +00:00
|
|
|
#import "RNFirebaseFirestore.h"
|
2017-10-26 10:55:07 +00:00
|
|
|
#import "RNFirebaseUtil.h"
|
2017-09-28 12:48:28 +00:00
|
|
|
|
|
|
|
@interface RNFirebaseFirestoreDocumentReference : NSObject
|
2017-10-02 14:45:07 +00:00
|
|
|
@property RCTEventEmitter *emitter;
|
2017-09-28 12:48:28 +00:00
|
|
|
@property NSString *app;
|
|
|
|
@property NSString *path;
|
|
|
|
@property FIRDocumentReference *ref;
|
|
|
|
|
2017-10-02 14:45:07 +00:00
|
|
|
- (id)initWithPath:(RCTEventEmitter *)emitter app:(NSString *)app path:(NSString *)path;
|
2017-10-05 09:18:24 +00:00
|
|
|
- (void)delete:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
|
2017-09-28 12:48:28 +00:00
|
|
|
- (void)get:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
|
2017-10-03 09:12:25 +00:00
|
|
|
+ (void)offSnapshot:(NSString *)listenerId;
|
2017-10-06 11:00:40 +00:00
|
|
|
- (void)onSnapshot:(NSString *)listenerId docListenOptions:(NSDictionary *) docListenOptions;
|
2017-09-28 12:48:28 +00:00
|
|
|
- (void)set:(NSDictionary *)data options:(NSDictionary *)options resolver:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
|
|
|
|
- (void)update:(NSDictionary *)data resolver:(RCTPromiseResolveBlock) resolve rejecter:(RCTPromiseRejectBlock) reject;
|
2017-10-02 14:45:07 +00:00
|
|
|
- (BOOL)hasListeners;
|
2017-09-28 12:48:28 +00:00
|
|
|
+ (NSDictionary *)snapshotToDictionary:(FIRDocumentSnapshot *)documentSnapshot;
|
2017-10-31 22:18:07 +00:00
|
|
|
+ (NSDictionary *)parseJSMap:(FIRFirestore *) firestore jsMap:(NSDictionary *) jsMap;
|
|
|
|
+ (NSArray *)parseJSArray:(FIRFirestore *) firestore jsArray:(NSArray *) jsArray;
|
|
|
|
+ (id)parseJSTypeMap:(FIRFirestore *) firestore jsTypeMap:(NSDictionary *) jsTypeMap;
|
|
|
|
|
2017-09-28 12:48:28 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
@interface RNFirebaseFirestoreDocumentReference : NSObject
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|