downloader.d.ts 955 B

1234567891011121314151617181920
  1. import { Binary } from '../binaries';
  2. /**
  3. * The file downloader.
  4. */
  5. export declare class Downloader {
  6. /**
  7. * Http get the file. Check the content length of the file before writing the file.
  8. * If the content length does not match, remove it and download the file.
  9. *
  10. * @param binary The binary of interest.
  11. * @param fileName The file name.
  12. * @param outputDir The directory where files are downloaded and stored.
  13. * @param contentLength The content length of the existing file.
  14. * @param opt_proxy The proxy for downloading files.
  15. * @param opt_callback Callback method to be executed after the file is downloaded.
  16. * @returns Promise<boolean> Resolves true = downloaded. Resolves false = not downloaded.
  17. * Rejected with an error.
  18. */
  19. static getFile(binary: Binary, fileUrl: string, fileName: string, outputDir: string, contentLength: number, callback?: Function): Promise<boolean>;
  20. }