/** * REPL Debug Handler * * P1 - Interactive debugging mode for test development * * Supports: * - Interactive JavaScript REPL in browser context * - Page inspection commands * - Selector testing * - Step-by-step test execution * - State inspection and modification * - Screenshot capture on demand * * @see https://playwright.dev/docs/debug */ export interface REPLConfig { /** Enable color output */ color?: boolean; /** Show help on start */ showHelp?: boolean; /** Custom command prompt */ prompt?: string; /** History file path */ historyFile?: string; /** Maximum history entries */ maxHistory?: number; } export interface REPLCommand { /** Command name */ name: string; /** Aliases */ aliases?: string[]; /** Description */ description: string; /** Usage example */ usage: string; /** Handler function */ handler: (args: string[], context: REPLContext) => Promise | string; } export interface REPLContext { /** Playwright page */ page: any; /** Current selector */ selector?: string; /** Current element */ element?: any; /** Variables */ variables: Map; /** History */ history: string[]; /** Command results */ lastResult?: any; } /** * REPL Debug Handler class */ export declare class REPLDebugHandler { private commands; private config; private context; private running; private readline; constructor(config?: REPLConfig); /** * Register default commands */ private registerDefaultCommands; /** * Register a custom command */ registerCommand(command: REPLCommand): void; /** * Find command by name or alias */ private findCommand; /** * Start the REPL */ start(page: any): Promise; /** * Execute a command */ private executeCommand; /** * Colorize text for terminal output */ private colorize; /** * Get current context */ getContext(): REPLContext; /** * Execute a single command programmatically (non-interactive) */ execute(page: any, command: string): Promise; } /** * Factory function to create REPL Debug Handler */ export declare function createREPLDebugHandler(config?: REPLConfig): REPLDebugHandler; /** * Start REPL (convenience function) */ export declare function startREPL(page: any, config?: REPLConfig): Promise; export default REPLDebugHandler;