123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- #import <Foundation/Foundation.h>
- #import "RLMRealm.h"
- typedef NS_ENUM(NSUInteger, RLMSyncSessionState) {
-
-
-
-
- RLMSyncSessionStateActive,
-
-
- RLMSyncSessionStateInactive,
-
- RLMSyncSessionStateInvalid
- };
- typedef NS_ENUM(NSUInteger, RLMSyncConnectionState) {
-
-
-
- RLMSyncConnectionStateDisconnected,
-
- RLMSyncConnectionStateConnecting,
-
- RLMSyncConnectionStateConnected,
- };
- typedef NS_ENUM(NSUInteger, RLMSyncProgressDirection) {
-
- RLMSyncProgressDirectionUpload,
-
- RLMSyncProgressDirectionDownload,
- };
- typedef NS_ENUM(NSUInteger, RLMSyncProgressMode) {
-
- RLMSyncProgressModeReportIndefinitely,
-
- RLMSyncProgressModeForCurrentlyOutstandingWork,
- };
- @class RLMSyncUser, RLMSyncConfiguration, RLMSyncErrorActionToken;
- typedef void(^RLMProgressNotificationBlock)(NSUInteger transferredBytes, NSUInteger transferrableBytes);
- NS_ASSUME_NONNULL_BEGIN
- @interface RLMProgressNotificationToken : RLMNotificationToken
- @end
- @interface RLMSyncSession : NSObject
- @property (nonatomic, readonly) RLMSyncSessionState state;
- @property (atomic, readonly) RLMSyncConnectionState connectionState;
- @property (nullable, nonatomic, readonly) NSURL *realmURL;
- - (nullable RLMSyncUser *)parentUser;
- - (nullable RLMSyncConfiguration *)configuration;
- - (void)suspend;
- - (void)resume;
- - (nullable RLMProgressNotificationToken *)addProgressNotificationForDirection:(RLMSyncProgressDirection)direction
- mode:(RLMSyncProgressMode)mode
- block:(RLMProgressNotificationBlock)block
- NS_REFINED_FOR_SWIFT;
- + (void)immediatelyHandleError:(RLMSyncErrorActionToken *)token;
- + (nullable RLMSyncSession *)sessionForRealm:(RLMRealm *)realm;
- @end
- #pragma mark - Error action token
- @interface RLMSyncErrorActionToken : NSObject
- - (instancetype)init __attribute__((unavailable("This type cannot be created directly")));
- + (instancetype)new __attribute__((unavailable("This type cannot be created directly")));
- @end
- NS_ASSUME_NONNULL_END
|