@agentman/chat-widget
Version:
Agentman Chat Widget for easy integration with web applications
39 lines (38 loc) • 1.01 kB
TypeScript
export interface SanitizerReport {
originalSize: number;
sanitizedSize: number;
removedElements: Array<{
tag: string;
reason: string;
}>;
removedAttributes: Array<{
element: string;
attribute: string;
value: string;
reason: string;
}>;
suspiciousPatterns: Array<{
pattern: string;
matches: string[];
}>;
success: boolean;
errors: string[];
}
export declare class SvgSanitizer {
private static readonly ALLOWED_ELEMENTS;
private static readonly ALLOWED_ATTRIBUTES;
private static readonly SUSPICIOUS_PATTERNS;
sanitize(svg: string): {
sanitized: string;
report: SanitizerReport;
};
private sanitizeNode;
private isUnsafeAttributeValue;
private checkSuspiciousPatterns;
}
export declare class MessageRenderer {
private svgSanitizer;
private reportCallback?;
constructor(reportCallback?: (report: SanitizerReport) => void);
private renderSvg;
}