ai-debug-local-mcp
Version:
🎯 ENHANCED AI GUIDANCE v4.1.2: Dramatically improved tool descriptions help AI users choose the right tools instead of 'close enough' options. Ultra-fast keyboard automation (10x speed), universal recording, multi-ecosystem debugging support, and compreh
78 lines • 2.64 kB
TypeScript
export declare class MemorySafeActions {
private static maxListeners;
private static initialized;
private static cleanupInterval;
private static trackedAbortControllers;
private static trackedEventListeners;
/**
* Initialize memory-safe event handling
* Prevents "MaxListenersExceededWarning" by increasing limits
*/
static initialize(): void;
/**
* Perform memory-safe page action with automatic cleanup
*/
static safePageAction(page: any, actionFn: () => Promise<any>): Promise<any>;
/**
* Validate CSS selector before use
*/
static validateSelector(selector: string): string;
/**
* Memory-safe click action
*/
static safeClick(page: any, selector: string): Promise<void>;
/**
* Memory-safe type action
*/
static safeType(page: any, selector: string, value: string): Promise<void>;
/**
* Memory-safe submit action
*/
static safeSubmit(page: any, selector: string): Promise<void>;
/**
* Memory-safe scroll action
*/
static safeScroll(page: any, selector: string): Promise<void>;
/**
* Memory-safe hover action
*/
static safeHover(page: any, selector: string): Promise<void>;
/**
* Setup global AbortController cleanup to prevent memory leaks
*/
private static setupGlobalAbortControllerCleanup;
/**
* Force cleanup of event listeners to prevent memory leaks
* PROFESSIONAL UX: Proper event listener cleanup for enterprise-grade stability
*/
private static cleanupEventListeners;
/**
* Register a page event listener for tracked cleanup
* PROFESSIONAL UX: Prevents Playwright page event listener memory leaks
*/
static trackPageEventListener(page: any, event: string, handler: Function): void;
/**
* Manually remove a tracked event listener
* PROFESSIONAL UX: Allow explicit cleanup of specific listeners
*/
static removeTrackedEventListener(page: any, event: string, handler: Function): void;
/**
* Force immediate cleanup of all tracked resources
* PROFESSIONAL UX: Call this method for enterprise-grade memory management
*/
static forceCleanup(): void;
/**
* Get current memory usage for monitoring
*/
static getMemoryUsage(): any;
/**
* Cleanup all resources and intervals to prevent memory leaks
* MEMORY LEAK FIX: Properly dispose of cleanup interval
*/
static cleanup(): void;
/**
* Reset memory-safe actions (for testing)
*/
static reset(): void;
}
//# sourceMappingURL=memory-safe-actions.d.ts.map