import { DangerousContentResult, DangerousThreatType, HTMLEncodingContext, SafeHTMLResult, SanitizationOptions, SanitizedHTML, TagTransformer, ThreatDetail } from './types'; /** * Encode a string for safe insertion into HTML content * @param input - The string to encode * @returns HTML-encoded string */ export declare function encodeHTML(input: string): string; /** * Encode a string for safe insertion into an HTML attribute * More aggressive encoding than content encoding * @param input - The string to encode * @returns Attribute-safe encoded string */ export declare function encodeHTMLAttribute(input: string): string; /** * Encode a string for safe insertion into JavaScript context * @param input - The string to encode * @returns JavaScript-safe encoded string */ export declare function encodeJavaScript(input: string): string; /** * Encode a string for safe insertion into CSS context * @param input - The string to encode * @returns CSS-safe encoded string */ export declare function encodeCSS(input: string): string; /** * Encode a string for safe insertion into a URL * @param input - The string to encode * @returns URL-encoded string */ export declare function encodeURL(input: string): string; /** * Encode a string for safe use as a URL parameter * @param input - The string to encode * @returns URL parameter safe string */ export declare function encodeURLParam(input: string): string; /** * Context-aware encoding function * @param input - The string to encode * @param context - The encoding context * @returns Encoded string */ export declare function encodeForContext(input: string, context: HTMLEncodingContext): string; /** * Decode HTML entities * @param input - The string with HTML entities * @returns Decoded string */ export declare function decodeHTML(input: string): string; /** * Sanitize HTML content * Removes dangerous elements and attributes while preserving safe content * * @param input - The HTML string to sanitize * @param options - Sanitization options * @returns Safe HTML result */ export declare function sanitizeHTML(input: string, options?: SanitizationOptions): SafeHTMLResult; /** * Strip all HTML tags from a string */ export declare function stripTags(input: string): string; /** * Detect dangerous content in input * @param input - The content to analyze * @returns Detection result with threat details */ export declare function detectDangerousContent(input: string): DangerousContentResult; /** * Check if content contains any dangerous patterns * Fast check without detailed analysis */ export declare function isDangerous(input: string): boolean; /** * Create safe props for setting HTML content in React * @param content - The HTML content * @param options - Sanitization options * @returns Props object for React element */ export declare function createSafeHTMLProps(content: string, options?: SanitizationOptions): { dangerouslySetInnerHTML: { __html: string; }; }; /** * Create a text-only version (no HTML) * @param content - The HTML content * @returns Plain text props */ export declare function createTextOnlyProps(content: string): { children: string; }; /** * Validate that a string is safe for the given context */ export declare function isContextSafe(input: string, context: HTMLEncodingContext): boolean; /** * Validate an email address format */ export declare function isValidEmail(email: string): boolean; /** * Validate a URL format */ export declare function isValidURL(url: string): boolean; /** * Create a safe ref callback that validates innerHTML */ export declare function createSafeInnerHTMLRef(html: string, options?: SanitizationOptions): (element: HTMLElement | null) => void; /** * Type guard for sanitized HTML */ export declare function isSanitizedHTML(value: unknown): value is SanitizedHTML; /** * Assert that a string is sanitized HTML * @throws Error if content is dangerous */ export declare function assertSanitizedHTML(content: string): SanitizedHTML; export type { HTMLEncodingContext, SanitizationOptions, DangerousContentResult, DangerousThreatType, ThreatDetail, SafeHTMLResult, SanitizedHTML, TagTransformer, };