export interface MongoConfig {
    enabled: boolean;
    uri: string;
    dbName: string;
    collection: string;
}
/**
 * MongoDB client wrapper for persistent storage.
 */
export declare class MongoManager {
    private readonly config;
    private static instance;
    private client;
    private db;
    private collection;
    private constructor();
    static getInstance(config?: MongoConfig): Promise<MongoManager>;
    /**
     * Connects to the database with retry logic.
     */
    connect(): Promise<void>;
    /**
     * Saves a document to a specific collection.
     */
    saveTo(collectionName: string, document: Record<string, any>): Promise<void>;
    /**
     * Finds a single document in a collection.
     */
    findOne(collectionName: string, query?: Record<string, any>): Promise<any | null>;
    /**
     * Updates documents in a specific collection.
     */
    updateTo(collectionName: string, query: Record<string, any>, update: Record<string, any>): Promise<void>;
    saveScreenshot(runId: string, batchId: string, screenshotBase64: string): Promise<void>;
    /**
     * Saves a log entry for a specific run with TTL support.
     */
    saveRunLog(runId: string, batchId: string, logEntry: any, organizationId?: string): Promise<void>;
    /**
     * Retrieves logs for a specific run with pagination support.
     */
    getRunLogs(runId: string, limit?: number, skip?: number): Promise<any[]>;
    /**
     * Retrieves the screenshot for a specific run.
     */
    getScreenshot(runId: string): Promise<string | null>;
    /**
     * Updates a job run record based on runId.
     */
    upsertRun(collectionName: string, runId: string, data: any): Promise<void>;
    /**
     * Queries a collection.
     */
    find(collectionName: string, query: Record<string, any>, limit?: number, skip?: number): Promise<any[]>;
    /**
     * Saves a document to the default collection.
     */
    save(document: Record<string, any>): Promise<void>;
    /**
     * Lists all non-system collections in the database.
     */
    listCollections(): Promise<string[]>;
    /**
     * Samples a collection to find groupable fields (including nested ones).
     */
    getSampleFields(collectionName: string): Promise<string[]>;
    /**
     * Executes an aggregation pipeline.
     */
    aggregate(collectionName: string, pipeline: any[]): Promise<any[]>;
    /**
     * General purpose upsert for system records (Organizations, Users, Settings, etc).
     */
    upsertRecord<T>(collectionName: string, filterKey: string, idValue: string, data: T): Promise<void>;
    /**
     * Deletes records matching a query.
     */
    deleteRecords(collectionName: string, query: Record<string, any>): Promise<void>;
    /**
     * Deprecated: Use upsertRecord instead.
     * Upserts a test definition (Scenario, Flow, or SelectorSet) using 'name' as default key.
     */
    upsertTest<T>(collectionName: string, name: string, data: T): Promise<void>;
    /**
     * Retrieves a specific test definition by name.
     */
    getTest<T>(collectionName: string, name: string): Promise<T | null>;
    /**
     * Queries test definitions (e.g. by tag or namespace).
     */
    findTests<T>(collectionName: string, query: Record<string, any>, limit?: number, skip?: number): Promise<T[]>;
    /**
     * Deletes documents from a specific collection.
     */
    deleteFrom(collectionName: string, query: Record<string, any>): Promise<void>;
    /**
     * Deletes a specific test definition by name.
     */
    deleteTest(collectionName: string, name: string): Promise<void>;
    /**
     * Fetches distinct values for a field.
     */
    distinct(collectionName: string, fieldName: string, query?: Record<string, any>): Promise<any[]>;
    /**
     * Updates multiple documents in a collection.
     */
    updateMany(collectionName: string, query: Record<string, any>, update: Record<string, any>): Promise<void>;
    /**
     * Closes the connection.
     */
    close(): Promise<void>;
}
