No Description

types.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. type RNFetchBlobConfig = {
  2. fileCache : bool,
  3. path : string,
  4. appendExt : string,
  5. session : string,
  6. addAndroidDownloads : any,
  7. indicator : bool,
  8. followRedirect : bool,
  9. trusty : bool,
  10. wifiOnly : bool
  11. };
  12. type RNFetchBlobNative = {
  13. // API for fetch octet-stream data
  14. fetchBlob : (
  15. options:fetchConfig,
  16. taskId:string,
  17. method:string,
  18. url:string,
  19. headers:any,
  20. body:any,
  21. callback:(err:any, ...data:any) => void
  22. ) => void,
  23. // API for fetch form data
  24. fetchBlobForm : (
  25. options:fetchConfig,
  26. taskId:string,
  27. method:string,
  28. url:string,
  29. headers:any,
  30. form:Array<any>,
  31. callback:(err:any, ...data:any) => void
  32. ) => void,
  33. // open file stream
  34. readStream : (
  35. path:string,
  36. encode:'utf8' | 'ascii' | 'base64'
  37. ) => void,
  38. // get system folders
  39. getEnvironmentDirs : (dirs:any) => void,
  40. // unlink file by path
  41. unlink : (path:string, callback: (err:any) => void) => void,
  42. removeSession : (paths:Array<string>, callback: (err:any) => void) => void,
  43. ls : (path:string, callback: (err:any) => void) => void,
  44. };
  45. type RNFetchBlobResponseInfo = {
  46. taskId : string,
  47. state : number,
  48. headers : any,
  49. status : number,
  50. respType : 'text' | 'blob' | '' | 'json',
  51. rnfbEncode : 'path' | 'base64' | 'ascii' | 'utf8'
  52. }
  53. type RNFetchBlobStream = {
  54. onData : () => void,
  55. onError : () => void,
  56. onEnd : () => void,
  57. _onData : () => void,
  58. _onEnd : () => void,
  59. _onError : () => void,
  60. }