UNPKG

@bugspotter/sdk

Version:

Professional bug reporting SDK with screenshots, session replay, and automatic error capture for web applications

63 lines (62 loc) 1.53 kB
export interface BugReportData { title: string; description: string; } export interface PIIDetection { type: string; count: number; } export interface BugReportModalOptions { onSubmit: (data: BugReportData) => void | Promise<void>; onClose?: () => void; } /** * BugReportModal * * Refactored to follow SOLID principles * Acts as a lightweight coordinator for specialized components */ export declare class BugReportModal { private container; private shadow; private options; private styleManager; private templateManager; private domCache; private validator; private piiDisplay; private redactionCanvas; private screenshotProcessor; private originalScreenshot; private piiDetections; private handleEscapeKey; constructor(options: BugReportModalOptions); /** * Show the modal with optional screenshot */ show(screenshotDataUrl?: string): void; /** * Close and cleanup the modal */ close(): void; /** * Destroy the modal (alias for close) */ destroy(): void; private setupRedactionCanvas; private attachEventListeners; private validateField; private checkForPII; private updateSubmitButton; private toggleRedactionMode; private clearRedactions; private handleSubmit; /** * Get the final screenshot (with redactions applied) */ getScreenshot(): string; /** * Handle Escape key press to close modal */ private onEscapeKey; }