暂无描述

RNFetchBlobNetwork.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // RNFetchBlobNetwork.h
  3. // RNFetchBlob
  4. //
  5. // Created by wkh237 on 2016/6/6.
  6. // Copyright © 2016 wkh237. All rights reserved.
  7. //
  8. #ifndef RNFetchBlobNetwork_h
  9. #define RNFetchBlobNetwork_h
  10. #import <Foundation/Foundation.h>
  11. #import "RNFetchBlobProgress.h"
  12. #import "RNFetchBlobFS.h"
  13. #import "RNFetchBlobRequest.h"
  14. #if __has_include(<React/RCTAssert.h>)
  15. #import <React/RCTBridgeModule.h>
  16. #else
  17. #import "RCTBridgeModule.h"
  18. #endif
  19. @interface RNFetchBlobNetwork : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate>
  20. @property(nonnull, nonatomic) NSOperationQueue *taskQueue;
  21. @property(nonnull, nonatomic) NSMapTable<NSString*, RNFetchBlobRequest*> * requestsTable;
  22. @property(nonnull, nonatomic) NSMutableDictionary<NSString*, RNFetchBlobProgress*> *rebindProgressDict;
  23. @property(nonnull, nonatomic) NSMutableDictionary<NSString*, RNFetchBlobProgress*> *rebindUploadProgressDict;
  24. + (RNFetchBlobNetwork* _Nullable)sharedInstance;
  25. + (NSMutableDictionary * _Nullable ) normalizeHeaders:(NSDictionary * _Nullable)headers;
  26. + (void) emitExpiredTasks;
  27. - (nullable id) init;
  28. - (void) sendRequest:(NSDictionary * _Nullable )options
  29. contentLength:(long)contentLength
  30. bridge:(RCTBridge * _Nullable)bridgeRef
  31. taskId:(NSString * _Nullable)taskId
  32. withRequest:(NSURLRequest * _Nullable)req
  33. callback:(_Nullable RCTResponseSenderBlock) callback;
  34. - (void) cancelRequest:(NSString * _Nonnull)taskId;
  35. - (void) enableProgressReport:(NSString * _Nonnull) taskId config:(RNFetchBlobProgress * _Nullable)config;
  36. - (void) enableUploadProgress:(NSString * _Nonnull) taskId config:(RNFetchBlobProgress * _Nullable)config;
  37. @end
  38. #endif /* RNFetchBlobNetwork_h */