GotDownloader.d.ts 860 B

123456789101112131415161718192021
  1. import { Progress as GotProgress, Options as GotOptions } from 'got';
  2. import { Downloader } from './Downloader';
  3. /**
  4. * See [`got#options`](https://github.com/sindresorhus/got#options) for possible keys/values.
  5. */
  6. export declare type GotDownloaderOptions = (GotOptions & {
  7. isStream?: true;
  8. }) & {
  9. /**
  10. * if defined, triggers every time `got`'s `downloadProgress` event callback is triggered.
  11. */
  12. getProgressCallback?: (progress: GotProgress) => Promise<void>;
  13. /**
  14. * if `true`, disables the console progress bar (setting the `ELECTRON_GET_NO_PROGRESS`
  15. * environment variable to a non-empty value also does this).
  16. */
  17. quiet?: boolean;
  18. };
  19. export declare class GotDownloader implements Downloader<GotDownloaderOptions> {
  20. download(url: string, targetFilePath: string, options?: GotDownloaderOptions): Promise<void>;
  21. }