No Description

types.js 1.4KB

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