import { OnModuleInit, OnModuleDestroy } from '@nestjs/common';
import { PrismaService } from "../../../database/prisma/prisma.service";
import { LogAlertType, LogAlertSeverity } from '@prisma/client';
export interface AlertServiceConfig {
    slowRequest: {
        enabled: boolean;
        thresholdMs: number;
        excludePaths: string[];
    };
    errorRate: {
        enabled: boolean;
        thresholdPercent: number;
        windowMinutes: number;
        minRequests: number;
    };
    ipAnomaly: {
        enabled: boolean;
        maxRequestsPerMinute: number;
        blockDurationMinutes: number;
    };
    diskSpace: {
        enabled: boolean;
        warningPercent: number;
        criticalPercent: number;
        logDir: string;
    };
    notifications: {
        slack?: {
            enabled: boolean;
            webhookUrl?: string;
        };
        feishu?: {
            enabled: boolean;
            webhookUrl?: string;
        };
        email?: {
            enabled: boolean;
            recipients?: string[];
        };
    };
}
export interface AlertContext {
    type: LogAlertType;
    severity: LogAlertSeverity;
    message: string;
    details: Record<string, any>;
    traceId?: string;
}
export declare class AlertService implements OnModuleInit, OnModuleDestroy {
    private readonly prisma;
    private config;
    private statsWindow;
    private checkInterval;
    private alertCooldown;
    private readonly ALERT_COOLDOWN_MS;
    constructor(prisma: PrismaService);
    onModuleInit(): void;
    onModuleDestroy(): void;
    recordRequest(context: {
        duration: number;
        statusCode: number;
        path: string;
        ip: string;
        traceId?: string;
    }): void;
    private checkAlerts;
    private checkErrorRate;
    private checkIpAnomaly;
    private checkDiskSpace;
    private triggerSlowRequestAlert;
    private triggerAlert;
    private sendNotifications;
    private buildNotificationContent;
    private sendSlackNotification;
    private sendFeishuNotification;
    private getEnabledChannels;
    private resetStatsWindow;
    getConfig(): AlertServiceConfig;
    updateConfig(config: Partial<AlertServiceConfig>): void;
    getStats(): {
        windowStartTime: string;
        totalRequests: number;
        errorCount: number;
        slowCount: number;
        errorRate: number;
        topIps: {
            ip: string;
            count: number;
        }[];
    };
}
