export interface BatchConfig {
    maxBatchSize: number;
    flushIntervalMs: number;
    maxRetries: number;
    concurrency: number;
}
export interface BatchItem<T> {
    id: string;
    data: T;
    retries: number;
}
export interface BatchResult<T, R> {
    successful: Array<{
        item: BatchItem<T>;
        result: R;
    }>;
    failed: Array<{
        item: BatchItem<T>;
        error: Error;
    }>;
}
/**
 * Generic batch processor for database operations
 */
export declare class BatchProcessor<T, R> {
    private queue;
    private processing;
    private flushTimer?;
    private config;
    private processFn;
    constructor(processFn: (items: T[]) => Promise<R[]>, config?: Partial<BatchConfig>);
    /**
     * Add item to batch queue
     */
    add(data: T): Promise<R>;
    /**
     * Add multiple items to batch queue
     */
    addMany(items: T[]): Promise<R[]>;
    /**
     * Process all pending items immediately
     */
    flush(): Promise<void>;
    /**
     * Process a chunk of items
     */
    private processChunk;
    /**
     * Schedule a flush operation
     */
    private scheduleFlush;
    /**
     * Create chunks from array
     */
    private createChunks;
    /**
     * Generate unique ID
     */
    private generateId;
    /**
     * Callbacks storage
     */
    private callbacks;
    /**
     * Get queue statistics
     */
    getStats(): {
        queueSize: number;
        processing: boolean;
        pendingCallbacks: number;
    };
    /**
     * Clear the queue
     */
    clear(): void;
}
/**
 * Create batch processors for common database operations
 */
export declare const batchProcessors: {
    /**
     * Batch insert processor
     */
    createInsertProcessor<T>(tableName: string, insertFn: (items: T[]) => Promise<any[]>): BatchProcessor<T, any>;
    /**
     * Batch update processor
     */
    createUpdateProcessor<T>(tableName: string, updateFn: (items: T[]) => Promise<any[]>): BatchProcessor<T, any>;
};
//# sourceMappingURL=batch-processor.d.ts.map