import { Observable, Observer } from 'rxjs';
import { VcdHttpClient } from './vcd.http.client';
/**
 * Default chunk size is 50MiB.  This is equal to the chunk size the VCD UI uses for library uploads.
 */
export declare const MAX_CHUNK_SIZE: number;
/**
 * How many times to retry a chunk upload.
 */
export declare const MAX_CHUNK_RETRY_COUNT = 5;
/**
 * Details about a completed file transfer.
 */
export interface TransferResult {
    /**
     * Filename being transferred.
     */
    filename: string | '<blob>';
    /**
     * URL being used for the transfer.
     */
    transferUrl: string;
    /**
     * How many retries in total were required
     */
    retryCount: number;
    /**
     * The number of chunks that have been sent.
     */
    chunksSent: number;
    /**
     * How many bytes have been sent.
     */
    bytesSent: number;
    /**
     * How many milliseconds that have elapsed since starting the transfer.
     */
    timeTakenMs: number;
}
/**
 * Details about a file transfer in progress.
 */
export interface TransferProgress {
    /**
     * Filename being transferred.
     */
    filename: string | '<blob>';
    /**
     * URL being used for the transfer.
     */
    transferUrl: string;
    /**
     * The current retry number for the current chunk.
     */
    retryNumber: number;
    /**
     * The number of retries in total.
     */
    retryCount: number;
    /**
     * The number of chunks that have been sent.
     */
    chunksSent: number;
    /**
     * The number of chunks remaining.
     */
    chunksRemaining: number;
    /**
     * How many bytes have been sent.
     */
    bytesSent: number;
    /**
     * How many bytes remaining to be sent.
     */
    bytesRemaining: number;
    /**
     * Percentage completion.
     */
    percent: number;
    /**
     * How many milliseconds that have elapsed since starting the transfer.
     */
    timeTakenMs: number;
    /**
     * Naive estimate of time remaining.  This is not scientific at all - a simple linear extrapolation.
     */
    estimatedTimeRemainingMs: number;
}
/**
 * A special error thrown by the transfer client.  It gives access to the causing error, and the final progress
 * before the error occurred.
 */
export declare class TransferError extends Error {
    readonly originalError: any;
    readonly lastProgress: TransferProgress;
    constructor(message: string, originalError: any, lastProgress: TransferProgress);
}
/**
 * This is used to upload files to a VCD API transfer URL.  It is not suggested to create this class - instead
 * use the startTransfer method in VcdApiClient.
 */
export declare class VcdTransferClient {
    httpClient: VcdHttpClient;
    transferUrl: string;
    maxChunkSize: number;
    maxChunkRetryCount: number;
    /**
     * Create a transfer client.
     * @param httpClient the http client to be used
     * @param transferUrl the URL to upload to
     */
    constructor(httpClient: VcdHttpClient, transferUrl: string, maxChunkSize?: number, maxChunkRetryCount?: number);
    /**
     * Upload data, optionally listening for progress updates.
     * @param source what to upload.
     * @param progressObserver (optional) this will get progress notifications during the upload
     * @returns fetails of the finished upload.
     * @throws TransferError when a chunk upload fails.
     */
    upload(source: Blob | File, progressObserver?: Observer<TransferProgress>): Observable<TransferResult>;
}
