/**
 * Update Check Workflow
 *
 * Checks plugins for available updates across configured sources.
 * Uses the unified cache system for offline resilience.
 */
import { EventEmitter } from 'node:events';
import type { PluginManager } from '../core/plugin-manager.js';
import type { SourceRegistry } from '../core/sources/index.js';
import type { Plugin, PluginUpdateInfo, ScannedPlugin } from '../core/types/index.js';
/**
 * Update check progress event
 */
export interface UpdateCheckProgress {
    current: number;
    total: number;
    pluginName: string;
    status: 'checking' | 'done' | 'error' | 'cached' | 'timeout';
    message?: string;
}
/**
 * Update check result
 */
export interface UpdateCheckResult {
    updatesAvailable: PluginUpdateInfo[];
    upToDate: PluginUpdateInfo[];
    errors: Array<{
        pluginName: string;
        error: string;
    }>;
    skipped: Array<{
        pluginName: string;
        reason: string;
    }>;
    fromCache: number;
    duration: number;
}
/**
 * Update check options
 */
export interface UpdateCheckOptions {
    enabledOnly?: boolean;
    sourceType?: string;
    concurrency?: number;
    useCache?: boolean;
    forceRefresh?: boolean;
    timeout?: number;
    onProgress?: (progress: UpdateCheckProgress) => void;
}
/**
 * Update checker class with event emitter
 */
export declare class UpdateChecker extends EventEmitter {
    private pluginManager;
    private sourceRegistry;
    constructor(pluginManager: PluginManager, sourceRegistry: SourceRegistry);
    /**
     * Check all configured plugins for updates
     */
    checkAll(options?: UpdateCheckOptions): Promise<UpdateCheckResult>;
    /**
     * Check if we have a fresh cached result for a plugin
     */
    private checkCachedPlugin;
    /**
     * Get stale cached result for fallback (when API fails)
     */
    private getStaleCache;
    /**
     * Check a single plugin for updates
     */
    checkPlugin(plugin: Plugin): Promise<PluginUpdateInfo>;
    /**
     * Check a scanned plugin against configured sources
     */
    checkScannedPlugin(scannedPlugin: ScannedPlugin, configuredPlugin?: Plugin): Promise<PluginUpdateInfo>;
    /**
     * Compare two versions and return if update is available
     */
    hasUpdate(currentVersion: string, latestVersion: string): boolean;
    /**
     * Get the last update check timestamp
     */
    getLastCheckTime(): Promise<string | null>;
    /**
     * Check if update cache is still fresh
     */
    isCacheFresh(): Promise<boolean>;
    /**
     * Clear the update results cache
     */
    clearCache(): Promise<void>;
}
/**
 * Create an update checker instance
 */
export declare function createUpdateChecker(pluginManager: PluginManager, sourceRegistry: SourceRegistry): UpdateChecker;
/**
 * Quick check for updates on a list of plugins
 */
export declare function quickUpdateCheck(plugins: Plugin[], sourceRegistry: SourceRegistry, getVersion: (name: string) => string | undefined): Promise<PluginUpdateInfo[]>;
//# sourceMappingURL=update-check.d.ts.map