/**
 * Data Redaction Engine
 *
 * Automatically detects and masks sensitive data in outputs:
 * - API keys and tokens
 * - Passwords and secrets
 * - Private keys and certificates
 * - Environment variables with sensitive values
 * - Credit card numbers, SSNs, etc.
 *
 * Inspired by VibeKit's auto-redaction feature.
 */
import { EventEmitter } from 'events';
export interface RedactionPattern {
    name: string;
    pattern: RegExp;
    replacement: string;
    category: RedactionCategory;
    severity: 'critical' | 'high' | 'medium' | 'low';
}
export type RedactionCategory = 'api_key' | 'token' | 'password' | 'private_key' | 'certificate' | 'env_var' | 'pii' | 'financial' | 'connection_string' | 'custom';
export interface RedactionResult {
    original: string;
    redacted: string;
    redactions: RedactionMatch[];
    stats: RedactionStats;
}
export interface RedactionMatch {
    pattern: string;
    category: RedactionCategory;
    severity: string;
    position: {
        start: number;
        end: number;
    };
    preview: string;
}
export interface RedactionStats {
    totalRedactions: number;
    byCategory: Record<RedactionCategory, number>;
    bySeverity: Record<string, number>;
}
export interface RedactionConfig {
    enabled: boolean;
    patterns: RedactionPattern[];
    customPatterns: RedactionPattern[];
    whitelist: string[];
    entropyThreshold: number;
    minSecretLength: number;
    maxSecretLength: number;
    logRedactions: boolean;
    preserveFormat: boolean;
}
export declare class DataRedactionEngine extends EventEmitter {
    private config;
    private redactionLog;
    constructor(config?: Partial<RedactionConfig>);
    /**
     * Redact sensitive data from text
     */
    redact(text: string): RedactionResult;
    /**
     * Redact an object recursively
     */
    redactObject<T extends object>(obj: T): T;
    /**
     * Check if a string is in the whitelist
     */
    private isWhitelisted;
    /**
     * Check if a key name suggests it contains secrets
     */
    private isSecretKey;
    /**
     * Create a preview of matched text (first/last chars)
     */
    private createPreview;
    /**
     * Calculate Shannon entropy of a string
     */
    private calculateEntropy;
    /**
     * Redact high-entropy strings that might be secrets
     */
    private redactHighEntropyStrings;
    /**
     * Calculate redaction statistics
     */
    private calculateStats;
    /**
     * Create empty stats object
     */
    private createEmptyStats;
    /**
     * Add a custom redaction pattern
     */
    addPattern(pattern: RedactionPattern): void;
    /**
     * Add to whitelist
     */
    addToWhitelist(value: string): void;
    /**
     * Get redaction log
     */
    getRedactionLog(): RedactionMatch[];
    /**
     * Clear redaction log
     */
    clearLog(): void;
    /**
     * Enable/disable redaction
     */
    setEnabled(enabled: boolean): void;
    /**
     * Check if enabled
     */
    isEnabled(): boolean;
    /**
     * Get configuration
     */
    getConfig(): RedactionConfig;
    /**
     * Generate a hash for a secret (for logging without exposing)
     */
    hashSecret(secret: string): string;
    /**
     * Dispose
     */
    dispose(): void;
}
export declare function getDataRedactionEngine(config?: Partial<RedactionConfig>): DataRedactionEngine;
export declare function resetDataRedactionEngine(): void;
/**
 * Quick redact function for simple use cases
 */
export declare function redactSecrets(text: string): string;
/**
 * Check if text contains potential secrets
 */
export declare function containsSecrets(text: string): boolean;
