暫無描述

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. #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. + (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 */