/**
 * DataSubjectRights -- GDPR Articles 15-22 compliance.
 *
 * Implements data subject rights required by GDPR:
 *   - Art. 15: Right of access (SAR export)
 *   - Art. 16: Right to rectification
 *   - Art. 17: Right to erasure ("right to be forgotten")
 *   - Art. 20: Right to data portability (JSON/CSV export)
 *   - Art. 21: Right to object to processing
 *
 * All requests are logged with an immutable audit trail.
 *
 * @connexum/ai-governance
 */
import type { PackEnforcementAuditEvent } from '../classification/pack-driven-classifier';
export type DSRType = 'ACCESS' | 'RECTIFICATION' | 'ERASURE' | 'PORTABILITY' | 'OBJECTION';
export type DSRStatus = 'RECEIVED' | 'PROCESSING' | 'COMPLETED' | 'DENIED' | 'EXPIRED';
export type ExportFormat = 'json' | 'csv';
export interface DataSubjectRightsConfig {
    /** Directory for DSR data and logs */
    dataDir: string;
    /** Maximum response time in ms (GDPR: 30 days = 2592000000) */
    responseDeadlineMs?: number;
    /** Directories to scan for personal data */
    scanDirs?: string[];
    /** File patterns to include in scans (glob-like) */
    filePatterns?: string[];
    /** Organization name for response documents */
    organizationName?: string;
}
export interface DSRRequest {
    id: string;
    type: DSRType;
    subjectId: string;
    subjectEmail?: string;
    details: string;
    status: DSRStatus;
    createdAt: string;
    deadline: string;
    completedAt?: string;
    result?: DSRResult;
}
export interface DSRResult {
    /** Files containing subject data */
    filesFound: string[];
    /** Number of records found */
    recordCount: number;
    /** Actions taken */
    actions: DSRAction[];
    /** Export file path (for ACCESS/PORTABILITY) */
    exportPath?: string;
}
export interface DSRAction {
    action: string;
    file: string;
    details: string;
    timestamp: string;
}
export interface DataInventoryEntry {
    file: string;
    subjectId: string;
    dataTypes: string[];
    lineNumbers: number[];
}
export declare class DataSubjectRights {
    private config;
    private requestsFile;
    private auditFile;
    /**
     * P3.5: Optional callback / source function for canonical audit events.
     * When set, findSubjectData() also queries the pack-driven audit chain
     * for events where dataSubjectId matches the pseudonymized subject ID.
     * This enables a single "show me everything about subject X" query that
     * spans both DSR records and the five-dimensional disclosure audit trail.
     *
     * Usage:
     *   dsr.setAuditEventSource(() => classifier.peekAuditEvents());
     */
    private auditEventSource;
    constructor(config: DataSubjectRightsConfig);
    /**
     * P3.5: Register a source function for canonical pack-driven audit events.
     * When set, findSubjectData() also queries these events for the subject's
     * data, providing a unified audit trail across DSR records and disclosure
     * accounting events.
     *
     * @param source Function returning the current audit event array.
     *               Typically: () => classifier.peekAuditEvents()
     *               or a persistence adapter query.
     */
    setAuditEventSource(source: () => readonly PackEnforcementAuditEvent[]): void;
    /**
     * Submit a new data subject rights request.
     */
    submit(type: DSRType, subjectId: string, details: string, subjectEmail?: string): DSRRequest;
    /**
     * Process a Subject Access Request (Art. 15) -- find all data for subject.
     */
    processAccessRequest(requestId: string): DSRResult;
    /**
     * Process an erasure request (Art. 17) -- redact subject data from files.
     */
    processErasureRequest(requestId: string): DSRResult;
    /**
     * Deny a request with reason.
     */
    deny(requestId: string, reason: string): void;
    /**
     * Get a specific request.
     */
    getRequest(requestId: string): DSRRequest | undefined;
    /**
     * Get all pending (non-completed) requests.
     */
    getPending(): DSRRequest[];
    /**
     * Get requests approaching deadline (within 7 days).
     */
    getApproachingDeadline(): DSRRequest[];
    /**
     * Get breached deadline requests.
     */
    getBreachedDeadlines(): DSRRequest[];
    /**
     * Get DSR statistics.
     */
    getStats(): {
        total: number;
        byType: Record<DSRType, number>;
        byStatus: Record<DSRStatus, number>;
        breachedDeadlines: number;
        avgCompletionMs: number;
    };
    /**
     * P3.5: DSR + canonical audit chain join.
     *
     * Scans two sources for the data subject's records:
     *   1. Configured scanDirs (file-based DSR records, existing behavior).
     *   2. Canonical pack-driven audit events (P3.5 disclosure accounting).
     *      Matches on event.dataSubjectId === subjectId (pseudonymized hash).
     *
     * The combined result satisfies "show me everything pertaining to subject X"
     * across packs and DSR channels, as required by HIPAA §164.528 and FERPA §99.32.
     */
    private findSubjectData;
    private getFilesRecursive;
    private redactSubjectFields;
    private escapeRegex;
    private loadRequests;
    private saveRequests;
    private updateStatus;
    private completeRequest;
    private audit;
}
//# sourceMappingURL=data-subject-rights.d.ts.map