/** * PII Redactor — fine-grained inline replacement of PII patterns in text. * * Phase 4 of the snapshot feature. Phase 1 redacts whole text nodes only; * this module replaces matches *inline*, preserving surrounding prose: * "Contact us at foo@bar.com for help" → "Contact us at [REDACTED] for help" * * Two entry points: * - `redactString(text)` — pure string-in/string-out, used in tests and * callable independently if a non-DOM caller ever needs it. * - `redactTextNodes(root)` — walks every text node under `root` and * replaces PII inline, skipping subtrees marked with `data-no-redact`, * and skipping `` / `
` (legitimate examples).
 *
 * Design notes:
 *   - Patterns are tuned to avoid common false positives. SSN requires
 *     dashes/spaces (so 9-digit order numbers survive); credit cards must
 *     pass a Luhn check (so 16-digit tracking IDs survive); IPs reject any
 *     octet > 255 (so version strings like 1.2.3.999 survive).
 *   - We bias toward under-redaction in ambiguous cases — better to leak
 *     a tracking number than corrupt a customer's real prose.
 */
/**
 * Replace every PII match in `text` with `[REDACTED]`. Surrounding prose
 * is preserved.
 *
 * Order matters: URLs first (so `http://...` doesn't get mangled by IPv4
 * matching), then emails, then more specific numeric patterns.
 */
export declare function redactString(text: string): string;
/**
 * Walks every text node under `root` and redacts PII inline. Skips:
 *   - text nodes inside any ancestor with `[data-no-redact]`
 *   - text nodes inside ``, `
`, `