import { Event } from '../events';
import { BaseModel } from './BaseModel';
import { DownloadChunk } from './DownloadChunk';

export declare class FileAddedEvent extends Event {
    fileID: string;
    name: string;
    path: string;
    state: DownloadFileState;
    stateDetails: string;
    progress: number;
    size: number;
    paused: boolean;
    createDate: number;
    static readonly type: string;
    constructor(fileID: string, name: string, path: string, state: DownloadFileState, stateDetails: string, progress: number, size: number, paused: boolean, createDate: number);
}
export declare class FileDeletedEvent extends Event {
    fileID: string;
    static readonly type: string;
    constructor(fileID: string);
}
export declare class FileModifiedEvent extends Event {
    fileID: string;
    name: string;
    path: string;
    state: DownloadFileState;
    stateDetails: string;
    progress: number;
    size: number;
    paused: boolean;
    createDate: number;
    static readonly type: string;
    /**
     *
     * @param fileID
     */
    constructor(fileID: string, name: string, path: string, state: DownloadFileState, stateDetails: string, progress: number, size: number, paused: boolean, createDate: number);
}
export declare class FileMetadataUpdatedEvent extends Event {
    fileID: string;
    static readonly type: string;
    constructor(fileID: string);
}
export declare class FileProgressUpdatedEvent extends Event {
    currentProgress: number;
    fileSize: number;
    static readonly type: string;
    constructor(currentProgress: number, fileSize: number);
}
export declare class FileStateChangedEvent extends Event {
    fileID: string;
    currentState: DownloadFileState;
    transactionID: string;
    static readonly type: string;
    constructor(fileID: string, currentState: DownloadFileState, transactionID: string);
}
export declare class FilePausedEvent extends Event {
    fileID: string;
    static readonly type: string;
    constructor(fileID: string);
}
export declare class FileResumedEvent extends Event {
    fileID: string;
    static readonly type: string;
    constructor(fileID: string);
}
export declare class FileCancelledEvent extends Event {
    fileID: string;
    static readonly type: string;
    constructor(fileID: string);
}
export declare class FileRetriedEvent extends Event {
    fileID: string;
    static readonly type: string;
    constructor(fileID: string);
}
/** State of download file */
export declare enum DownloadFileState {
    Assembling = "Assembling",
    Cancelled = "Cancelled",
    Completed = "Completed",
    Downloading = "Downloading",
    Failed = "Failed",
    Missing = "Missing",
    ReadyForDownload = "ReadyForDownload",
    WaitingServerProcessing = "WaitingServerProcessing"
}
export declare enum DownloadFileStateDetails {
    MissingFileErrorMessage = "MissingFileErrorMessage",
    NetworkErrorMessage = "NetworkErrorMessage",
    NotEnoughStorageErrorMessage = "NotEnoughStorageErrorMessage"
}
export declare const PLACEHOLDER_CLOUD_URL = "__PLACEHOLDER_CLOUD_URL__";
/** Download file */
export declare class DownloadFile extends BaseModel {
    readonly index: number;
    private exactSize;
    private approximateSize;
    private state;
    stateDetails: string;
    private progress;
    private createDate;
    readonly transactionID: string;
    private paused;
    cloudURLs: string[];
    private _name;
    get name(): string;
    private _path;
    get path(): string;
    set path(value: string);
    constructor(id: string, index: number, name: string, path: string, exactSize: number, approximateSize: number, state: DownloadFileState, stateDetails: string, progress: number, createDate: number, transactionID: string, paused?: boolean, cloudURLs?: string[], version?: number);
    private setState;
    static create(transactionID: string, index: number, path: string, exactSize?: number, approximateSize?: number, state?: DownloadFileState, directCloudURLs?: string[]): DownloadFile;
    equals(file: DownloadFile): boolean;
    clone(): DownloadFile;
    getProgress(): number;
    getState(): DownloadFileState;
    getExactSize(): number;
    getApproximateSize(): number;
    get size(): number;
    isEmpty(): boolean;
    markReady(): void;
    markMissing(): void;
    hasCompleted(): boolean;
    complete(): void;
    fail(msg?: string): void;
    hasFailedOrMissing(): boolean;
    needToFetchCloudURL(): boolean;
    canCancel(): boolean;
    cancel(): void;
    isCancelled(): boolean;
    canRetry(): boolean;
    retry(): void;
    isPaused(): boolean;
    canPause(): boolean;
    pause(): void;
    canResume(): boolean;
    resume(): void;
    startDownloading(): void;
    hasFinishedDownloading(): boolean;
    isDownloading(): boolean;
    updateMetadata(exactSize: number, approxSize: number, path: string, directCloudURLs: string[]): void;
    increaseProgress(bytes: number): void;
    createFileAddedEvent(): FileAddedEvent;
    createFileDeleted(): FileDeletedEvent;
    createFileModifiedEvent(): FileModifiedEvent;
    createFileMetadataUpdatedEvent(): FileMetadataUpdatedEvent;
    createFileProgressUpdatedEvent(): FileProgressUpdatedEvent;
    createFileStateChangedEvent(): FileStateChangedEvent;
    createFilePausedEvent(): FilePausedEvent;
    createFileResumedEvent(): FileResumedEvent;
    createFileCancelledEvent(): FileCancelledEvent;
    createFileRetriedEvent(): FileRetriedEvent;
}
/** Download file chunks info */
export declare class ChunkedDownloadFile extends BaseModel {
    readonly file: DownloadFile;
    readonly inProgressChunks: DownloadChunk[];
    readonly inProgressChunksLimit: number;
    private _nextChunkOffset;
    get nextChunkOffset(): number;
    constructor(file: DownloadFile, nextChunkOffset: number, inProgressChunks: DownloadChunk[], inProgressChunksLimit: number, version?: number);
    static create(file: DownloadFile, chunksLimit: number): ChunkedDownloadFile;
    equals(chunkedFile: ChunkedDownloadFile): boolean;
    clone(): ChunkedDownloadFile;
    hasBeenChunked(): boolean;
    completelyChunked(): boolean;
    createChunks(chunkSize: number, maxChunkRetryCount: number, limit?: number): void;
}
