export type MaskClass = 'credential' | 'personal'; export interface Span { start: number; end: number; kind: string; cls: MaskClass; label: string; } /** Personal-data kinds WARDEN finds by pattern. Operator terms and patterns add kinds of their own. */ export declare const PERSONAL_KINDS: readonly ['EMAIL', 'PHONE', 'CARD', 'IBAN', 'IP', 'SSN', 'SNILS', 'INN']; export type PersonalKind = typeof PERSONAL_KINDS[number]; /** Jurisdiction profiles: which kinds are on. A profile picks detectors; it does not make processing lawful by itself. */ export declare const PROFILES: Record; }>; /** Crockford base32: no I, L, O, U, so an id survives being read aloud or retyped. */ export declare const ID_ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"; export declare const ID_LENGTH = 10; export declare const KIND_RE: RegExp; /** * `WARDEN__` everywhere, and `warden_email_@mask.invalid` for e-mail addresses, so a field that must hold * an address (JSON Schema `format: email`) still does. ASCII letters, digits and `_` only: valid inside a URL, a JSON * string, Markdown and a shell word, so the model can copy it anywhere unchanged. `.invalid` is reserved (RFC 2606): * mail to it never leaves the machine. */ export declare const PLACEHOLDER_RE: RegExp; /** The same, also matching `%40` for the `@` of an e-mail placeholder inside a URL-encoded query or path. */ export declare const PLACEHOLDER_ANY_RE: RegExp; export declare function placeholderFor(kind: string, id: string): string; export interface PlaceholderSpan { start: number; end: number; kind: string; id: string; } export declare function placeholderSpans(text: string): PlaceholderSpan[]; /** Would a value assigned to a credential-named field be the credential itself? */ export declare function credentialValue(name: string, value: string): boolean; /** * Credential spans in one string. `knownValues`: exact values to mask wherever they occur. `fieldName`: the JSON key * the string is the value of, so `{"password": "hunter22"}` is masked whole. */ export declare function credentialSpans(text: string, knownValues?: readonly string[], fieldName?: string): Span[]; export declare function luhn(digits: string): boolean; /** Issuer prefixes (ISO/IEC 7812 IIN ranges of the networks in use) and their lengths. */ export declare function cardNetwork(d: string): boolean; export declare function ibanValid(raw: string): boolean; /** Addresses that identify no one outside the machine or network: loopback, private, link-local, documentation. */ export declare function publicIp(ip: string, includePrivate: boolean): boolean; export declare function snilsValid(raw: string): boolean; export declare function inn12Valid(d: string): boolean; export interface PersonalOptions { kinds: readonly string[]; phoneNational: ReadonlyArray<'us' | 'ru'>; /** Mask private and CGNAT addresses too (10/8, 172.16/12, 192.168/16, 100.64/10, fc00::/7). */ privateIps: boolean; /** Operator's terms (names, customer ids) and patterns, each with its kind. */ terms: ReadonlyArray<{ kind: string; re: RegExp; }>; /** Values never masked: exact values, or `@domain` for every address at that domain. Lower case. */ keep: readonly string[]; } export declare function personalSpans(text: string, o: PersonalOptions): Span[]; /** * Non-overlapping spans: a credential wins over personal data where they overlap (the password in * `smtp://ann%40example.org:pw@host` is masked as a credential), then the earlier and longer span. Spans that touch an * existing placeholder are dropped, so masking twice changes nothing. */ export declare function resolveSpans(text: string, spans: Span[]): Span[]; //# sourceMappingURL=mask-detect.d.ts.map