No Description

RNFetchBlobNetwork.h 1.5KB

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