DownloadProgress

open external class DownloadProgress(source)

Constructors

Link copied to clipboard
constructor(contentLength: Number)

Properties

Link copied to clipboard
external var contentLength: Number
Link copied to clipboard
Link copied to clipboard
external var receivedBytes: Number
Link copied to clipboard
external var segmentIndex: Number
Link copied to clipboard
external var segmentOffset: Number
Link copied to clipboard
external var segmentSize: Number
Link copied to clipboard
external var startTime: Number
Link copied to clipboard
external var timeoutHandle: Timeout?

Functions

Link copied to clipboard
external fun display()

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

Link copied to clipboard
external fun getTransferredBytes(): Number

Returns the total number of bytes transferred.

Link copied to clipboard
external fun isDone(): Boolean

Returns true if the download is complete.

Link copied to clipboard
external fun nextSegment(segmentSize: Number)

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

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

Returns a function used to handle TransferProgressEvents.

Link copied to clipboard
external fun setReceivedBytes(receivedBytes: Number)

Sets the number of bytes received for the current segment.

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

Starts the timer that displays the stats.

Link copied to clipboard
external fun stopDisplayTimer()

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.