/**
 * @author Luuxis
 * Luuxis License v1.0 (voir fichier LICENSE pour les détails en FR/EN)
 */
import { EventEmitter } from 'events';
import type { ForgeInstallProfile, MinecraftLibrary, PatcherProcessor } from '../../../types.js';
/**
 * Options passed to ForgeMC. Adjust as needed.
 */
interface ForgeOptions {
    path: string;
    loader: {
        version: string;
        build: string;
        config: {
            javaPath: string;
            minecraftJar: string;
            minecraftJson: string;
        };
        type: string;
    };
    downloadFileMultiple?: number;
    [key: string]: any;
}
/**
 * Represents information about the Forge installer file after download:
 * - If successful, contains filePath, metaData, ext, and an id (e.g. "forge-<build>")
 * - If an error occurs, returns an object with `error` describing the issue.
 */
type DownloadInstallerResult = {
    filePath: string;
    metaData: string;
    ext: string;
    id: string;
} | {
    error: string;
};
/**
 * Describes the structure of an install_profile.json (Forge Installer) after extraction.
 */
interface ForgeProfile {
    install?: ForgeInstallProfile;
    version?: Record<string, unknown> & {
        id?: string;
        libraries?: MinecraftLibrary[];
    };
    data: Record<string, {
        client: string;
    }>;
    filePath?: string;
    path?: string;
    processors?: PatcherProcessor[];
    libraries?: MinecraftLibrary[];
    error?: {
        message: string;
    };
}
/**
 * The main class for handling Forge installations, including:
 *  - Downloading the appropriate Forge installer
 *  - Extracting relevant files from the installer
 *  - Patching Forge when necessary
 *  - Creating a merged jar for older Forge versions
 */
export default class ForgeMC extends EventEmitter {
    private readonly options;
    constructor(options: ForgeOptions);
    /**
     * Downloads the Forge installer (or client/universal) for the specified version/build.
     * Verifies the downloaded file's MD5 hash. Returns file details or an error.
     *
     * @param Loader An object containing URLs for metadata and Forge files.
     */
    downloadInstaller(Loader: any): Promise<DownloadInstallerResult>;
    /**
     * Extracts the main Forge profile from the installer's archive (install_profile.json),
     * plus an additional JSON if specified in that profile. Returns an object containing
     * both "install" and "version" data for further processing.
     *
     * @param pathInstaller Path to the downloaded Forge installer file.
     */
    extractProfile(pathInstaller: string): Promise<ForgeProfile | {
        error: {
            message: string;
        };
    }>;
    /**
     * Extracts the "universal" Forge jar (or other relevant data) from the installer,
     * placing it in your local "libraries" folder. Also extracts client data if required.
     *
     * @param profile The Forge profile object containing file paths to extract.
     * @param pathInstaller The path to the Forge installer file.
     * @returns A boolean (skipForgeFilter) that indicates whether to filter out certain Forge libs
     */
    extractUniversalJar(profile: ForgeInstallProfile, pathInstaller: string): Promise<boolean>;
    /**
     * Downloads all the libraries needed by the Forge profile, skipping duplicates
     * and any library that is already present. Also applies optional skip logic
     * for certain Forge libraries if skipForgeFilter is true.
     *
     * @param profile The parsed Forge profile.
     * @param skipForgeFilter Whether to filter out "net.minecraftforge:forge" or "minecraftforge"
     * @returns An array of the final libraries (including newly downloaded ones).
     */
    downloadLibraries(profile: ForgeProfile, skipForgeFilter: boolean): Promise<MinecraftLibrary[] | {
        error: string;
    }>;
    /**
     * Applies any necessary patches to Forge using the `forgePatcher` class.
     * If the patcher determines it's already patched, it skips.
     *
     * @param profile The Forge profile containing processor information
     * @returns True if successful or if no patching was required
     */
    patchForge(profile: ForgeInstallProfile): Promise<boolean>;
}
export {};
