/**
 * Registry Download Service
 *
 * Handles downloading plugins from the curated registry by resolving
 * registry entries to downloadable plugin info using the appropriate sources.
 *
 * @since v1.54.0
 */
import { type DownloadProgress, type DownloadResult } from '../../workflows/download.js';
import type { IPluginSource, PluginInfo } from '../types/index.js';
import type { RegistryPlugin } from './registry-types.js';
/**
 * Options for downloading from registry
 */
export interface RegistryDownloadOptions {
    /** Target directory (prod or test server plugins dir) */
    targetDir: string;
    /** Specific version to download (default: latest) */
    version?: string;
    /** Target Minecraft version for compatibility */
    minecraftVersion?: string;
    /** Create backup of existing file */
    backupExisting?: boolean;
    /** Backup directory */
    backupDir?: string;
    /** Progress callback */
    onProgress?: (progress: DownloadProgress) => void;
}
/**
 * Result of resolving a registry plugin to downloadable info
 */
export interface ResolveResult {
    success: boolean;
    pluginInfo?: PluginInfo;
    sourceType?: string;
    error?: string;
    triedSources?: string[];
}
/**
 * Result of downloading from registry
 */
export interface RegistryDownloadResult extends DownloadResult {
    /** Which source was used */
    sourceType?: string;
    /** Sources that were tried but failed */
    triedSources?: string[];
}
/**
 * Registry Download Service
 *
 * Resolves registry plugins to download URLs using configured sources
 */
export declare class RegistryDownloadService {
    private sources;
    constructor(sources: IPluginSource[]);
    /**
     * Resolve a registry plugin to downloadable PluginInfo
     * Tries sources in order of preference
     */
    resolvePlugin(plugin: RegistryPlugin, options?: {
        minecraftVersion?: string;
    }): Promise<ResolveResult>;
    /**
     * Resolve plugin info from a specific source
     */
    private resolveFromSource;
    /**
     * Get the source-specific identifier from a registry source config
     */
    private getSourceId;
    /**
     * Download a plugin from the registry
     */
    downloadPlugin(plugin: RegistryPlugin, options: RegistryDownloadOptions): Promise<RegistryDownloadResult>;
    /**
     * Download a plugin to multiple destinations
     */
    downloadToMultiple(plugin: RegistryPlugin, destinations: {
        dir: string;
        name: string;
    }[], options: Omit<RegistryDownloadOptions, 'targetDir'>): Promise<{
        destination: string;
        result: RegistryDownloadResult;
    }[]>;
    /**
     * Check if a source is available for a registry plugin
     */
    hasSource(plugin: RegistryPlugin): boolean;
    /**
     * Get available sources for a plugin
     */
    getAvailableSources(plugin: RegistryPlugin): string[];
}
/**
 * Create a registry download service
 */
export declare function createRegistryDownloadService(sources: IPluginSource[]): RegistryDownloadService;
//# sourceMappingURL=registry-download.d.ts.map