/**
 * Worker Registry
 * Central registry for all background workers with lifecycle management
 * Sealed namespace for immutability
 */
import { type WorkerConfig, type WorkerStatus } from '../../../src/index.js';
export type WorkerMetadata = {
    name: string;
    status: WorkerStatus;
    version: string;
    region: string;
    queueName: string;
    concurrency: number;
    activeStatus?: boolean;
    startedAt: Date | null;
    stoppedAt: Date | null;
    lastProcessedAt: Date | null;
    restartCount: number;
    processedCount: number;
    errorCount: number;
    lockKey: string | null;
    priority: number;
    memoryUsage: number;
    cpuUsage: number;
    circuitState: 'closed' | 'open' | 'half-open';
    queues: ReadonlyArray<string>;
    plugins: ReadonlyArray<string>;
    datacenter: string;
    canaryPercentage: number;
    config: Partial<WorkerConfig>;
};
export type WorkerInstance = {
    metadata: WorkerMetadata;
    instance: unknown;
    start: () => void;
    stop: () => Promise<void>;
    drain: () => Promise<void>;
    sleep: () => Promise<void>;
    wakeup: () => void;
    getStatus: () => WorkerStatus;
    getHealth: () => 'green' | 'yellow' | 'red';
};
export type RegisterWorkerOptions = {
    name: string;
    config: Partial<WorkerConfig>;
    activeStatus?: boolean;
    version?: string;
    region?: string;
    queues?: ReadonlyArray<string>;
    factory: () => Promise<WorkerInstance>;
};
export type WorkerRegistrySnapshot = {
    timestamp: Date;
    totalWorkers: number;
    runningWorkers: number;
    stoppedWorkers: number;
    sleepingWorkers: number;
    unhealthyWorkers: number;
    workers: ReadonlyArray<{
        name: string;
        status: WorkerStatus;
        health: 'green' | 'yellow' | 'red';
        uptime: number | null;
        processedCount: number;
        errorCount: number;
    }>;
};
/**
 * Worker Registry - Sealed namespace
 */
export declare const WorkerRegistry: Readonly<{
    /**
     * Register a worker with the registry
     */
    register(options: RegisterWorkerOptions): void;
    /**
     * Start a worker
     */
    start(name: string, version?: string): Promise<void>;
    /**
     * Stop a worker
     */
    stop(name: string): Promise<void>;
    /**
     * Restart a worker (stop + start)
     */
    restart(name: string): Promise<void>;
    /**
     * Sleep a worker (pause processing but keep lock)
     */
    sleep(name: string): Promise<void>;
    /**
     * Wakeup a worker (resume from sleep)
     */
    wakeup(name: string): Promise<void>;
    /**
     * Get worker status
     */
    status(name: string): WorkerMetadata | null;
    /**
     * List all registered workers
     */
    list(): ReadonlyArray<string>;
    /**
     * Update active status for a registered worker
     */
    setActiveStatus(name: string, activeStatus: boolean): void;
    /**
     * List all running workers
     */
    listRunning(): ReadonlyArray<string>;
    /**
     * Stop all running workers
     */
    stopAll(): Promise<void>;
    /**
     * Get worker metrics
     */
    getMetrics(name: string): Pick<WorkerMetadata, "processedCount" | "errorCount" | "memoryUsage" | "cpuUsage"> | null;
    /**
     * Get worker health status
     */
    getHealth(name: string): "green" | "yellow" | "red" | null;
    /**
     * Get registry snapshot
     */
    getSnapshot(): WorkerRegistrySnapshot;
    /**
     * Get worker topology (cluster view)
     */
    getTopology(): Record<string, {
        workers: string[];
        count: number;
    }>;
    /**
     * Unregister a worker and clear its instance
     */
    unregister(name: string): void;
    /**
     * Check if worker is registered
     */
    isRegistered(name: string): boolean;
    /**
     * Check if worker is running
     */
    isRunning(name: string): boolean;
    /**
     * Get worker instance (internal use)
     */
    getInstance(name: string): WorkerInstance | null;
}>;
//# sourceMappingURL=WorkerRegistry.d.ts.map