import { IEventHub } from '../../events';
import { DownloadTransaction } from '../../models';
import { IDownloadTransactionsRepository } from '../../repositories';
import { ILogger } from '../../utilities';
import { DownloadDatabase } from './DownloadDatabase';

export declare class DownloadTransactionsRepository implements IDownloadTransactionsRepository {
    private eventHub;
    private logger;
    private db;
    constructor(eventHub: IEventHub, logger: ILogger, db: DownloadDatabase);
    /**
     * Get first transaction ready for processing
     *
     * @returns DownloadTransaction. NULL if no transaction is ready.
     */
    getNextReady(): Promise<DownloadTransaction | null>;
    /**
     * Get transaction with specific ID
     *
     * @param id Transaction ID
     * @returns DownloadTransaction. NULL if transaction does not exist.
     */
    get(id: string): Promise<DownloadTransaction | null>;
    /**
     * Save transaction into DB
     *
     * @param transaction DownloadTransaction
     * @returns boolean. True if save succeeded. False otherwise
     */
    save(transaction: DownloadTransaction): Promise<boolean>;
    /**
     * Delete all transactions
     *
     * @returns boolean. True if all transactions are deleted.
     */
    deleteAll(): Promise<boolean>;
}
