/**
 * Security Alert Service
 *
 * Main service for security alerting that coordinates:
 * - Alert detection and creation
 * - Deduplication
 * - Channel routing
 * - Escalation management
 * - Maintenance window suppression
 * - Integration with incident response
 *
 * @packageDocumentation
 * @module security/alerting/service
 */
import type { Redis } from 'ioredis';
import { type SecurityAlert, type CreateAlertInput, type AlertConfig, type AlertRule, type ChannelConfig, type MaintenanceWindow, type AlertDeliveryResult, type AlertEventCallback, AlertChannel, AlertSeverity, SecurityEventType } from './types.js';
import { SecurityAlertDetector, type DetectorSecurityEvent } from './detector.js';
export interface SecurityAlertServiceOptions {
    /** Alert configuration */
    config?: Partial<AlertConfig>;
    /** Redis instance */
    redis?: Redis;
    /** Alert detector instance */
    detector?: SecurityAlertDetector;
    /** Incident manager integration */
    incidentManager?: {
        createIncident: (alert: SecurityAlert) => Promise<string>;
        linkAlert: (alertId: string, incidentId: string) => Promise<void>;
    };
}
/**
 * Main security alerting service
 */
export declare class SecurityAlertService {
    private readonly redis;
    private readonly config;
    private readonly detector;
    private readonly eventCallbacks;
    private slackChannel?;
    private pagerDutyChannel?;
    private emailChannel?;
    private webhookChannels;
    private snsChannel?;
    private incidentManager?;
    private escalationTimers;
    constructor(options?: SecurityAlertServiceOptions);
    /**
     * Process a security event and potentially create alerts
     */
    processSecurityEvent(event: DetectorSecurityEvent): Promise<SecurityAlert[]>;
    /**
     * Create and process an alert directly
     */
    createAlert(input: CreateAlertInput): Promise<SecurityAlert | null>;
    /**
     * Send an alert to configured channels
     */
    sendAlert(alert: SecurityAlert, channelConfigs?: ChannelConfig[]): Promise<AlertDeliveryResult[]>;
    /**
     * Acknowledge an alert
     */
    acknowledgeAlert(alertId: string, acknowledgedBy: string): Promise<SecurityAlert | null>;
    /**
     * Resolve an alert
     */
    resolveAlert(alertId: string, resolutionNotes?: string): Promise<SecurityAlert | null>;
    /**
     * Get an alert by ID
     */
    getAlert(alertId: string): Promise<SecurityAlert | null>;
    /**
     * Get recent alerts
     */
    getRecentAlerts(options?: {
        limit?: number;
        severity?: AlertSeverity[];
        type?: SecurityEventType[];
        acknowledged?: boolean;
        resolved?: boolean;
    }): Promise<SecurityAlert[]>;
    /**
     * Add a maintenance window
     */
    addMaintenanceWindow(window: MaintenanceWindow): void;
    /**
     * Remove a maintenance window
     */
    removeMaintenanceWindow(windowId: string): boolean;
    /**
     * Get active maintenance windows
     */
    getActiveMaintenanceWindows(): MaintenanceWindow[];
    /**
     * Register an event callback
     */
    onEvent(callback: AlertEventCallback): void;
    /**
     * Add a custom alert rule
     */
    addRule(rule: AlertRule): void;
    /**
     * Remove a custom alert rule
     */
    removeRule(ruleId: string): boolean;
    /**
     * Test all configured channels
     */
    testChannels(): Promise<Record<AlertChannel, boolean>>;
    /**
     * Get alert statistics
     */
    getStats(periodHours?: number): Promise<{
        total: number;
        bySeverity: Record<AlertSeverity, number>;
        byType: Record<string, number>;
        acknowledged: number;
        resolved: number;
        avgResponseTimeMs?: number;
    }>;
    /**
     * Shutdown the service
     */
    shutdown(): void;
    /**
     * Initialize channel instances from config
     */
    private initializeChannels;
    /**
     * Send alert to a specific channel
     */
    private sendToChannel;
    private createFailedResult;
    /**
     * Generate fingerprint for deduplication
     */
    private generateFingerprint;
    /**
     * Check if alert is duplicate
     */
    private isDuplicate;
    /**
     * Mark fingerprint as seen
     */
    private markAsSeen;
    /**
     * Check if in maintenance window
     */
    private isInMaintenanceWindow;
    /**
     * Check if within active hours
     */
    private isWithinActiveHours;
    /**
     * Check rate limit
     */
    private isRateLimited;
    /**
     * Store alert in Redis
     */
    private storeAlert;
    /**
     * Start escalation timer for alert
     */
    private startEscalationTimer;
    /**
     * Escalate an alert to the next level
     */
    private escalateAlert;
    /**
     * Cancel escalation timer
     */
    private cancelEscalationTimer;
    /**
     * Emit an alert event
     */
    private emitEvent;
}
/**
 * Get or create the singleton SecurityAlertService instance
 */
export declare function getSecurityAlertService(options?: SecurityAlertServiceOptions): SecurityAlertService;
/**
 * Reset the singleton instance (primarily for testing)
 */
export declare function resetSecurityAlertService(): void;
/**
 * Create a new SecurityAlertService instance
 */
export declare function createSecurityAlertService(options?: SecurityAlertServiceOptions): SecurityAlertService;
//# sourceMappingURL=service.d.ts.map