import { Browser, BrowserContext, Page } from 'playwright';
/**
 * Execution mode: either extracting data or validating it.
 */
export type ExecutionMode = 'scrape' | 'validate';
/**
 * DSL Action types.
 */
export type DSLActionType = 'click' | 'type' | 'select' | 'wait' | 'exists' | 'validate' | 'new_tab' | 'navigate' | 'waitForDownload' | 'captureDownload' | 'uploadToS3' | 'storeResult' | 'scrape' | 'scrapeAttr' | 'scrapeProp' | 'scrapeItems' | 'scrapeDeep' | 'scrapePairs' | 'eval' | 'screenshot' | 'regex' | 'assert' | 'hover' | 'sleep' | 'network_idle' | 'switch_frame' | 'dispatch_event' | 'solve_captcha' | 'solve_captcha_api' | 'solve_captcha_service' | 'humanize';
/**
 * Selector Registry definition.
 */
export type SelectorRegistry = Record<string, string | string[]>;
/**
 * DSL Step definition (Modular).
 */
export interface DSLStep {
    action: DSLActionType;
    target?: string;
    inputKey?: string;
    value?: string;
    mapTo?: string;
    attribute?: string;
    paginateTarget?: string;
    navigationMode?: 'click' | 'direct';
    regex?: string;
    code?: string;
    timeout?: number;
    optional?: boolean;
    label?: string;
    frame?: string;
    steps?: DSLStep[];
    captchaConfig?: {
        baseUrl: string;
        headers: {
            name: string;
            value: string;
        }[];
        submitPath: string;
        statusPath: string;
        submitType: 'base64' | 'image';
        submitParam: string;
        submitResponseKey: string;
        statusCheckKey: string;
        statusSuccessValue: string;
        statusResultKey: string;
        inputTarget?: string;
    };
}
/**
 * Flow definition (Business Logic Only).
 */
export interface Flow {
    name: string;
    steps: DSLStep[];
}
/**
 * Scenario Configuration (Orchestration).
 */
export interface ScenarioConfig {
    name?: string;
    project?: string;
    mode: ExecutionMode;
    baseUrl: string;
    doc_type?: string;
    flows: (string | Flow)[];
    inputFile?: string;
    expectedFile?: string;
    concurrency?: number;
    filters?: Record<string, (string | number)[]>;
    inputData?: any;
    sharedDataRefs?: string[];
    database?: {
        enabled?: boolean;
        collection?: string;
    };
    headless?: boolean;
    proxy?: {
        server: string;
        username?: string;
        password?: string;
    };
    isPreview?: boolean;
    aiConfig?: {
        provider: 'openai' | 'gemini';
        apiKey: string;
    };
}
/**
 * Input Data row.
 * Defines WHAT values to use.
 */
export type InputData = Record<string, string | number>;
/**
 * Expected result for validation.
 * Defines WHAT SHOULD HAPPEN.
 */
export interface ExpectedResult {
    type: 'success' | 'error';
    message?: string;
}
/**
 * Execution Context for a single test case or combination.
 */
export declare class ExecutionContext {
    readonly scenario: ScenarioConfig;
    browser?: Browser;
    browserContext?: BrowserContext;
    page?: Page;
    inputs: InputData;
    expected?: ExpectedResult;
    runId: string;
    batchId: string;
    organizationId: string;
    metadata: Record<string, any>;
    settings: any;
    aiConfig?: {
        provider: 'openai' | 'gemini';
        apiKey: string;
    };
    results: any[];
    extractedItems: any[];
    onItemExtracted?: (item: any) => Promise<void>;
    onProgress?: (step: any, index: number, metadata?: any) => Promise<void>;
    errors: Error[];
    isStopped: boolean;
    targetCollection?: string;
    extractionBuffer: Record<string, any>;
    isBuffering: boolean;
    /**
     * Internal store for sharing data between DSL steps (e.g., file paths)
     */
    store: Map<string, any>;
    constructor(scenario: ScenarioConfig);
    cleanup(): Promise<void>;
}
export type RecorderEvent = {
    type: 'click' | 'input' | 'type' | 'select' | 'navigate' | 'validate' | 'scrape' | 'scrapeAttr' | 'scrapeProp' | 'scrapeItems' | 'scrapeDeep' | 'scrapePairs' | 'stop' | 'discard' | 'startLoop' | 'finalizeLoop' | 'stopLoop' | 'eval' | 'screenshot' | 'wait' | 'regex' | 'assert' | 'hover' | 'sleep' | 'network_idle' | 'dispatch_event' | 'solve_captcha' | 'solve_captcha_api' | 'solve_captcha_service' | 'humanize' | 'preview';
    selector?: string;
    altSelectors?: string[];
    value?: string;
    label?: string;
    attribute?: string;
    paginateTarget?: string;
    regex?: string;
    code?: string;
    timeout?: number;
    frame?: string;
    url: string;
    timestamp: number;
    optional?: boolean;
    captchaConfig?: any;
};
export interface SiteDSL {
    baseUrl: string;
    flows: Record<string, Flow>;
}
export interface RecordingConfig {
    mode: ExecutionMode;
    dbEnabled: boolean;
    dbCollection?: string;
    project?: string;
    initialSteps?: DSLStep[];
    isResuming?: boolean;
    isOverwrite?: boolean;
    tags?: string[];
    saveAsFlow?: boolean;
    namespace?: string;
    docType?: string;
    flows?: string[];
    sharedDataRefs?: string[];
    organizationId?: string;
    token?: string;
    inputData?: Record<string, any>;
    proxy?: {
        server: string;
        username?: string;
        password?: string;
    };
}
