import type { Page } from '@playwright/test'; import type { Rect } from './types.js'; import type { OcrStrategy } from './utils/ocr.js'; export type { OcrStrategy }; export interface ClickStrategy { /** Returns the point to click within the element's bounding rect. */ getPoint(rect: Rect): { x: number; y: number; }; } export interface FillStrategy { /** Full fill sequence: focus, select, type. Owns all keyboard/mouse steps. */ fill(page: Page, rect: Rect, text: string): Promise; } export interface CaptureStrategy { unhover: boolean; unhoverPoint?: { x: number; y: number; }; } export declare function setClickStrategy(s: ClickStrategy | undefined): void; export declare function setFillStrategy(s: FillStrategy | undefined): void; export declare function getClickStrategy(): ClickStrategy; export declare function getFillStrategy(): FillStrategy; export declare const Strategies: { Ocr: { /** Create an Ocr strategy with global charset defaults, name-inference, and swaps. */ default(options: OcrStrategy): OcrStrategy; }; Click: { /** Click the center of the element rect. Default behavior. */ center(): ClickStrategy; /** * Click at a fractional offset within the element rect. * `{ x: 0, y: 0.5 }` → left-center; `{ x: 0.5, y: 0.5 }` → center. */ offset(pct: { x: number; y: number; }): ClickStrategy; /** Click at a custom point derived from the rect. */ point(fn: (rect: Rect) => { x: number; y: number; }): ClickStrategy; }; Fill: { /** Click → Ctrl/Cmd+A → Backspace → insertText. Default behavior. */ selectAllType(): FillStrategy; /** * Triple-click (selects all in remote/Guacamole envs) → insertText. * Preferred over selectAllType for environments that don't relay Ctrl+A. */ tripleClickType(): FillStrategy; /** Click → Ctrl/Cmd+A → Backspace → keyboard.type (slower, fires key events). */ clearAndType(): FillStrategy; /** Type into the currently focused element without clicking or clearing. */ typeOnly(): FillStrategy; /** * Click to focus, then type one character at a time with a delay. * Use in environments where rapid key events are dropped. */ charByChar(options: { delay: number; }): FillStrategy; /** Click to focus, then use insertText without selecting/clearing first. */ insertText(): FillStrategy; }; Capture: { /** Move the mouse to a neutral corner before OCR screenshots. Default behavior. */ unhover(options?: { point?: { x: number; y: number; }; }): CaptureStrategy; /** Skip the unhover mouse move before capture. */ noop(): CaptureStrategy; }; }; //# sourceMappingURL=strategies.d.ts.map