import { backfillsTable } from '../../../database/tables';
import type { BackfillCheckpoint, BackfillEvalResultsDenormOptions, BackfillReadSource, BackfillTargets } from './evalDenormBackfillTypes';
export type BackfillJobStatus = 'pending' | 'running' | 'completed' | 'failed';
export type BackfillPipeline = 'eval_denorm_ch' | 'eval_denorm_pg' | 'eval_denorm_both';
export type BackfillJobRow = typeof backfillsTable.$inferSelect;
export type BackfillJobProgressUpdate = {
    checkpoint: BackfillCheckpoint;
    status?: BackfillJobStatus;
    totalRows?: number;
    batchNumber?: number;
    estimatedBatches?: number;
    elapsedSeconds?: number;
    etaSeconds?: number;
    readSource?: BackfillReadSource;
    shardStartOffset?: number;
    shardEndOffset?: number;
};
export type BackfillEvalResultsDenormResult = BackfillCheckpoint & {
    backfillId: string;
};
export declare function pipelineFromTargets(targets: BackfillTargets): BackfillPipeline;
export declare function backfillRowToCheckpoint(row: BackfillJobRow): BackfillCheckpoint;
export declare function backfillJobToPublicProgress(row: BackfillJobRow): Record<string, unknown>;
export declare function getBackfillJobById(id: string): Promise<BackfillJobRow | null>;
export declare function listChildBackfillJobs(parentId: string): Promise<BackfillJobRow[]>;
export type CreateBackfillJobParams = {
    pipeline: BackfillPipeline;
    targets: BackfillTargets;
    options: BackfillEvalResultsDenormOptions;
    readSource?: BackfillReadSource;
    parentId?: string;
    shardIndex?: number;
    shardStartOffset?: number;
    shardEndOffset?: number;
    batchSize: number;
    scopeCreatedAfter?: string | null;
    scopeCreatedBefore?: string | null;
    scopeReason?: string;
    dryRun?: boolean;
};
export declare function createBackfillJob(params: CreateBackfillJobParams): Promise<string>;
export declare function persistBackfillJobProgress(jobId: string, update: BackfillJobProgressUpdate): Promise<void>;
export declare function markBackfillJobFailed(jobId: string, checkpoint: BackfillCheckpoint): Promise<void>;
export declare function markBackfillJobCompleted(jobId: string, checkpoint: BackfillCheckpoint, progress?: Omit<BackfillJobProgressUpdate, 'checkpoint' | 'status'>): Promise<void>;
export declare function aggregateParentBackfillJob(parentId: string): Promise<void>;
export declare function loadBackfillJobForResume(backfillId: string): Promise<{
    row: BackfillJobRow;
    checkpoint: BackfillCheckpoint;
} | null>;
//# sourceMappingURL=backfillJobStore.d.ts.map