INNER CODE UNIT · TypeScript
createDownload
SurgeDM/Surge · extension/entrypoints/popup/store/index.ts:137
function createDownload(
message: DownloadStartedMsg | DownloadQueuedMsg,
status: DownloadStatus['status'],
totalSize = 0,
): DownloadStatus {
return {
id: message.DownloadID,
url: message.URL,
filename: message.Filename,
dest_path: message.DestPath,
total_size: totalSize,
downloaded: 0,
progress: 0,
speed: 0,
status,
eta: 0,
connections: 0,
added_at: Date.now(),