declare module 'undetected-browser' { import { Browser, Page } from 'puppeteer'; import { GhostCursor } from 'ghost-cursor'; import { typeInto, PerformanceTimer } from '@forad/puppeteer-humanize'; type CallbackFunction = () => void; interface SpeedResults { loadTime: number; scriptsCount: number; stylesCount: number; totalBytes: number } declare module 'puppeteer' { interface Page { // Basic Methods getRandomInt(min: number, max: number): number; sleep(time: number): Promise; randomSleep(min: number, max: number): Promise; repeatFunctionByAmount(functionCallback: () => Promise | CallbackFunction, numberOfTries: number, errorMessage?: string): Promise; executeFunctionWithTimeout(functionCallback: () => Promise, timeout: number, customMessage?: string): Promise; makeid(length: number): string; // Extra Methods checkFingerprint: (screenshot: string) => Promise; checkCaptcha: () => Promise; scanFingerprintAttempts: () => Promise; fptScanner?: ScanFingerprint; // General Methods messureSpeed(url?: string): Promise; setupURLBlocker(urls: string[]): Promise; closeOtherPages(browser: Browser): Promise; adblockURLs?: string[]; // Interaction Methods cursor: GhostCursor; typeInto: typeof typeInto; enableMouseDebugWindow: () => Promise; simulateMouseClick: (selector: string) => Promise; toggleRandomMove: (enabled?: boolean) => void; simulateTyping: (selector: string | Element, text: string) => Promise; clickElementWithInnerText: (selectorElement: string, innerText: string) => Promise; clickElementWithInnerHTML: (selectorElement: string, innerHTML: string) => Promise; ensureType: (selector: string | Element, text: string) => Promise; ensureTypeSafe: (selector: string | Element, text: string) => Promise; // Navigation Methods navigate: (url: string, delay?: number) => Promise; waitToLoad: (url: string) => Promise; // Selector Methods smartWaitForSelector: (selector: string | null, delay?: number) => Promise; $$$: (selector: string) => Promise; $$$$: (selector: string) => Promise; getElementWithInnerText: (element: string, innerText: string) => Promise; getElementWithInnerHTML: (element: string, innerHTML: string) => Promise; getAnySelector: (selectors: string[]) => Promise; getAnySelectorName: (selectors: string[]) => Promise; smartWaitForAnySelector: (selectors: string[], options?: object) => Promise; slowType: (selector: string, text: string) => Promise; } } interface Report { general: "bad" | "ok"; cloudflare: string | null; arkose: { steps: number; objects: number; status: "pass" | "fail" | "error"; }; userAgent?: { status: string; message: string }; location?: { status: string; message: string }; proxy?: { status: string; message: string }; fingerprint?: { status: string; message: string }; automation?: { status: string; message: string }; } class CaptchaTester { async checkCaptcha(page: Page): Promise; } class CheckFingerprint { async runFingerprintChecker(page: Page, screenshot: boolean): Promise; } class ScanFingerprint { hadFirstRun: boolean; setupFingerprintScanner(page: Page): Promise; } class UndetectableBrowser { private browser: Browser; private verbose: boolean; private adblockURLs: string[]; constructor(browser: Browser); async extendBrowser(browser: Browser): Promise async getBrowser(): Promise; extendPage(page: Page): Page; } export default UndetectableBrowser; }