import type { ConsoleMessage, JSHandle, Page } from 'playwright'; import type { Emitter } from '../testing/emitter.js'; import type { RunnerEvents } from '../types.js'; /** * A class that specializes in collecting and processing browser logs. */ export declare class BrowserLogs { protected readonly page: Page; /** * Path to the Lupa configuration file. */ configPath?: string; /** * When set, browser internal debug and network resource errors are also printed. */ verbose: boolean; /** * When set, all browser logs are suppressed. */ silent: boolean; /** * The list of prefixes to ignore messages containing. * @default ['[vite]'] */ ignorePrefix: string[]; /** * Callback to emit logs to the reporter */ emitter: Emitter; /** * Creates an instance of BrowserLogs. * * @param page - The Playwright page to capture logs from. * @param verbose - Whether to enable verbose mode including browser engine debug output. * @param emitter - The event emitter to dispatch browser logs to reporters. * @param configPath - Optional path to the configuration file. * @param silent - Whether to suppress all browser console messages. */ constructor(page: Page, verbose: boolean | undefined, emitter: Emitter, configPath?: string, silent?: boolean); /** * Starts capturing browser logs. */ boot(): void; /** * Determines whether a console message should be displayed. * * @param message - The raw text of the console message. * @param type - The console message type (e.g. 'log', 'error', 'warn'). * @param argsCount - Number of arguments passed to the console call. Browser engine * internal network errors typically have 0 arguments, while user console.error calls have >= 1. * @returns Whether to emit the message to reporters. */ protected canShow(message: string, type: string, argsCount?: number): boolean; protected handleConsoleMessage(message: ConsoleMessage): Promise; protected handlePageError(error: Error): Promise; protected processArguments(args: JSHandle[]): Promise; protected processArgument(arg: JSHandle): Promise; }