import { IDataObject } from 'n8n-workflow'; export interface Crawl4aiApiCredentials { connectionMode: 'direct' | 'docker'; dockerUrl?: string; authenticationType?: 'none' | 'token' | 'basic'; apiToken?: string; username?: string; password?: string; enableLlm?: boolean; llmProvider?: string; apiKey?: string; ollamaUrl?: string; customProvider?: string; customApiKey?: string; cacheDir?: string; } export interface Crawl4aiNodeOptions extends IDataObject { bypassCache?: boolean; includeMedia?: boolean; verboseResponse?: boolean; cacheMode?: 'enabled' | 'bypass' | 'only'; } export interface BrowserConfig { browser_type?: string; headless?: boolean; browser_mode?: string; use_managed_browser?: boolean; cdp_url?: string; debugging_port?: number; use_persistent_context?: boolean; user_data_dir?: string; chrome_channel?: string; channel?: string; proxy?: string; viewport_width?: number; viewport_height?: number; viewport?: { width: number; height: number; }; accept_downloads?: boolean; downloads_path?: string; storage_state?: string | object; ignore_https_errors?: boolean; java_script_enabled?: boolean; javaScriptEnabled?: boolean; cookies?: Array; headers?: object; user_agent?: string; userAgent?: string; user_agent_mode?: string; user_agent_generator_config?: object; text_mode?: boolean; light_mode?: boolean; extra_args?: Array; host?: string; enable_stealth?: boolean; } export interface CrawlerRunConfig { cacheMode?: 'enabled' | 'bypass' | 'only'; streamEnabled?: boolean; pageTimeout?: number; requestTimeout?: number; timeout?: number; waitUntil?: string; waitFor?: string; waitForTimeout?: number; waitForImages?: boolean; delayBeforeReturnHtml?: number; jsCode?: string | string[]; jsOnly?: boolean; ignoreBodyVisibility?: boolean; scanFullPage?: boolean; scrollDelay?: number; maxScrollSteps?: number; processIframes?: boolean; removeOverlayElements?: boolean; simulateUser?: boolean; overrideNavigator?: boolean; magic?: boolean; adjustViewportToContent?: boolean; cssSelector?: string; targetElements?: string[]; excludedTags?: string[]; excludedSelector?: string; keepDataAttributes?: boolean; keepAttrs?: string[]; removeForms?: boolean; onlyText?: boolean; wordCountThreshold?: number; excludeExternalLinks?: boolean; excludeInternalLinks?: boolean; excludeSocialMediaLinks?: boolean; excludeDomains?: string[]; scoreLinks?: boolean; screenshot?: boolean; screenshotWaitFor?: number; screenshotHeightThreshold?: number; pdf?: boolean; imageDescriptionMinWordThreshold?: number; imageScoreThreshold?: number; excludeExternalImages?: boolean; excludeAllImages?: boolean; tableScoreThreshold?: number; checkRobotsTxt?: boolean; userAgent?: string; userAgentMode?: string; userAgentGeneratorConfig?: object; method?: string; sessionId?: string; sharedData?: object; maxRetries?: number; viewport?: { width: number; height: number; }; headless?: boolean; javaScriptEnabled?: boolean; verbose?: boolean; logConsole?: boolean; captureNetworkRequests?: boolean; captureConsoleMessages?: boolean; extractionStrategy?: any; chunkingStrategy?: any; markdownGenerator?: any; scrapingStrategy?: any; proxyConfig?: object; linkPreviewConfig?: object; virtualScrollConfig?: object; deepCrawlStrategy?: object; experimental?: object; } export interface CrawlResult { url: string; success: boolean; statusCode?: number; title?: string; markdown?: string; html?: string; cleaned_html?: string; text?: string; links?: { internal: Link[]; external: Link[]; }; media?: { images: Media[]; videos: Media[]; }; extracted_content?: string; error_message?: string; crawl_time?: number; metadata?: Record; } export interface Link { href: string; text: string; title?: string; } export interface Media { src: string; alt?: string; title?: string; type?: string; } export interface CssSelectorField { name: string; selector: string; type: 'text' | 'attribute' | 'html'; attribute?: string; } export interface CssSelectorSchema { name: string; baseSelector: string; fields: CssSelectorField[]; } export interface LlmSchemaField { name: string; type: string; description?: string; } export interface LlmSchema { title?: string; type: 'object'; properties: Record; required?: string[]; }