/**
 * Provenance Query Builder
 *
 * Fluent query builder for provenance records with pagination and export support.
 *
 * @packageDocumentation
 */
import type { ProvenanceRecord, PaginatedResult, ExportFormat, ActorType } from './types.js';
import type { ProvenanceStorage } from './storage.js';
/**
 * Query builder for provenance records
 */
export declare class ProvenanceQueryBuilder {
    private storage;
    private filters;
    private pagination;
    constructor(storage: ProvenanceStorage);
    /**
     * Filter by entity ID
     */
    forEntity(entityId: string): this;
    /**
     * Filter by entity type
     */
    ofType(entityType: string): this;
    /**
     * Filter by actor ID
     */
    byActor(actorId: string): this;
    /**
     * Filter by actor type
     */
    byActorType(actorType: ActorType): this;
    /**
     * Filter by action
     */
    withAction(action: string): this;
    /**
     * Filter by tenant
     */
    inTenant(tenantId: string): this;
    /**
     * Filter by time range
     */
    inTimeRange(from?: Date, to?: Date): this;
    /**
     * Filter from a specific date
     */
    since(from: Date): this;
    /**
     * Filter until a specific date
     */
    until(to: Date): this;
    /**
     * Set pagination limit
     */
    limit(limit: number): this;
    /**
     * Set pagination offset
     */
    offset(offset: number): this;
    /**
     * Set page number (1-indexed)
     */
    page(pageNumber: number, pageSize?: number): this;
    /**
     * Execute the query and return paginated results
     */
    execute(): Promise<PaginatedResult<ProvenanceRecord>>;
    /**
     * Execute query and return all matching records (with pagination handling)
     */
    all(): Promise<ProvenanceRecord[]>;
    /**
     * Execute query and return first matching record
     */
    first(): Promise<ProvenanceRecord | null>;
    /**
     * Execute query and return count of matching records
     */
    count(): Promise<number>;
    /**
     * Export query results to specified format
     */
    export(format: ExportFormat): Promise<string>;
    /**
     * Export records to JSON format
     */
    private exportToJson;
    /**
     * Export records to CSV format
     */
    private exportToCsv;
    /**
     * Escape a field for CSV output
     */
    private escapeCsvField;
    /**
     * Clone the query builder with current state
     */
    clone(): ProvenanceQueryBuilder;
    /**
     * Reset all filters and pagination
     */
    reset(): this;
}
/**
 * Create a new query builder
 */
export declare function createQueryBuilder(storage: ProvenanceStorage): ProvenanceQueryBuilder;
//# sourceMappingURL=query.d.ts.map