/**
 * Rate Limiting - レート制限機能
 */
/**
 * レート制限の設定
 */
interface RateLimitConfig {
    windowMs: number;
    maxRequests: number;
    skipSuccessfulRequests?: boolean;
    skipFailedRequests?: boolean;
    keyGenerator?: (req: any) => string;
    onLimitReached?: (req: any, res: any) => void;
}
/**
 * レート制限マネージャー
 */
export declare class RateLimitManager {
    private static instance;
    private limitMap;
    private config;
    private cleanupInterval;
    private constructor();
    /**
     * シングルトンインスタンスを取得
     */
    static getInstance(config?: Partial<RateLimitConfig>): RateLimitManager;
    /**
     * レート制限チェック
     */
    checkLimit(key: string): {
        allowed: boolean;
        remaining: number;
        resetTime: number;
    };
    /**
     * Express.js ミドルウェアを作成
     */
    static createMiddleware(options?: Partial<RateLimitConfig>): (req: any, res: any, next: any) => void;
    /**
     * 指定されたキーの制限をリセット
     */
    resetLimit(key: string): void;
    /**
     * 全ての制限をリセット
     */
    resetAllLimits(): void;
    /**
     * 統計情報を取得
     */
    getStatistics(): {
        totalKeys: number;
        activeKeys: number;
        entries: {
            key: string;
            count: number;
            remaining: number;
        }[];
    };
    /**
     * 期限切れエントリのクリーンアップタイマーを開始
     */
    private startCleanupTimer;
    /**
     * 期限切れエントリをクリーンアップ
     */
    private cleanupExpiredEntries;
    /**
     * クリーンアップタイマーを停止
     */
    stopCleanupTimer(): void;
}
/**
 * スロー制限機能（段階的な制限）
 */
export declare class SlowDownManager {
    private config;
    private static instance;
    private requestMap;
    private delayMap;
    private constructor();
    /**
     * シングルトンインスタンスを取得
     */
    static getInstance(config?: {
        windowMs?: number;
        delayAfter?: number;
        delayMs?: number;
        maxDelayMs?: number;
    }): SlowDownManager;
    /**
     * 遅延時間を計算
     */
    calculateDelay(key: string): number;
    /**
     * Express.js ミドルウェアを作成
     */
    static createMiddleware(options?: {
        windowMs?: number;
        delayAfter?: number;
        delayMs?: number;
        maxDelayMs?: number;
        keyGenerator?: (req: any) => string;
    }): (req: any, res: any, next: any) => void;
}
/**
 * 複数のレート制限戦略を組み合わせたミドルウェア
 */
export declare class CompositeRateLimitManager {
    /**
     * 複数のレート制限を組み合わせたミドルウェアを作成
     */
    static createMiddleware(options: {
        global?: RateLimitConfig;
        perUser?: RateLimitConfig;
        perEndpoint?: RateLimitConfig;
        slowDown?: {
            windowMs?: number;
            delayAfter?: number;
            delayMs?: number;
            maxDelayMs?: number;
        };
    }): (req: any, res: any, next: any) => void;
}
/**
 * 特定のIPアドレスをブロックするミドルウェア
 */
export declare class IPBlockManager {
    private static blockedIPs;
    private static suspiciousIPs;
    /**
     * IPアドレスをブロック
     */
    static blockIP(ip: string): void;
    /**
     * IPアドレスのブロックを解除
     */
    static unblockIP(ip: string): void;
    /**
     * 疑わしいIPアドレスを追跡
     */
    static trackSuspiciousIP(ip: string): void;
    /**
     * IPブロックミドルウェアを作成
     */
    static createMiddleware(): (req: any, res: any, next: any) => void;
    /**
     * ブロック中のIPアドレス一覧を取得
     */
    static getBlockedIPs(): string[];
    /**
     * 疑わしいIPアドレスの統計を取得
     */
    static getSuspiciousIPs(): {
        ip: string;
        count: number;
        firstSeen: Date;
    }[];
}
export {};
//# sourceMappingURL=rate-limit.d.ts.map