설명 없음

RNFetchBlobNetwork.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 RNFetchBlobResp_h
  9. #define RNFetchBlobResp_h
  10. #import <Foundation/Foundation.h>
  11. #import "RCTBridgeModule.h"
  12. #import "RNFetchBlobFS.h"
  13. typedef void(^CompletionHander)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error);
  14. typedef void(^DataTaskCompletionHander) (NSData * _Nullable resp, NSURLResponse * _Nullable response, NSError * _Nullable error);
  15. @interface RNFetchBlobNetwork : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate>
  16. @property (nullable, nonatomic) NSString * taskId;
  17. @property (nonatomic) int expectedBytes;
  18. @property (nonatomic) int receivedBytes;
  19. @property (nullable, nonatomic) NSMutableData * respData;
  20. @property (strong, nonatomic) RCTResponseSenderBlock callback;
  21. @property (nullable, nonatomic) RCTBridge * bridge;
  22. @property (nullable, nonatomic) NSDictionary * options;
  23. @property (nullable, nonatomic) RNFetchBlobFS * fileStream;
  24. @property (strong, nonatomic) CompletionHander fileTaskCompletionHandler;
  25. @property (strong, nonatomic) DataTaskCompletionHander dataTaskCompletionHandler;
  26. @property (nullable, nonatomic) NSError * error;
  27. - (nullable id) init;
  28. - (void) sendRequest;
  29. + (NSMutableDictionary * _Nullable ) normalizeHeaders:(NSDictionary * _Nullable)headers;
  30. + (void) cancelRequest:(NSString *)taskId;
  31. + (void) enableProgressReport:(NSString *) taskId;
  32. + (void) enableUploadProgress:(NSString *) taskId;
  33. - (void) sendRequest:(NSDictionary * _Nullable )options contentLength:(long)contentLength bridge:(RCTBridge * _Nullable)bridgeRef taskId:(NSString * _Nullable)taskId withRequest:(NSURLRequest * _Nullable)req callback:(_Nullable RCTResponseSenderBlock) callback;
  34. @end
  35. #endif /* RNFetchBlobResp_h */