Skip to content

Commit

Permalink
Convert downloadChromium to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro committed Dec 24, 2020
1 parent 5f17f7d commit e607c1a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/backend/import/downloadChromium.js

This file was deleted.

23 changes: 23 additions & 0 deletions src/backend/import/downloadChromium.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import download from 'download-chromium';
import { getPuppeteerConfig } from 'israeli-bank-scrapers-core';

type OnProgress = ({ percent, transferred, total }) => void
type DownloadOptions = {
platform: string,
revision: string,
log: boolean,
onProgress: OnProgress
installPath: string
}
type Download = (options: Partial<DownloadOptions>) => string

const revision = getPuppeteerConfig().chromiumRevision;

export default async function downloadChromium(installPath?: string, onProgress?: OnProgress) {
const func: Download = download;
return func({
revision,
installPath,
onProgress,
});
}

0 comments on commit e607c1a

Please sign in to comment.