/**
 * Provenance operations for DatabaseService
 *
 * Handles all CRUD operations for provenance records including
 * chain traversal and tree queries.
 */
import Database from 'better-sqlite3';
import { ProvenanceRecord } from '../../../models/provenance.js';
/**
 * Insert a provenance record
 *
 * @param db - Database connection
 * @param record - Provenance record data
 * @returns string - The provenance record ID
 */
export declare function insertProvenance(db: Database.Database, record: ProvenanceRecord): string;
/**
 * Get a provenance record by ID
 *
 * @param db - Database connection
 * @param id - Provenance record ID
 * @returns ProvenanceRecord | null - The provenance record or null if not found
 */
export declare function getProvenance(db: Database.Database, id: string): ProvenanceRecord | null;
/**
 * Get the complete provenance chain for a record
 * Walks parent_id links from the given record to the root document
 *
 * @param db - Database connection
 * @param id - Starting provenance record ID
 * @returns ProvenanceRecord[] - Array ordered from current to root
 */
export declare function getProvenanceChain(db: Database.Database, id: string): ProvenanceRecord[];
/**
 * Get all provenance records for a root document
 *
 * @param db - Database connection
 * @param rootDocumentId - The root document ID
 * @returns ProvenanceRecord[] - Array of all provenance records
 */
export declare function getProvenanceByRootDocument(db: Database.Database, rootDocumentId: string, options?: {
    limit?: number;
    offset?: number;
}): ProvenanceRecord[];
/**
 * Get child provenance records for a parent
 *
 * @param db - Database connection
 * @param parentId - Parent provenance record ID
 * @returns ProvenanceRecord[] - Array of child records
 */
export declare function getProvenanceChildren(db: Database.Database, parentId: string): ProvenanceRecord[];
/**
 * Filter options for querying provenance records
 */
export interface ProvenanceQueryFilters {
    processor?: string;
    type?: string;
    chain_depth?: number;
    created_after?: string;
    created_before?: string;
    min_quality_score?: number;
    min_duration_ms?: number;
    root_document_id?: string;
    limit?: number;
    offset?: number;
    order_by?: 'created_at' | 'processing_duration_ms' | 'processing_quality_score';
    order_dir?: 'asc' | 'desc';
}
/**
 * Query provenance records with dynamic filters
 *
 * Builds a parameterized SQL WHERE clause from provided filters.
 * All filters are optional. Default order: created_at DESC. Default limit: 50.
 *
 * @param db - Database connection
 * @param filters - Query filter options
 * @returns { records: ProvenanceRecord[], total: number }
 */
export declare function queryProvenance(db: Database.Database, filters: ProvenanceQueryFilters): {
    records: ProvenanceRecord[];
    total: number;
};
/**
 * Processor statistics result
 */
export interface ProvenanceProcessorStat {
    processor: string;
    processor_version: string;
    total_operations: number;
    avg_duration_ms: number;
    min_duration_ms: number;
    max_duration_ms: number;
    avg_quality_score: number | null;
    total_processing_time_ms: number;
}
/**
 * Get aggregate statistics per processor/version
 *
 * Groups by processor and processor_version with AVG, MIN, MAX, SUM, COUNT
 * aggregations on processing_duration_ms and processing_quality_score.
 *
 * @param db - Database connection
 * @param filters - Optional filters for processor, created_after, created_before
 * @returns Array of per-processor stats
 */
export declare function getProvenanceProcessorStats(db: Database.Database, filters?: {
    processor?: string;
    created_after?: string;
    created_before?: string;
}): ProvenanceProcessorStat[];
//# sourceMappingURL=provenance-operations.d.ts.map