Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

electron-dl

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-dl - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

21

index.d.ts

@@ -9,2 +9,10 @@ import {BrowserView, BrowserWindow, DownloadItem} from 'electron';

}
interface File {
filename: string,
path: string,
fileSize: number,
mimeType: string,
url: string
}

@@ -64,2 +72,10 @@ interface Options {

readonly onProgress?: (progress: Progress) => void;
/**
Optional callback that receives an object containing information about the combined progress of all download items done within any registered window.
Each time a new download is started, the next callback will include it. The progress percentage could therefore become smaller again.
This callback provides the same data that is used for the progress bar on the app icon.
*/
readonly onTotalProgress?: (file: File) => void;

@@ -70,2 +86,7 @@ /**

readonly onCancel?: (item: DownloadItem) => void;
/**
Optional callback that receives an object with information about an item that has been completed. It is called for each completed item.
*/
readonly onCompleted?: (completed: Completed) => void;

@@ -72,0 +93,0 @@ /**

@@ -116,2 +116,10 @@ 'use strict';

}
if (typeof options.onTotalProgress === 'function') {
options.onTotalProgress({
percent: progressDownloadItems(),
transferredBytes: receivedBytes,
totalBytes
});
}
});

@@ -154,2 +162,12 @@

if (typeof options.onCompleted === 'function') {
options.onCompleted({
fileName: item.getFilename(),
path: item.getSavePath(),
fileSize: item.getReceivedBytes(),
mimeType: item.getMimeType(),
url: item.getURL()
});
}
callback(null, item);

@@ -156,0 +174,0 @@ }

2

package.json
{
"name": "electron-dl",
"version": "3.1.0",
"version": "3.2.0",
"description": "Simplified file downloads for your Electron app",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -145,2 +145,19 @@ # electron-dl

#### onTotalProgress
Type: `Function`
Optional callback that receives an object containing information about the combined progress of all download items done within any registered window.
Each time a new download is started, the next callback will include it. The progress percentage could therefore become smaller again.
This callback provides the same data that is used for the progress bar on the app icon.
```js
{
percent: 0.1,
transferredBytes: 100,
totalBytes: 1000
}
```
#### onCancel

@@ -152,2 +169,17 @@

#### onCompleted
Type: `Function`
Optional callback that receives an object with information about an item that has been completed. It is called for each completed item.
```js
{
filename: 'file.zip',
path: '/path/file.zip',
fileSize: 503320,
mimeType: 'application/zip',
url: 'https://example.com/file.zip'
}
#### openFolderWhenDone

@@ -154,0 +186,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc