/**
 * Import batch runner — the cancellable core of the `/api/repos/:repo/import`
 * dispatcher loop, extracted so it's unit-testable without a live Fastify
 * socket.
 *
 * Files are processed in batches of `concurrency`. Before each batch the runner
 * checks `isAborted()`; once the client has disconnected (AbortController on the
 * web side), it stops dispatching further batches and returns what completed.
 * It NEVER abandons in-flight work mid-batch — the current batch always settles
 * — so the route's existing batched `commitPending` commits exactly the entries
 * that finished, keeping the commit-pipeline invariant (no uncommitted files)
 * intact. Cancel is partial + honest: import is additive and collision-safe, so
 * committing the completed prefix and reporting "N of M" is correct.
 */
export interface ImportBatchResult<T> {
    /** Results for every file that was processed before cancel (or all of them). */
    results: T[];
    /** True if the run stopped early because the client disconnected. */
    cancelled: boolean;
}
export declare function runImportBatches<F, T>(files: F[], processFile: (file: F) => Promise<T>, opts: {
    concurrency: number;
    isAborted?: () => boolean;
}): Promise<ImportBatchResult<T>>;
