UNPKG

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

112 lines • 2.82 kB
/** * Universal Screenshot Fix * * Addresses the 1x1 pixel screenshot issue across all frameworks by: * 1. Ensuring proper viewport size * 2. Waiting for content to load * 3. Validating screenshot size * 4. Framework-specific wait logic */ import { Page } from 'playwright'; export interface ScreenshotOptions { fullPage?: boolean; selector?: string; timeout?: number; annotations?: Array<{ type: 'arrow' | 'highlight' | 'text'; x?: number; y?: number; text?: string; selector?: string; }>; } export interface ScreenshotResult { data: string; width: number; height: number; format: string; debugInfo?: any; } export declare class UniversalScreenshotFix { private static readonly MIN_VIEWPORT_WIDTH; private static readonly MIN_VIEWPORT_HEIGHT; private static readonly MIN_SCREENSHOT_SIZE; private static readonly MAX_RETRIES; /** * Take a screenshot with universal fixes for all frameworks */ static takeScreenshot(page: Page, options?: ScreenshotOptions): Promise<ScreenshotResult>; /** * Ensure viewport has minimum size to avoid 1x1 issue */ private static ensureViewportSize; /** * Detect the framework being used */ private static detectFramework; /** * Apply framework-specific wait logic */ private static waitForFramework; /** * Phoenix LiveView specific wait */ private static waitForPhoenixLiveView; /** * React specific wait */ private static waitForReact; /** * Vue specific wait */ private static waitForVue; /** * Angular specific wait */ private static waitForAngular; /** * Flutter specific wait */ private static waitForFlutter; /** * Generic wait for any framework */ private static waitForGeneric; /** * Ensure content is loaded and visible */ private static ensureContentLoaded; /** * Capture screenshot with retry logic */ private static captureWithRetry; /** * Apply visual annotations to the page */ private static applyAnnotations; /** * Remove annotations after screenshot */ private static removeAnnotations; /** * Validate screenshot and create result */ private static validateAndReturn; /** * Create diagnostic screenshot when capture fails */ private static createDiagnosticScreenshot; } declare global { interface Window { liveSocket?: any; React?: any; Vue?: any; ng?: any; getAllAngularTestabilities?: () => any[]; flutter?: any; Livewire?: any; __NEXT_DATA__?: any; } } //# sourceMappingURL=universal-screenshot-fix.d.ts.map