UploadProgress

open external class UploadProgress(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 sentBytes: 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 upload stats. Once the upload 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 upload 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 setSentBytes(sentBytes: Number)

Sets the number of bytes sent

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 upload is complete, this will display one last line, unless the last line has already been written.