/**
 * Embedded Browser for Terminal
 *
 * Provides browser capabilities within the terminal:
 * - Web page rendering (via sixel or text)
 * - Screenshot capture
 * - DOM element selection
 * - Interactive debugging
 *
 * Inspired by Cursor 2.0's embedded browser.
 */
import { EventEmitter } from 'events';
export interface BrowserConfig {
    headless: boolean;
    viewport: {
        width: number;
        height: number;
    };
    userAgent?: string;
    timeout: number;
    screenshotDir: string;
    renderMode: 'sixel' | 'text' | 'none';
}
export interface PageInfo {
    url: string;
    title: string;
    html?: string;
    text?: string;
    screenshot?: string;
}
export interface DOMElement {
    selector: string;
    tagName: string;
    id?: string;
    className?: string;
    text?: string;
    attributes: Record<string, string>;
    rect?: {
        x: number;
        y: number;
        width: number;
        height: number;
    };
}
export interface BrowserSession {
    id: string;
    url: string;
    startTime: Date;
    pages: PageInfo[];
}
/**
 * Embedded Browser Manager
 */
export declare class EmbeddedBrowser extends EventEmitter {
    private config;
    private process;
    private sessions;
    private sessionCounter;
    private currentUrl;
    private pageContent;
    constructor(config?: Partial<BrowserConfig>);
    /**
     * Ensure screenshot directory exists
     */
    private ensureScreenshotDir;
    /**
     * Navigate to a URL
     */
    navigate(url: string): Promise<PageInfo>;
    /**
     * Fetch page content using curl
     */
    private fetchPage;
    /**
     * Take a screenshot of the current page
     */
    takeScreenshot(url?: string): Promise<string>;
    /**
     * Convert HTML to text
     */
    private htmlToText;
    /**
     * Extract title from HTML
     */
    private extractTitle;
    /**
     * Select elements matching a CSS selector
     */
    selectElements(selector: string): DOMElement[];
    /**
     * Get text content of the page
     */
    getTextContent(): string;
    /**
     * Get links from the page
     */
    getLinks(): Array<{
        href: string;
        text: string;
    }>;
    /**
     * Get forms from the page
     */
    getForms(): Array<{
        action: string;
        method: string;
        inputs: Array<{
            name: string;
            type: string;
            value?: string;
        }>;
    }>;
    /**
     * Create a browser session
     */
    createSession(): BrowserSession;
    /**
     * Close a session
     */
    closeSession(sessionId: string): void;
    /**
     * Render page in terminal (text mode)
     */
    renderInTerminal(): string;
    /**
     * Format page info for display
     */
    formatPageInfo(pageInfo: PageInfo): string;
    /**
     * Get current URL
     */
    getCurrentUrl(): string;
    /**
     * Get page content
     */
    getPageContent(): string;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<BrowserConfig>): void;
    /**
     * Get configuration
     */
    getConfig(): BrowserConfig;
    /**
     * Cleanup
     */
    dispose(): void;
}
export declare function getEmbeddedBrowser(config?: Partial<BrowserConfig>): EmbeddedBrowser;
export declare function resetEmbeddedBrowser(): void;
