/** * Verlux — Intelligent multilingual profanity detection. * * @example * ```ts * import { verlux } from 'verlux'; * * const results = verlux.detect('some text here'); * console.log(results); * * const isClean = verlux.isClean('hello world'); * console.log(isClean); // true * * const censored = verlux.censor('what the fuck'); * console.log(censored); // "what the ****" * ``` */ import type { VerluxConfig, DetectionResult, Severity, DictionaryEntry, PhraseEntry, ToxicityScore } from './types.js'; export type { VerluxConfig, DetectionResult, DictionaryEntry, PhraseEntry, Severity, ToxicityScore, }; export type { Category } from './types.js'; /** * Create a Verlux instance. Can be used with default or custom config. */ declare function createInstance(defaultConfig?: VerluxConfig): { /** * Detect all profane words/phrases in the input text. * Returns an array of detection results with position, severity, category, etc. */ detect(text: string, config?: VerluxConfig): DetectionResult[]; /** * Check if text contains any profanity. * Returns true if the text is clean (no profanity detected). */ isClean(text: string, config?: VerluxConfig): boolean; /** * Censor profane words in the text, replacing them with a mask character. */ censor(text: string, config?: VerluxConfig & { mask?: string; }): string; /** * Get list of available language codes. */ languages(): string[]; /** * Create a new instance with a different default configuration. */ configure(config: VerluxConfig): /*elided*/ any; /** * Add custom words to the dictionary at runtime. * Throws TypeError if any entry is malformed. */ addWords(entries: DictionaryEntry[]): void; /** * Add custom phrases to the dictionary at runtime. * Throws TypeError if any entry is malformed. */ addPhrases(entries: PhraseEntry[]): void; /** * Get a toxicity score for the text. * Returns a 0-1 score with category breakdown, repetition detection, and all matches. */ score(text: string, config?: VerluxConfig): ToxicityScore; }; /** Default Verlux instance — ready to use out of the box */ export declare const verlux: { /** * Detect all profane words/phrases in the input text. * Returns an array of detection results with position, severity, category, etc. */ detect(text: string, config?: VerluxConfig): DetectionResult[]; /** * Check if text contains any profanity. * Returns true if the text is clean (no profanity detected). */ isClean(text: string, config?: VerluxConfig): boolean; /** * Censor profane words in the text, replacing them with a mask character. */ censor(text: string, config?: VerluxConfig & { mask?: string; }): string; /** * Get list of available language codes. */ languages(): string[]; /** * Create a new instance with a different default configuration. */ configure(config: VerluxConfig): /*elided*/ any; /** * Add custom words to the dictionary at runtime. * Throws TypeError if any entry is malformed. */ addWords(entries: DictionaryEntry[]): void; /** * Add custom phrases to the dictionary at runtime. * Throws TypeError if any entry is malformed. */ addPhrases(entries: PhraseEntry[]): void; /** * Get a toxicity score for the text. * Returns a 0-1 score with category breakdown, repetition detection, and all matches. */ score(text: string, config?: VerluxConfig): ToxicityScore; }; /** Named export for creating custom instances */ export { createInstance }; /** Default export */ export default verlux;