/** * @module @arcis/node/sanitizers/xss * XSS (Cross-Site Scripting) prevention */ import type { SanitizeResult } from '../core/types'; /** * Sanitizes a string to prevent XSS attacks. * * Strategy: * 1. Remove dangerous patterns (script tags, event handlers, etc.) * 2. HTML-encode the remaining content * * @param input - The string to sanitize * @param collectThreats - Whether to collect threat information (default: false for performance) * @returns Sanitized string or SanitizeResult if collectThreats is true * * @example * sanitizeXss("") * // Returns: "<script>alert('xss')</script>" * * @example * sanitizeXss("") * // Returns: "<img>" (event handler removed) */ export declare function sanitizeXss(input: string, collectThreats?: false, htmlEncode?: boolean): string; export declare function sanitizeXss(input: string, collectThreats: true, htmlEncode?: boolean): SanitizeResult; /** * Checks if a string contains potential XSS patterns. * Does not sanitize — use sanitizeXss() for that. * * @param input - The string to check * @returns True if XSS patterns detected */ export declare function detectXss(input: string): boolean; //# sourceMappingURL=xss.d.ts.map