import { ExecutionContext } from '../orangelogic-types';
import { Constructor, EventHandlerFunc, IDownloadManager } from './worker/app/DownloadManager';
import { GetFileQuery, ListAllFilesQuery } from './worker/app/queries';
import { Event } from './worker/events';
import { FileProgressUpdatedEvent } from './worker/models';
import { FileStateChangedEvent } from './worker/models/DownloadFile';

export declare class WorkerProxy implements IDownloadManager {
    private buildOptions;
    private worker;
    private channel;
    private eventHub;
    private initialized;
    private contextName;
    constructor(ctx: ExecutionContext, workerURL: string, userId: string, siteURL: string, configHash: string);
    private getPreferenceValue;
    private setPreferenceValue;
    private reply;
    private send;
    private sendAndWait;
    private invoke;
    init(): Promise<void>;
    isRocketModeEnabled(): Promise<boolean>;
    toggleRocketMode(enable: boolean): Promise<void>;
    getChunkSize(): Promise<number>;
    updateChunkSize(chunkSize: number): Promise<void>;
    getDefaultRootName(): Promise<string | null>;
    removeDefaultRoot(): Promise<void>;
    registerDefaultRoot(): Promise<string | null>;
    start(enableRocketMode: boolean, keepDownloading: boolean): Promise<void>;
    restart(): Promise<void>;
    handleCookiesRejected(): void;
    registerDownload(transactionID: string): Promise<string | null>;
    startDownload(transactionID: string, location: string): Promise<void>;
    pauseFile(fileID: string): Promise<void>;
    resumeFile(fileID: string): Promise<void>;
    cancelFile(fileID: string): Promise<void>;
    retryFile(fileID: string): Promise<void>;
    pauseAllFiles(ids: string[]): Promise<void>;
    resumeAllFiles(ids: string[]): Promise<void>;
    cancelAllFiles(ids: string[]): Promise<void>;
    retryAllFiles(ids: string[]): Promise<void>;
    deleteFile(fileID: string): Promise<void>;
    deleteAllFiles(): Promise<void>;
    on<T extends Event>(ctor: Constructor<T>, handlerFunc: EventHandlerFunc<T>): () => void;
    onFileProgressUpdated(handlerFunc: EventHandlerFunc<FileProgressUpdatedEvent>): () => void;
    onFileStateChanged(handlerFunc: EventHandlerFunc<FileStateChangedEvent>): () => void;
    listAllFiles(): Promise<ListAllFilesQuery.QueryResult>;
    getFile(id: string): Promise<GetFileQuery.QueryResult>;
}
