import type { Dictionary } from '@crawlee/types'; import type { BrowserCrawlerOptions, BrowserCrawlingContext, BrowserHook, BrowserRequestHandler, LaunchContext, LoadedContext, RouterRoutes, RouterHandler } from 'crawlee'; import { BrowserCrawler, Configuration } from 'crawlee'; import type CDPBrowserController from './browser-controller.js'; import CDPBrowserPlugin from './browser-plugin.js'; import { CdpLauncher, type LaunchReturn } from './launcher-wrap.js'; import type CdpPage from './page.js'; import type { GotoOptions } from './page.js'; import type CDPCrawler from './index.js'; /** * Humanization options for simulating realistic user behavior * All options are disabled by default for performance */ interface HumanizationOptions { /** Enable mouse movement humanization. Default: false */ mouse?: boolean; /** Enable keyboard humanization. Default: false */ keyboard?: boolean; /** Enable scroll humanization. Default: false */ scroll?: boolean; } interface FingerprintGeneratorOptions { /** Operating systems to generate fingerprints for (e.g., ["windows"], ["macos"], ["linux"]) */ operatingSystems?: string[]; /** Devices to generate fingerprints for (e.g., ["desktop"], ["mobile"]) */ devices?: string[]; /** Browsers to generate fingerprints for (e.g., ["chrome"], ["firefox"]) */ browsers?: string[]; /** Locales to generate fingerprints for (e.g., ["en-US"], ["it-IT"]) */ locales?: string[]; } interface LaunchOptions { headless?: boolean; useExperimentalFingerprints?: boolean; windowWidth?: number; windowHeight?: number; ignoreHttpsErrors?: boolean; executablePath?: string; browserType?: string; useIncognitoPages?: boolean; userDataDir?: string; keepUserDataDir?: boolean; dnsOverHttpsServer?: string; secureDnsMode?: 'off' | 'automatic' | 'secure'; webrtcIpHandlingPolicy?: 'default' | 'default_public_interface_only' | 'default_public_and_private_interfaces' | 'disable_non_proxied_udp'; /** Whether to start the browser maximized and fullscreen. Default: true */ maximizeWindow?: boolean; /** Options for fingerprint generation - passed from browserPoolOptions */ fingerprintGeneratorOptions?: FingerprintGeneratorOptions; fingerprintOptions?: { enableAdvancedStealth?: boolean; bypassRuntimeEnable?: boolean; spoofWebGL?: boolean; spoofAudioContext?: boolean; spoofClientRects?: boolean; maskAutomationFlags?: boolean; useFingerprintDefaults?: boolean; platform?: 'Win32' | 'MacIntel' | 'Linux x86_64'; spoofFonts?: boolean; spoofPerformance?: boolean; spoofLocale?: boolean; detectTimezone?: boolean; bypassCDPDetection?: boolean; spoofStorage?: boolean; spoofTiming?: boolean; enableDataDomeBypass?: boolean; webRtcPolicy?: 'spoof' | 'disable'; /** Humanization options (all disabled by default) */ humanization?: HumanizationOptions; /** Enable debug logging in browser console. Default: true for debugging */ debug?: boolean; }; } export interface CDPPluginOptions { browserPlugins: [CDPBrowserPlugin]; } export type CDPGotoOptions = Parameters[1]; export interface CDPCrawlingContext extends BrowserCrawlingContext { } export interface CDPLaunchContext extends Partial, 'launchOptions'>> { launchOptions?: LaunchOptions; } export interface CDPHook extends BrowserHook { } export interface CDPRequestHandler extends BrowserRequestHandler> { (ctx: CDPCrawlingContext): Promise | void; } export interface CDPCrawlerOptions extends BrowserCrawlerOptions { launchContext?: CDPLaunchContext; requestHandler?: CDPRequestHandler; } export default class Crawler extends BrowserCrawler { private readonly crawlerOptions; readonly config: Configuration; constructor(crawlerOptions?: CDPCrawlerOptions, config?: Configuration); protected _navigationHandler(crawlingContext: CDPCrawlingContext, gotoOptions: GotoOptions): Promise; } export type CDPRouter = RouterHandler; export declare function createCDPRouter(routes?: RouterRoutes): CDPRouter; export {}; //# sourceMappingURL=crawler.d.ts.map