import type { ElementHandle, KeyboardTypeOptions, KeyInput, KeyPressOptions, MouseButton, Page } from "puppeteer-core"; import { ToolAbortError } from "../tool-errors.js"; import { type UploadRoute, type UploadStaging } from "./upload-files.js"; /** Options accepted by coordinate-based mouse clicks. */ export interface ClickAtOptions { /** Mouse button to press. */ button?: MouseButton; /** Number of clicks to dispatch. */ clickCount?: number; } /** Options accepted by pointer movement. */ export interface MouseMoveOptions { /** Number of intermediate movement events. */ steps?: number; } /** Options accepted by mouse button transitions. */ export interface MouseButtonOptions { /** Mouse button to press or release. */ button?: MouseButton; } /** Options accepted by element highlighting. */ export interface HighlightOptions { /** Time to keep the highlight visible in milliseconds. */ duration?: number; } /** Options accepted by element or page scrolling. */ export interface ScrollOptions { /** Scroll one matching element instead of the page. */ selector?: string; } /** A browser element handle with omp's additional interaction methods. */ export type InteractionHandle = ElementHandle & { dblclick(): Promise; check(): Promise; uncheck(): Promise; highlight(options?: HighlightOptions): Promise; }; type ActionabilityResult = { ok: true; x: number; y: number; } | { ok: false; reason: string; coveredBy?: string; }; /** A click aborted while its element was still refused; `refusal` names the last failed check. */ export declare class ClickRefusedError extends ToolAbortError { readonly refusal: string; constructor(refusal: string, options?: ErrorOptions); } /** * Text entry aborted after input reached the page; `progress` says what the field may already hold. * The per-op timeout reports this instead of an actionability hint, since the element did take input. */ export declare class TypingInterruptedError extends ToolAbortError { readonly progress: string; constructor(progress: string, options?: ErrorOptions); } /** * Page function (self-contained; serialisable via `.toString()`): whether `descendant` is `ancestor` or * renders inside it — its flat-tree ancestry, which follows slot assignment into shadow trees and climbs * shadow-root boundaries out to their hosts, where `Node.contains` stops. */ export declare function composedContains(ancestor: unknown, descendant: unknown): boolean; /** * Return a visible point relative to the element's box, or explain why it cannot receive a click. * A left click on one of the control's own `