/**
 * Service Health Check and Monitoring System
 * Provides per-service and aggregated health status with detailed diagnostics
 */
import type { IRequest } from '../http/Request';
import type { IResponse } from '../http/Response';
export interface HealthCheckResult {
    service: string;
    domain: string;
    port: number;
    status: 'healthy' | 'degraded' | 'unhealthy' | 'stopped';
    timestamp: string;
    responseTime: number;
    version: string;
    checks: {
        http: boolean;
        database?: boolean;
        dependencies?: Record<string, boolean>;
    };
    message?: string;
}
export interface AggregatedHealthStatus {
    timestamp: string;
    totalServices: number;
    healthy: number;
    degraded: number;
    unhealthy: number;
    services: HealthCheckResult[];
}
export interface IHealthCheckHandler {
    handle(req: IRequest, res: IResponse): Promise<void>;
}
/**
 * Health Check Endpoint Handler
 * Each service should expose this as GET /health
 */
export declare const HealthCheckHandler: Readonly<{
    /**
     * Create a new health check handler instance
     */
    create(serviceName: string, version: string, port: number, domain: string, dependencies?: string[], checkDatabase?: () => Promise<boolean>): IHealthCheckHandler;
}>;
export interface IServiceHealthMonitor {
    start(): void;
    stop(): void;
    checkAll(): Promise<AggregatedHealthStatus>;
    getLastStatus(): AggregatedHealthStatus;
    getServiceStatus(serviceName: string): HealthCheckResult | undefined;
    areAllHealthy(): boolean;
    isServiceHealthy(serviceName: string): boolean;
}
/**
 * Service Health Monitor
 * Monitors multiple services and provides aggregated health status
 */
export declare const ServiceHealthMonitor: Readonly<{
    /**
     * Create a new service health monitor instance
     */
    create(healthCheckUrls: Record<string, string>, intervalMs?: number): IServiceHealthMonitor;
}>;
export interface IHealthCheckAggregator {
    handle(req: IRequest, res: IResponse): Promise<void>;
}
/**
 * Health Check Aggregator Endpoint
 * Exposes aggregated health status at GET /health/services
 */
export declare const HealthCheckAggregator: Readonly<{
    /**
     * Create a new health check aggregator instance
     */
    create(monitor: IServiceHealthMonitor): IHealthCheckAggregator;
}>;
declare const _default: {
    HealthCheckHandler: Readonly<{
        /**
         * Create a new health check handler instance
         */
        create(serviceName: string, version: string, port: number, domain: string, dependencies?: string[], checkDatabase?: () => Promise<boolean>): IHealthCheckHandler;
    }>;
    ServiceHealthMonitor: Readonly<{
        /**
         * Create a new service health monitor instance
         */
        create(healthCheckUrls: Record<string, string>, intervalMs?: number): IServiceHealthMonitor;
    }>;
    HealthCheckAggregator: Readonly<{
        /**
         * Create a new health check aggregator instance
         */
        create(monitor: IServiceHealthMonitor): IHealthCheckAggregator;
    }>;
};
export default _default;
//# sourceMappingURL=ServiceHealthMonitor.d.ts.map