import type { Page } from '@playwright/test'; import type { ScreenHost } from './screen-result.js'; import { ScreenResult } from './screen-result.js'; import { ScreenElement } from './element.js'; export interface ScreenHandlerOptions { /** Maximum number of times the handler fires. Default: Infinity. */ times?: number; /** Skip the wait-until-gone poll after the handler returns. Default: false. */ noWaitAfter?: boolean; } /** * Register a handler that fires when an authored screen is detected on any * live capture. The callback receives a bound, OCR-populated ScreenResult. */ export declare function addScreenHandler(target: string, fn: (matched: ScreenResult) => Promise, options?: ScreenHandlerOptions): () => void; /** * Register a handler that fires when a specific element within a screen is * detected on any live capture. Dotted target: `'screen-name.element-name'`. * The callback receives the matched ScreenElement. */ export declare function addScreenHandler(target: `${string}.${string}`, fn: (matched: ScreenElement) => Promise, options?: ScreenHandlerOptions): () => void; /** Remove all handlers registered for the given target (screen or element). */ export declare function removeScreenHandler(target: string): void; /** Remove all registered handlers (called by release()). */ export declare function clearScreenHandlers(): void; /** * Check all registered handlers against an already-taken screenshot. * Called from ScreenResult.captureLive() after every live screenshot. */ export declare function runHandlers(shot: string, host: ScreenHost, page: Page): Promise; //# sourceMappingURL=screen-handler.d.ts.map