import { BrowserContext, Page } from 'playwright';
/**
 * Represents the device emulation mode
 */
export type DeviceMode = 'desktop' | 'mobile';
/**
 * Session state for a browser context
 */
export interface SessionState {
    sessionId: string;
    userId: string;
    deviceMode: DeviceMode;
    createdAt: Date;
    lastActivity: Date;
    currentUrl: string;
    isActive: boolean;
}
/**
 * Browser session configuration
 */
export interface SessionConfig {
    sessionId: string;
    userId: string;
    deviceMode: DeviceMode;
    userAgent?: string;
    viewport?: {
        width: number;
        height: number;
    };
    locale?: string;
    timezone?: string;
    geolocation?: {
        latitude: number;
        longitude: number;
    };
    upstreamProxy?: ProxyConfig;
}
/**
 * Upstream proxy configuration
 */
export interface ProxyConfig {
    server: string;
    username?: string;
    password?: string;
}
/**
 * Browser pool statistics
 */
export interface PoolStats {
    totalSessions: number;
    activeSessions: number;
    idleSessions: number;
    queuedRequests: number;
    totalBrowsers: number;
}
/**
 * DOM mutation data for streaming
 */
export interface DOMUpdate {
    type: 'mutation' | 'navigation' | 'resource' | 'console' | 'error' | 'html_snapshot';
    timestamp: number;
    data: any;
}
/**
 * Navigation request
 */
export interface NavigationRequest {
    sessionId: string;
    url: string;
    waitUntil?: 'load' | 'domcontentloaded' | 'networkidle';
}
/**
 * User interaction event
 */
export interface InteractionEvent {
    sessionId: string;
    type: 'click' | 'type' | 'scroll' | 'keypress';
    selector?: string;
    data?: any;
}
/**
 * Preview interaction event for live HTML preview
 */
export interface PreviewInteractionEvent {
    sessionId: string;
    type: 'preview_click' | 'preview_scroll' | 'preview_keyboard';
    x?: number;
    y?: number;
    scrollX?: number;
    scrollY?: number;
    key?: string;
    viewportWidth?: number;
    viewportHeight?: number;
}
/**
 * Authentication payload
 */
export interface AuthPayload {
    userId: string;
    email: string;
    role: string;
}
/**
 * User credentials
 */
export interface UserCredentials {
    email: string;
    password: string;
}
/**
 * Browser session wrapper
 */
export interface IBrowserSession {
    sessionId: string;
    context: BrowserContext;
    page: Page;
    state: SessionState;
    navigate(url: string): Promise<void>;
    interact(event: InteractionEvent): Promise<void>;
    handlePreviewInteraction(event: PreviewInteractionEvent): Promise<void>;
    getHTML(): Promise<string>;
    getScreenshot(): Promise<Buffer>;
    close(): Promise<void>;
}
/**
 * Browser pool interface
 */
export interface IBrowserPool {
    getSession(config: SessionConfig): Promise<IBrowserSession>;
    releaseSession(sessionId: string): Promise<void>;
    closeSession(sessionId: string): Promise<void>;
    getStats(): PoolStats;
    cleanup(): Promise<void>;
}
//# sourceMappingURL=index.d.ts.map