Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.d.ts to loosen type restriction on download #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Salketer
Copy link

Electron has recently WebContentsView which is not included in the types expected by download. Since download only uses the webContents property, I suggest we loosen the type to anything that has that property. This would make it useful for anything that gets added in the futur too.

@@ -178,7 +179,7 @@ ipcMain.on('download-button', async (event, {url}) => {
```
*/
export function download(
window: BrowserWindow | BrowserView,
window: { webContents: Electron.WebContents },
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has the downside of not making it clear to the user what they can pass in. Autocomplete is more important than flexibility here I think. So I prefer to just list the supported types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants