UNPKG

@bugspotter/sdk

Version:

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

35 lines (34 loc) 1.08 kB
import type { Sanitizer } from '../utils/sanitize'; import type { CaptureLifecycle } from './capture-lifecycle'; /** * Base options for all capture implementations */ export interface CaptureOptions { sanitizer?: Sanitizer; } /** * Base class for all capture implementations * Provides common functionality like error handling and sanitization */ export declare abstract class BaseCapture<TResult, TOptions extends CaptureOptions = CaptureOptions> implements CaptureLifecycle { protected readonly sanitizer?: Sanitizer; protected readonly options: TOptions; constructor(options: TOptions); /** * Log an error that occurred during capture */ protected handleError(context: string, error: unknown): void; /** * Perform the capture operation * Subclasses must implement this method */ abstract capture(...args: unknown[]): TResult; /** * Clear captured data (optional, implement if needed) */ clear?(): void; /** * Clean up resources (optional, implement if needed) */ destroy?(): void; }