import { default as Dexie } from 'dexie';
import { DownloadContext } from '../../context';
import { DownloadFileState, DownloadTransactionState } from '../../models';

export declare class DownloadDatabase extends Dexie {
    transactions: Dexie.Table<IDbDownloadTransaction, string>;
    files: Dexie.Table<IDbDownloadFile, string>;
    chunkedFiles: Dexie.Table<IDbChunkedDownloadFile, string>;
    chunks: Dexie.Table<IDbDownloadChunk, string>;
    constructor(context: DownloadContext);
}
export interface IDbModel {
    id: string;
    version: number;
}
export interface IDbDownloadTransaction extends IDbModel {
    location: string;
    state: DownloadTransactionState;
}
export interface IDbDownloadFile extends IDbModel {
    approximateSize: number;
    cloudURLs: string[];
    createDate: number;
    exactSize: number;
    index: number;
    name: string;
    path: string;
    paused: number;
    progress: number;
    state: DownloadFileState;
    stateDetails: string;
    transactionID: string;
}
export interface IDbChunkedDownloadFile extends IDbModel {
    nextChunkOffset: number;
}
export interface IDbDownloadChunk extends IDbModel {
    fileID: string;
    fromByte: number;
    maxRetryCount: number;
    path: string;
    processed: number;
    retryCount: number;
    toByte: number;
}
