1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 17:38:07 +01:00
Telegram/Watch/Bridge/TGBridgeResponse.h
2015-10-01 19:19:52 +03:00

25 lines
788 B
Objective-C

#import <Foundation/Foundation.h>
@class TGBridgeSubscription;
typedef NS_ENUM(int32_t, TGBridgeResponseType) {
TGBridgeResponseTypeUndefined,
TGBridgeResponseTypeNext,
TGBridgeResponseTypeFailed,
TGBridgeResponseTypeCompleted
};
@interface TGBridgeResponse : NSObject <NSCoding>
@property (nonatomic, readonly) int64_t subscriptionIdentifier;
@property (nonatomic, readonly) TGBridgeResponseType type;
@property (nonatomic, readonly) id next;
@property (nonatomic, readonly) NSString *error;
+ (TGBridgeResponse *)single:(id)next forSubscription:(TGBridgeSubscription *)subscription;
+ (TGBridgeResponse *)fail:(id)error forSubscription:(TGBridgeSubscription *)subscription;
+ (TGBridgeResponse *)completeForSubscription:(TGBridgeSubscription *)subscription;
@end