/** * Trace anonymizer - remove sensitive data before sharing. * * Detects and replaces: * - API keys / tokens / secrets * - Email addresses * - IP addresses * - Common name patterns (optional) * - Phone numbers * - Credit card numbers * - URLs with credentials * - Custom PII patterns via config * * Supports: * - Reversible anonymization (for debugging) * - Anonymization report (what was redacted) */ export interface AnonymizeOptions { /** Replace detected names (heuristic, may have false positives). Default: true */ names?: boolean; /** Replace emails. Default: true */ emails?: boolean; /** Replace IP addresses. Default: true */ ips?: boolean; /** Replace API keys / secrets. Default: true */ secrets?: boolean; /** Replace phone numbers. Default: true */ phones?: boolean; /** Replace credit card numbers. Default: true */ creditCards?: boolean; /** Replace SSNs. Default: true */ ssns?: boolean; /** Replace street addresses. Default: true */ addresses?: boolean; /** Additional regex patterns to redact */ custom?: Array<{ pattern: string; replacement: string; name?: string; }>; /** Path to YAML config with custom patterns */ patternsFile?: string; /** Enable reversible anonymization (stores mapping). Default: false */ reversible?: boolean; /** Generate an anonymization report. Default: false */ report?: boolean; } export interface AnonymizationRedaction { type: string; original: string; replacement: string; count: number; } export interface AnonymizationReport { totalRedactions: number; byType: Record; redactions: AnonymizationRedaction[]; } export interface AnonymizationMapping { forward: Map; reverse: Map; } /** * Anonymize a string by replacing sensitive patterns. */ export declare function anonymizeString(input: string, options?: AnonymizeOptions): string; /** * Deep-anonymize a JSON-serializable object. */ export declare function anonymize(data: any, options?: AnonymizeOptions): any; /** * Anonymize a trace JSON file and return the cleaned data. */ export declare function anonymizeTrace(traceJson: any, options?: AnonymizeOptions): any; /** * Anonymize with full reporting - returns anonymized data plus a report. */ export declare function anonymizeWithReport(data: any, options?: AnonymizeOptions): { data: any; report: AnonymizationReport; }; /** * Anonymize data with reversible mapping. * Returns the anonymized data and a mapping that can be used to reverse it. */ export declare function anonymizeReversible(data: any, options?: AnonymizeOptions): { data: any; mapping: AnonymizationMapping; }; /** * Reverse anonymization using a mapping. */ export declare function deanonymize(data: any, mapping: AnonymizationMapping): any; /** * Format an anonymization report for console display. */ export declare function formatAnonymizationReport(report: AnonymizationReport): string; //# sourceMappingURL=anonymize.d.ts.map