/** * @module @arcis/node/sanitizers/encode * Context-aware output encoding for XSS prevention. * * Wrong-context encoding is the #1 cause of XSS bypasses in "protected" apps. * A single sanitize() is not enough when output goes to JS, CSS, or attribute contexts. */ /** * Encodes for HTML body context. Entity-encodes & < > " ' * * Use when outputting to HTML element content: * `

${encodeForHtml(userInput)}

` */ export declare function encodeForHtml(value: string): string; /** * Encodes for HTML attribute context. * All non-alphanumeric characters are encoded as `&#xHH;` hex entities. * * Use when outputting to HTML attributes: * `
` */ export declare function encodeForAttribute(value: string): string; /** * Encodes for JavaScript string context. * Non-alphanumeric characters are escaped as `\xHH` (ASCII) or `\uHHHH` (Unicode). * * Use when embedding in JS string literals: * `var x = '${encodeForJs(userInput)}';` */ export declare function encodeForJs(value: string): string; /** * Encodes for URL parameter context. Percent-encodes all non-unreserved chars. * * Use when building query strings: * `?q=${encodeForUrl(userInput)}` */ export declare function encodeForUrl(value: string): string; /** * Encodes for CSS value context. * Non-alphanumeric characters are hex-escaped as `\HH ` (trailing space per CSS spec). * * Use when embedding in CSS values: * `content: '${encodeForCss(userInput)}';` */ export declare function encodeForCss(value: string): string; //# sourceMappingURL=encode.d.ts.map