/** * Health Check System * * Provides health and readiness checks for the application */ export type HealthStatus = 'healthy' | 'degraded' | 'unhealthy'; export interface HealthCheck { name: string; check: () => Promise; critical?: boolean; timeout?: number; } export interface HealthCheckResult { status: HealthStatus; message?: string; details?: Record; duration?: number; timestamp?: string; } export interface SystemHealth { status: HealthStatus; checks: Record; timestamp: string; uptime: number; version?: string; } export declare class HealthCheckSystem { private checks; private startTime; /** * Register a health check */ register(check: HealthCheck): void; /** * Unregister a health check */ unregister(name: string): void; /** * Run all health checks */ checkHealth(): Promise; /** * Run check with timeout */ private runWithTimeout; /** * Get uptime in seconds */ getUptime(): number; } /** * Default health check system */ export declare const healthCheck: HealthCheckSystem; /** * Database health check */ export declare function createDatabaseHealthCheck(queryFn: () => Promise): HealthCheck; /** * Memory health check */ export declare function createMemoryHealthCheck(thresholdPercent?: number): HealthCheck; /** * Disk health check */ export declare function createDiskHealthCheck(thresholdPercent?: number): HealthCheck; /** * API endpoint health check */ export declare function createAPIHealthCheck(url: string, expectedStatus?: number): HealthCheck; /** * Custom health check */ export declare function createCustomHealthCheck(name: string, checkFn: () => Promise, critical?: boolean): HealthCheck; /** * Create health check endpoint handler */ export declare function createHealthEndpoint(): () => Promise; /** * Create readiness check endpoint handler */ export declare function createReadinessEndpoint(): () => Promise; /** * Create liveness check endpoint handler */ export declare function createLivenessEndpoint(): () => Response; /** * Monitor health and log status changes */ export declare function monitorHealth(intervalMs?: number, onStatusChange?: (status: HealthStatus) => void): Promise; //# sourceMappingURL=health-check.d.ts.map