import { type BrowserContext } from "playwright";
import type { CreateScenarioInput } from "../types/index.js";
import { createScenario } from "../db/scenarios.js";
export interface RecordedAction {
    type: "navigate" | "click" | "fill" | "select" | "press" | "scroll";
    selector?: string;
    value?: string;
    url?: string;
    key?: string;
    timestamp: number;
}
export interface RecordingResult {
    actions: RecordedAction[];
    url: string;
    duration: number;
}
export declare function recordSession(url: string, options?: {
    timeout?: number;
    projectId?: string;
    name?: string;
}): Promise<RecordingResult & {
    recordingId?: string;
}>;
export declare function actionsToScenarioInput(recording: RecordingResult, name: string, projectId?: string): CreateScenarioInput;
export declare function recordAndSave(url: string, name: string, projectId?: string): Promise<{
    recording: RecordingResult;
    scenario: ReturnType<typeof createScenario>;
}>;
export interface AuthRecordingOptions {
    email: string;
    password: string;
    loginUrl: string;
    emailSelector?: string;
    passwordSelector?: string;
    submitSelector?: string;
    waitForUrl?: string | RegExp;
    timeoutMs?: number;
}
export interface SavedAuthState {
    cookies: {
        name: string;
        value: string;
        domain: string;
        path: string;
    }[];
    localStorage: {
        origin: string;
        entries: {
            name: string;
            value: string;
        }[];
    }[];
    loginUrl: string;
    recordedAt: string;
}
/**
 * Navigate to login, fill credentials, and capture auth state (cookies + localStorage).
 * Returns the saved auth state for replay in future test runs.
 */
export declare function recordAuthFlow(loginUrl: string, options: AuthRecordingOptions): Promise<SavedAuthState>;
/**
 * Restore a previously saved auth state into a browser context.
 * Injects cookies and localStorage so the page is already authenticated.
 */
export declare function replayAuthState(context: BrowserContext, authState: SavedAuthState): Promise<void>;
/**
 * Convert saved auth state into a scenario with auth metadata.
 */
export declare function authStateToScenarioMetadata(authState: SavedAuthState, name: string, projectId?: string): ReturnType<typeof createScenario>;
//# sourceMappingURL=recorder.d.ts.map