import type { ChildProcess } from 'node:child_process'; /** * Takes care of installing Forge, installing mods, starting a Forge server, and fetching metadata. */ export declare class ModLoader { private readonly mods; private readonly path; private readonly loader; private readonly versionMinecraft; constructor(args: IModLoaderArgs); /** * @returns {boolean} If Forge is installed */ isForgeInstalled(): boolean; /** * Download and install Forge. */ installForge(): Promise; /** * Accept the Minecraft EULA */ acceptEula(): Promise; /** * @returns {boolean} If mods are installed. */ areModsInstalled(): boolean; /** * Download and install mods. */ installMods(): Promise; downloadFile(url: string, fileName: string, modsDir: string, headers?: Record): Promise; /** * Download a Maven artifact by constructing the repository URL manually. * This is used for authenticated repositories where custom headers are needed. * @param artifact The Maven artifact coordinates (groupId:artifactId:version[:classifier]). * @param repoUrl The base URL of the Maven repository. * @param modsDir The directory to save the downloaded file. * @param headers Optional HTTP headers (e.g., Authorization). * @returns The full path to the downloaded file. */ downloadMavenArtifact(artifact: string, repoUrl: string, modsDir: string, headers?: Record): Promise; /** * Start the server and execute a command to dump all registries */ startServer(): Promise; /** * Send a command to the given process via stdin. * @param {"child_process".ChildProcess} proc A process. * @param {string} command A command. */ sendCommand(proc: ChildProcess, command: string): void; /** * Copy the resulting registry files to a target path. * @param {string} target A target path. */ copyRegistries(target: string): Promise; /** * Extract the Minecraft assets from the server jar */ extractMinecraftAssets(): Promise; /** * Extract assets from all mod jars */ extractModsAssets(): Promise; /** * Extract the assets of a mod. A mod file. * @param {string} modFile A mod file path. */ extractModAssets(modFile: string): Promise; /** * Copy the resulting mod asset files to a target path. * @param {string} target A target path. */ copyModAssets(target: string): Promise; /** * Remove the server files. */ removeServer(): Promise; /** * Remove the mod directory. */ removeMods(): Promise; protected ensureDirExists(path: string): Promise; } export interface IModLoaderArgs { mods: IMod[]; path: string; loader: ILoader; versionMinecraft: string; } export type ILoader = { versionForge: string; } | { versionNeoForge: string; }; export type IMod = IModMaven | IModCurseforge | IModRaw; export interface IModMaven { type: 'maven'; artifact: string; repo: string; name?: string; headers?: Record; } export interface IModCurseforge { type: 'curseforge'; project: string; artifact: string; version: string; } export interface IModRaw { type: 'raw'; name: string; url: string; }