/**
 * AuditIntegrity -- Tamper-evident audit logs with hash chaining.
 *
 * Each log entry includes a SHA-256 hash of itself + the previous entry's hash,
 * creating an immutable chain. Any modification or deletion is detectable.
 *
 * Required by:
 *   - SOC 2 CC7.2: Monitoring of system components
 *   - HIPAA 164.312(b): Audit controls
 *   - PCI DSS Req 10: Track and monitor access
 *   - ISO 27001 8.15: Logging
 *
 * Format per line (JSONL):
 *   { ...entry, _seq: N, _prevHash: "abc...", _hash: "def..." }
 *
 * @connexum/ai-governance
 */
export interface AuditIntegrityConfig {
    /** Directory for tamper-evident logs */
    logDir: string;
    /** Log file prefix (default: 'audit-chain') */
    prefix?: string;
    /** Maximum entries per file before rotation (default: 10000) */
    maxEntriesPerFile?: number;
}
export interface ChainedEntry {
    /** The actual log data */
    data: Record<string, unknown>;
    /** Sequence number within this file */
    _seq: number;
    /** SHA-256 hash of the previous entry (empty string for first entry) */
    _prevHash: string;
    /** SHA-256 hash of this entry (data + _seq + _prevHash) */
    _hash: string;
}
export interface ChainVerification {
    valid: boolean;
    totalEntries: number;
    /** First broken entry index (-1 if all valid) */
    brokenAt: number;
    /** Files verified */
    files: string[];
    errors: string[];
}
export declare class AuditIntegrity {
    private config;
    private currentFile;
    private currentSeq;
    private lastHash;
    constructor(config: AuditIntegrityConfig);
    /**
     * Append a tamper-evident entry to the audit log.
     */
    append(data: Record<string, unknown>): ChainedEntry;
    /**
     * Verify the integrity of all audit log files.
     * Checks that every entry's hash matches its content + previous hash.
     */
    verify(): ChainVerification;
    /**
     * Read all entries from all log files.
     */
    readAll(): ChainedEntry[];
    /**
     * Read entries from the most recent N entries.
     */
    readRecent(limit?: number): ChainedEntry[];
    /**
     * Get the current log file path.
     */
    getLogFile(): string;
    /**
     * Get statistics about the audit chain.
     */
    getStats(): {
        files: number;
        totalEntries: number;
        currentSeq: number;
        lastHash: string;
    };
    private computeEntryHash;
    private getCurrentLogFile;
    private rotate;
    private initializeFromExisting;
    private listLogFiles;
    private readLines;
}
//# sourceMappingURL=audit-integrity.d.ts.map