import { type Language } from './registry.js'; /** A single segment of the analysed text. */ export interface TextSegment { /** The content of the segment. */ text: string; /** True if this segment should be blacked out. */ isProfane: boolean; } export interface FilterOptions { /** * Which registered languages to match against. Defaults to `['en']`. * * Pass `['en', 'de']` for mixed-language text, a BCP-47 tag like `'de-AT'` * (which falls back to `'de'` when the variant is not registered), or the * literal `'*'` to use every registered language. */ languages?: readonly Language[] | '*'; /** * Replaces the built-in profanity patterns entirely. Entries are regex * source strings. An empty array falls back to the built-in lists. */ customList?: readonly string[]; /** * Extra words that must never be flagged, added on top of the built-in * allowlist. Entries are regex sources matched against the **whole * surrounding word**, so `klass\p{L}*` clears `Klassik` and `klassisch`. */ allowList?: readonly string[]; /** * Check every hit against the allowlist before flagging it. Defaults to * `true`. Set to `false` for raw substring matching — useful for auditing * what the allowlist is actually suppressing. */ crossCheck?: boolean; /** * Also match common letter substitutions (`a` -> `@`/`4`, `i` -> `!`/`1`, * `c` -> `(`/`k`/`<`, ...). Defaults to `true`. */ aggressive?: boolean; } /** * Filters text and returns an array of segments for UI rendering. * * Matching is substring-based, so `ass` also fires inside `Klassik`. The * allowlist is the counterweight: a match is dropped when the word around it * is allowed. An allowed word always wins over a blocked pattern. * * @param text - The input string. * @param options - Languages, custom patterns, allowlist additions, aggressive matching. * @returns An array of TextSegment objects covering the full input text. */ export declare function filterFWordsToSegments(text: string, options?: FilterOptions): TextSegment[]; //# sourceMappingURL=filter.d.ts.map