import { DownloadContext } from '../context';
import { Event, IEventHub } from '../events';
import { IDownloadApiClient } from '../external';
import { DownloadChunk } from '../models';
import { IDownloadChunksRepository, IDownloadFilesRepository } from '../repositories';
import { IStorage } from '../storage';
import { ILocker, ILogger, IRetrier } from '../utilities';
import { BackgroundJob } from './BackgroundJob';

export declare enum DownloadError {
    FileNotFound = "FILE_NOT_FOUND"
}
export declare class DataDownloadedEvent extends Event {
    readonly bytesLength: number;
    readonly start: number;
    readonly end: number;
    static readonly type: string;
    /**
     *
     * @param bytesLength The amount of bytes downloaded
     * @param start The timestamp when this chunk of data starts to download
     * @param end The timestamp when this chunk of data finishes downloading
     */
    constructor(bytesLength: number, start: number, end: number);
}
export declare class ChunkDownloader extends BackgroundJob {
    private chunksRepo;
    private filesRepo;
    private apiClient;
    private storage;
    private eventHub;
    private retrier;
    private locker;
    static readonly type: string;
    private static readonly _roundRobinMapPerFile;
    constructor(chunksRepo: IDownloadChunksRepository, filesRepo: IDownloadFilesRepository, apiClient: IDownloadApiClient, storage: IStorage, eventHub: IEventHub, retrier: IRetrier, locker: ILocker, logger: ILogger, context: DownloadContext);
    static logsProvider: {
        error: {
            failedToDownloadFromCloud: (chunk: DownloadChunk, cloudURL: string) => string;
            failedToProcessChunk: (chunk: DownloadChunk) => string;
        };
        info: {
            chunkDownloaded: (chunk: DownloadChunk) => string;
            chunkStored: (chunk: DownloadChunk) => string;
            startDownloadingChunk: (chunk: DownloadChunk) => string;
        };
        warn: {
            fileNotDownloading: (chunk: DownloadChunk) => string;
            fileNotExist: (chunk: DownloadChunk) => string;
        };
    };
    protected processInternal(signal: AbortSignal): Promise<void>;
}
