/**
 * Computer Browser Module
 *
 * Silent web search and browser automation without opening visible windows.
 * Inspired by Open Interpreter's computer.browser capabilities.
 */
import { EventEmitter } from 'events';
export interface SearchResult {
    title: string;
    url: string;
    snippet: string;
    position: number;
}
export interface SearchOptions {
    /** Number of results to return (default: 10) */
    numResults?: number;
    /** Search engine to use */
    engine?: 'google' | 'bing' | 'duckduckgo' | 'serper';
    /** Filter by site */
    site?: string;
    /** Filter by file type */
    fileType?: string;
    /** Time range filter */
    timeRange?: 'day' | 'week' | 'month' | 'year';
    /** Country/region */
    region?: string;
    /** Language */
    language?: string;
    /** Safe search */
    safeSearch?: boolean;
}
export interface PageContent {
    url: string;
    title: string;
    content: string;
    links: Array<{
        text: string;
        url: string;
    }>;
    images: Array<{
        alt: string;
        src: string;
    }>;
    metadata: Record<string, string>;
}
export interface FetchOptions {
    /** Timeout in milliseconds */
    timeout?: number;
    /** Include images */
    includeImages?: boolean;
    /** Include links */
    includeLinks?: boolean;
    /** Maximum content length */
    maxLength?: number;
    /** User agent */
    userAgent?: string;
    /** Custom headers */
    headers?: Record<string, string>;
}
export interface BrowserConfig {
    /** Default search engine */
    defaultEngine: 'google' | 'bing' | 'duckduckgo' | 'serper';
    /** Serper API key (for serper.dev) */
    serperApiKey?: string;
    /** Default timeout */
    defaultTimeout: number;
    /** Default number of results */
    defaultNumResults: number;
    /** Cache enabled */
    cacheEnabled: boolean;
    /** Cache TTL in seconds */
    cacheTTL: number;
}
export declare const DEFAULT_BROWSER_CONFIG: BrowserConfig;
export declare class ComputerBrowser extends EventEmitter {
    private config;
    private cache;
    constructor(config?: Partial<BrowserConfig>);
    /**
     * Perform a silent web search
     */
    search(query: string, options?: SearchOptions): Promise<SearchResult[]>;
    /**
     * Search using Serper.dev API
     */
    private searchSerper;
    /**
     * Search using DuckDuckGo (free, no API key required)
     */
    private searchDuckDuckGo;
    /**
     * Parse DuckDuckGo HTML results
     */
    private parseDuckDuckGoResults;
    /**
     * Fetch and parse a web page
     */
    fetch(url: string, options?: FetchOptions): Promise<PageContent>;
    /**
     * Parse HTML and extract content
     */
    private parseHtml;
    /**
     * Decode HTML entities
     */
    private decodeHtmlEntities;
    /**
     * Resolve relative URL to absolute
     */
    private resolveUrl;
    /**
     * Generate cache key
     */
    private getCacheKey;
    /**
     * Get from cache
     */
    private getFromCache;
    /**
     * Set cache
     */
    private setCache;
    /**
     * Clear cache
     */
    clearCache(): void;
    /**
     * Configure browser
     */
    configure(config: Partial<BrowserConfig>): void;
}
export declare function getComputerBrowser(config?: Partial<BrowserConfig>): ComputerBrowser;
export declare function resetComputerBrowser(): void;
export default ComputerBrowser;
