DownloadProgress

external class DownloadProgress(source)

Constructors

Link copied to clipboard
constructor(contentLength: Number)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun display()

Prints the current download stats. Once the download completes, this will print one last line and then stop.

Link copied to clipboard

Returns the total number of bytes transferred.

Link copied to clipboard

Returns true if the download is complete.

Link copied to clipboard
fun nextSegment(segmentSize: Number)

Progress to the next segment. Only call this method when the previous segment is complete.

Link copied to clipboard
fun onProgress(): (progress: TransferProgressEvent) -> Unit

Returns a function used to handle TransferProgressEvents.

Link copied to clipboard
fun setReceivedBytes(receivedBytes: Number)

Sets the number of bytes received for the current segment.

Link copied to clipboard
fun startDisplayTimer(delayInMs: Number = definedExternally)

Starts the timer that displays the stats.

Link copied to clipboard

Stops the timer that displays the stats. As this typically indicates the download is complete, this will display one last line, unless the last line has already been written.