import { DownloadProgressT } from '../types';
import { HttpsProxyAgent } from 'https-proxy-agent';
export interface MongoBinaryDownloadOpts {
    version?: string;
    downloadDir?: string;
    platform?: string;
    arch?: string;
    checkMD5?: boolean;
}
interface HttpDownloadOptions {
    hostname: string;
    port: string;
    path: string;
    method: 'GET' | 'POST';
    rejectUnauthorized?: boolean;
    agent: HttpsProxyAgent | undefined;
}
/**
 * Download and extract the "mongod" binary
 */
export default class MongoBinaryDownload {
    dlProgress: DownloadProgressT;
    _downloadingUrl?: string;
    checkMD5: boolean;
    downloadDir: string;
    arch: string;
    version: string;
    platform: string;
    constructor({ platform, arch, downloadDir, version, checkMD5 }: MongoBinaryDownloadOpts);
    /**
     * Get the path of the already downloaded "mongod" file
     * otherwise download it and then return the path
     */
    getMongodPath(): Promise<string>;
    /**
     * Download the MongoDB Archive and check it against an MD5
     * @returns The MongoDB Archive location
     */
    startDownload(): Promise<string>;
    /**
     * Download MD5 file and check it against the MongoDB Archive
     * @param urlForReferenceMD5 URL to download the MD5
     * @param mongoDBArchive The MongoDB Archive file location
     */
    makeMD5check(urlForReferenceMD5: string, mongoDBArchive: string): Promise<boolean | undefined>;
    /**
     * Download file from downloadUrl
     * @param downloadUrl URL to download a File
     */
    download(downloadUrl: string): Promise<string>;
    /**
     * Extract given Archive
     * @param mongoDBArchive Archive location
     * @returns extracted directory location
     */
    extract(mongoDBArchive: string): Promise<string>;
    /**
     * Extract a .tar.gz archive
     * @param mongoDBArchive Archive location
     * @param extractDir Directory to extract to
     * @param filter Method to determine which files to extract
     */
    extractTarGz(mongoDBArchive: string, extractDir: string, filter: (file: string) => boolean): Promise<void>;
    /**
     * Extract a .zip archive
     * @param mongoDBArchive Archive location
     * @param extractDir Directory to extract to
     * @param filter Method to determine which files to extract
     */
    extractZip(mongoDBArchive: string, extractDir: string, filter: (file: string) => boolean): Promise<void>;
    /**
     * Downlaod given httpOptions to tempDownloadLocation, then move it to downloadLocation
     * @param httpOptions The httpOptions directly passed to https.get
     * @param downloadLocation The location the File should be after the download
     * @param tempDownloadLocation The location the File should be while downloading
     */
    httpDownload(httpOptions: HttpDownloadOptions, downloadLocation: string, tempDownloadLocation: string): Promise<string>;
    /**
     * Print the Download Progress to STDOUT
     * @param chunk A chunk to get the length
     */
    printDownloadProgress(chunk: {
        length: number;
    }): void;
    /**
     * Test if the location given is already used
     * Does *not* dereference links
     * @param location The Path to test
     */
    locationExists(location: string): Promise<boolean>;
}
export {};
//# sourceMappingURL=MongoBinaryDownload.d.ts.map