import type { Locator, Page } from "patchright"; /** * The detection result interface. */ export interface CaptchaDetectionResult { frame: Locator; vendor: "recaptcha" | "hcaptcha" | "cloudflare"; type: string; } /** * Detects and classifies a captcha based on the given iframe src URL. * @param src The src URL of the iframe. * @returns A CaptchaDetectionResult indicating if a captcha is present and its details. */ export declare function detectCaptchaFromSrc(src: string): { vendor: "recaptcha" | "hcaptcha" | "cloudflare"; type: string; } | null; /** * Races individual CAPTCHA iframe locators and returns results as soon as a Cloudflare one is found. * @param page The Playwright Page instance. * @returns Array of captcha detection results, prioritizing Cloudflare if found. */ export declare function getCaptchaIframes(page: Page): Promise; /** * Waits up to a specified time to detect captcha iframes, checking periodically for new iframes. * @param page - The Playwright Page instance to scan. * @param maxWait - Maximum time to wait in milliseconds (default: 3000ms). * @returns A Promise resolving to an array of CaptchaDetectionResult objects. */ export declare function waitForCaptchaIframes(page: Page, maxWait?: number): Promise; /** * Identifies new captcha frames that weren't present in a previous scan. * @param oldCaptchas - Array of previously detected captcha frames * @param newCaptchas - Array of currently detected captcha frames * @returns Array of captcha frames that appear in the new results but not in the old ones */ export declare function getNewCaptchaFrames(oldCaptchas: CaptchaDetectionResult[], newCaptchas: CaptchaDetectionResult[]): Promise; /** * Captures a screenshot of a captcha iframe. * @param page The Playwright Page instance. * @param iframeLocator Locator for the iframe. * @returns Base64-encoded screenshot or empty string on failure. */ export declare const screenshotCaptcha: (page: Page, iframeLocator: Locator) => Promise; /** * Calculates absolute page coordinates from percentage coordinates within an iframe. * @param iframeBoundingBox Bounding box of the iframe. * @param xPercentage Horizontal percentage (0-100). * @param yPercentage Vertical percentage (0-100). * @returns Absolute page coordinates or null on failure. */ export declare function getPageCoordinatesFromIframePercentage(iframeBoundingBox: { x: number; y: number; width: number; height: number; }, xPercentage: number, yPercentage: number): Promise<{ x: number; y: number; } | null>; /** * Checks if a locator is visible and has a minimum size of 5x5 pixels. * @param locator - The Playwright Locator to check * @param options - Optional configuration * @param options.timeout - Maximum time to wait in milliseconds (default: 5000) * @returns Promise - True if visible and meets size requirements, false otherwise */ export declare function isVisible(locator: Locator, options?: { timeout?: number; }): Promise; //# sourceMappingURL=get-active-captchas.d.ts.map