interface TransferTask<Result> {
    result: Promise<Result>;
    state: TransferTaskState;
    cancel(message?): void;
    pause(): void;
    resume(): void;
}

Type Parameters

  • Result

Properties

Methods

Properties

result: Promise<Result>

Promise that resolves when the transfer task is completed. The promise will be rejected if the task is canceled.

Current state of the transfer task.

Methods

  • Cancel an ongoing transfer(upload/download) task. This will reject the result promise with an AbortError by default. You can use isCancelError to check if the error is caused by cancellation.

    Parameters

    • Optional message: string

      Optional error message to overwrite the default canceled message thrown when the task is canceled. If provided, the result promise will be rejected with a CanceledError with supplied error message instead.

    Returns void

  • Pause an ongoing transfer(upload/download) task. This method does not support the following scenarios:

    • Downloading data or file from given key.

    Returns void

  • Resume a paused transfer(upload/download) task. This method does not support the following scenarios:

    • Downloading data or file from given key.

    Returns void