Nessuna descrizione

RNFetchBlobNetwork.h 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. + (NSMutableDictionary * _Nullable ) normalizeHeaders:(NSDictionary * _Nullable)headers;
  28. + (void) cancelRequest:(NSString *)taskId;
  29. + (void) enableProgressReport:(NSString *) taskId;
  30. + (void) enableUploadProgress:(NSString *) taskId;
  31. + (void) getExpiredTasks;
  32. - (nullable id) init;
  33. - (void) sendRequest;
  34. - (void) sendRequest:(NSDictionary * _Nullable )options contentLength:(long)contentLength bridge:(RCTBridge * _Nullable)bridgeRef taskId:(NSString * _Nullable)taskId withRequest:(NSURLRequest * _Nullable)req callback:(_Nullable RCTResponseSenderBlock) callback;
  35. @end
  36. #endif /* RNFetchBlobResp_h */