electron-dl
Advanced tools
Comparing version 3.4.1 to 3.5.0
@@ -1,2 +0,2 @@ | ||
import {BrowserView, BrowserWindow, DownloadItem} from 'electron'; | ||
import {BrowserView, BrowserWindow, DownloadItem, SaveDialogOptions} from 'electron'; | ||
@@ -121,2 +121,11 @@ declare namespace electronDl { | ||
readonly overwrite?: boolean; | ||
/** | ||
Customize the save dialog. | ||
If `defaultPath` is not explicity defined, a default value is assigned based on the file path. | ||
@default {} | ||
*/ | ||
readonly dialogOptions?: SaveDialogOptions; | ||
} | ||
@@ -123,0 +132,0 @@ } |
@@ -90,3 +90,3 @@ 'use strict'; | ||
if (options.saveAs) { | ||
item.setSaveDialogOptions({defaultPath: filePath}); | ||
item.setSaveDialogOptions({defaultPath: filePath, ...options.dialogOptions}); | ||
} else { | ||
@@ -93,0 +93,0 @@ item.setSavePath(filePath); |
{ | ||
"name": "electron-dl", | ||
"version": "3.4.1", | ||
"version": "3.5.0", | ||
"description": "Simplified file downloads for your Electron app", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -216,2 +216,11 @@ # electron-dl | ||
#### dialogOptions | ||
Type: [`SaveDialogOptions`](https://www.electronjs.org/docs/latest/api/download-item#downloaditemsetsavedialogoptionsoptions)\ | ||
Default: `{}` | ||
Customize the save dialog. | ||
If `defaultPath` is not explicity defined, a default value is assigned based on the file path. | ||
## Development | ||
@@ -218,0 +227,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18799
314
245