Bez popisu

types.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 RNFetchBlobStream = {
  43. onData : () => void,
  44. onError : () => void,
  45. onEnd : () => void,
  46. _onData : () => void,
  47. _onEnd : () => void,
  48. _onError : () => void,
  49. }