dmclc
Version:
Dolphin Minecraft Launcher Core
39 lines (38 loc) • 1.49 kB
TypeScript
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import fs from "fs";
import { Launcher } from "../launcher.js";
import { Pair } from "./pair.js";
/**
* Download multi files after checking hash.
* @throws RequestError
* @param files A map from URL to path
* @param launcher Launcher
* @returns true if success
*/
export declare function checkAndDownloadAll(files: Map<string, Pair<string, fs.PathLike>>, launcher: Launcher, algorithm?: string): Promise<boolean>;
/**
* Download multi files.
* @throws RequestError
* @param files A map from URL to path
* @param launcher Launcher
* @returns true if success
*/
export declare function downloadAll(files: Map<string, fs.PathLike>, launcher: Launcher): Promise<boolean>;
/**
* Download a file after checking hash.
* @throws {@link FormattedError}
* @param url - URL.
* @param filename - File name.
* @param mirror - BMCLAPI mirror.
*/
export declare function checkAndDownload(url: string, filename: fs.PathLike, hash: string, launcher: Launcher, algorithm?: string): Promise<boolean>;
/**
* Download a file.
* @throws {@link FormattedError}
* @param url - URL.
* @param filename - File name.
* @param mirror - BMCLAPI mirror.
*/
export declare function download(url: string, filename: fs.PathLike, launcher: Launcher): Promise<boolean>;
export declare function downloadIntoStream(url: string, out: NodeJS.WritableStream, launcher: Launcher): Promise<boolean>;